forked from sPHENIX-Collaboration/coresoftware
/
ReadEICFiles.h
76 lines (55 loc) · 1.59 KB
/
ReadEICFiles.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
// Tell emacs that this is a C++ source
// -*- C++ -*-.
#ifndef G4MAIN_READEICFILES_H
#define G4MAIN_READEICFILES_H
#include <fun4all/SubsysReco.h>
#include <phhepmc/PHHepMCGenHelper.h>
#include <string>
class PHCompositeNode;
class TChain;
namespace erhic
{
class EventMC;
}
class ReadEICFiles : public SubsysReco, public PHHepMCGenHelper
{
public:
ReadEICFiles(const std::string &name = "EICReader");
~ReadEICFiles() override;
int Init(PHCompositeNode *topNode) override;
int process_event(PHCompositeNode *topNode) override;
/** Specify name of input file to open */
bool OpenInputFile(const std::string &name);
/** Set first entry from input tree to be used */
void SetFirstEntry(int e) { entry = e; }
/** Set name of output node */
void SetNodeName(const std::string &s) { _node_name = s; }
private:
/** Get tree from input file */
void GetTree();
/** Creade node on node tree */
int CreateNodeTree(PHCompositeNode *topNode);
enum EvtGen
{
Milou = 1,
DEMP = 2,
Unknown = 100
};
/** Name of file containing input tree */
std::string filename;
/** Input tree created with eic-smear tree builder */
TChain *Tin;
/** Number of events in input tree */
int nEntries;
/** Number of current event being used from input tree */
int entry;
/** Event Generator id */
int m_EvtGenId;
/** Pinter to event record in tree (= branch).
Use 'abstract' EventMC class pointer from which all
event types (erhic::EventMilou etc) inherit from. */
erhic::EventMC *GenEvent;
// output
std::string _node_name;
};
#endif /* READEICFILES_H__ */