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/// @class ValidationControl
22/// @brief Runs multiple validation tools
24//
25// Constructors
26//
27public:
28 /** @brief Constructor */
30 /** @brief Destructor */
32
33//
34// Functions
35//
36public:
37 /** @brief Read file */
38 void read_file(const std::string &filename);
39 /** @brief New event */
40 bool new_event();
41 /** @brief Init function */
42 void initialize();
43 /** @brief Process event */
44 void process(GenEvent &hepmc);
45 /** @brief Finalize */
46 void finalize();
47
48//
49// Accessors
50//
51public:
52 /** @brief Toolchain */
53 const std::vector<ValidationTool*>& toolchain() { return m_toolchain; }
54 /** @brief Event limit */
55 int event_limit() { return m_events; }
56 /** @brief Set event limit */
57 void set_event_limit(int events) { m_events = events; }
58 /** @brief N events to print*/
59 void print_events(int events) { m_print_events = events; }
60 /** @brief N events to check momentum*/
62
63//
64// Fields
65//
66private:
67 std::vector<ValidationTool*> m_toolchain; ///< Toolchain
68
69 int m_events; ///< events
70 int m_events_print_step; ///< events print step
71 int m_momentum_check_events; ///< mom check events
72 double m_momentum_check_threshold; ///< mom check threshold
73 int m_print_events; ///< print events
74 int m_event_counter; ///< counter of events
75 int m_status; ///< status
76 Timer m_timer; ///< Times
77
78 bool m_has_input_source; ///< Input source flag
79
80 /** @brief parsing stutus */
82 PARSING_OK,
83 UNRECOGNIZED_COMMAND,
84 UNRECOGNIZED_OPTION,
85 UNRECOGNIZED_INPUT,
86 UNRECOGNIZED_TOOL,
87 UNAVAILABLE_TOOL,
88 ADDITIONAL_INPUT,
89 CANNOT_OPEN_FILE
90 };
91};
92
93#endif
Definition of class GenEvent.
Definition of static class Print.
Stores event-related information.
Definition: GenEvent.h:41
Used to benchmark MC generators.
Definition: Timer.h:38
Runs multiple validation tools.
const std::vector< ValidationTool * > & toolchain()
Toolchain.
int event_limit()
Event limit.
bool new_event()
New event.
int m_event_counter
counter of events
void initialize()
Init function.
void set_event_limit(int events)
Set event limit.
ValidationControl()
Constructor.
void process(GenEvent &hepmc)
Process event.
void finalize()
Finalize.
int m_events_print_step
events print step
bool m_has_input_source
Input source flag.
int m_print_events
print events
PARSING_STATUS
parsing stutus
~ValidationControl()
Destructor.
void print_events(int events)
N events to print.
std::vector< ValidationTool * > m_toolchain
Toolchain.
void check_momentum_for_events(int events)
N events to check momentum.
double m_momentum_check_threshold
mom check threshold
void read_file(const std::string &filename)
Read file.
int m_momentum_check_events
mom check events