HepMC3 event record library
ValidationControl.h
1 // -*- C++ -*-
2 //
3 // This file is part of HepMC
4 // Copyright (C) 2014-2019 The HepMC collaboration (see AUTHORS for details)
5 //
6 #ifndef VALIDATION_CONTROL_H
7 #define VALIDATION_CONTROL_H
8 
9 #ifdef HEPMC2
10 #include "HepMC/GenEvent.h"
11 #else
12 #include "HepMC3/GenEvent.h"
13 #include "HepMC3/Print.h"
14 #endif // ifdef HEPMC2
15 
16 #include "ValidationTool.h"
17 #include "Timer.h"
18 
19 #include <vector>
20 #include <string.h>
21 
23 //
24 // Constructors
25 //
26 public:
29 
30 //
31 // Functions
32 //
33 public:
34  void read_file(const std::string &filename);
35  bool new_event();
36  void initialize();
37  void process(GenEvent &hepmc);
38  void finalize();
39 
40 //
41 // Accessors
42 //
43 public:
44  const std::vector<ValidationTool*>& toolchain() { return m_toolchain; }
45  int event_limit() { return m_events; }
46  void set_event_limit(int events) { m_events = events; }
47 
48  void print_events(int events) { m_print_events = events; }
49  void check_momentum_for_events(int events) { m_momentum_check_events = events; }
50 
51 //
52 // Fields
53 //
54 private:
55  std::vector<ValidationTool*> m_toolchain;
56 
57  int m_events;
58  int m_events_print_step;
59  int m_momentum_check_events;
60  double m_momentum_check_threshold;
61  int m_print_events;
62  int m_event_counter;
63  int m_status;
64  Timer m_timer;
65 
66  bool m_has_input_source;
67 
68  enum PARSING_STATUS {
69  PARSING_OK,
70  UNRECOGNIZED_COMMAND,
71  UNRECOGNIZED_OPTION,
72  UNRECOGNIZED_INPUT,
73  UNRECOGNIZED_TOOL,
74  UNAVAILABLE_TOOL,
75  ADDITIONAL_INPUT,
76  CANNOT_OPEN_FILE
77  };
78 };
79 
80 #endif
Stores event-related information.
Definition: GenEvent.h:42
Definition of class GenEvent.
Definition: Timer.h:29