@@ -27,91 +27,89 @@ class TClonesArray;
2727
2828namespace o2
2929{
30- namespace eventgen
30+ namespace eventgen
31+ {
32+ // / A class that reads in particles of class @c TParticle from a
33+ // / branch in a @c TChain.
34+ // /
35+ // / Optionally, a program that generates such a @c TTree can be
36+ // / spawn, and the @c TParticles written to a file from which this
37+ // / object reads them in. This is done with
38+ // /
39+ // / --configKeyValues "TParticle.progCmd=<eg program and options>"
40+ // /
41+ // / which will execute the specified EG program with the given
42+ // / options. The EG program _must_ support the command line options
43+ // /
44+ // / -n NUMBER Number of events to generate
45+ // / -o FILENAME Name of file to write to
46+ // /
47+ // / The tree name and particle branch names can be configured.
48+ // /
49+ // / --configKeyValues "TParticle.treeName=T,TParticle.branchName=P"
50+ // /
51+ // / File(s) to read are also configurable
52+ // /
53+ // / --configKeyValues "TParticle.fileNames=foo.root,bar.root"
54+ // /
55+ class GeneratorTParticle : public Generator
56+ {
57+ public:
58+ /* * CTOR */
59+ GeneratorTParticle () = default ;
60+ /* * CTOR */
61+ GeneratorTParticle (const std::string& name)
62+ : Generator(name.c_str(), " ALICEo2 TParticle Generator" )
3163 {
32- // / A class that reads in particles of class @c TParticle from a
33- // / branch in a @c TChain.
34- // /
35- // / Optionally, a program that generates such a @c TTree can be
36- // / spawn, and the @c TParticles written to a file from which this
37- // / object reads them in. This is done with
38- // /
39- // / --configKeyValues "TParticle.progCmd=<eg program and options>"
40- // /
41- // / which will execute the specified EG program with the given
42- // / options. The EG program _must_ support the command line options
43- // /
44- // / -n NUMBER Number of events to generate
45- // / -o FILENAME Name of file to write to
46- // /
47- // / The tree name and particle branch names can be configured.
48- // /
49- // / --configKeyValues "TParticle.treeName=T,TParticle.branchName=P"
50- // /
51- // / File(s) to read are also configurable
52- // /
53- // / --configKeyValues "TParticle.fileNames=foo.root,bar.root"
54- // /
55- class GeneratorTParticle : public Generator
56- {
57- public:
58- /* * CTOR */
59- GeneratorTParticle () = default ;
60- /* * CTOR */
61- GeneratorTParticle (const std::string& name)
62- : Generator(name.c_str()," ALICEo2 TParticle Generator" )
63- {}
64- /* * DTOR */
65- virtual ~GeneratorTParticle ();
64+ }
65+ /* * DTOR */
66+ virtual ~GeneratorTParticle ();
6667
67- /* * Initialize this generator. This will set up the chain.
68- Optionally, if a command line was specified by @c
69- TParticle.progCmd then that command line is executed in the
70- background and events are read from the output file of that
71- program */
72- Bool_t Init () override ;
68+ /* * Initialize this generator. This will set up the chain.
69+ Optionally, if a command line was specified by @c
70+ TParticle.progCmd then that command line is executed in the
71+ background and events are read from the output file of that
72+ program */
73+ Bool_t Init () override ;
7374
74- /* * Read in the next entry from the chain. Returns false in
75- case of errors or no more entries to read. */
76- Bool_t generateEvent () override ;
75+ /* * Read in the next entry from the chain. Returns false in
76+ case of errors or no more entries to read. */
77+ Bool_t generateEvent () override ;
7778
78- /* * Import the read-in particles into the steer particle
79- stack */
80- Bool_t importParticles () override ;
79+ /* * Import the read-in particles into the steer particle
80+ stack */
81+ Bool_t importParticles () override ;
8182
82- /* * Set the names of files to read, separated by commas */
83- void setFileNames (const std::string& val);
84- /* * Set the name of the tree in the files. The tree _must_
85- reside in the top-level directory of the files. */
86- void setTreeName (const std::string& val) { mTreeName = val; }
87- /* * Set the branch name of the branch that holds a @c
88- TClonesArray of @c TParticle objects */
89- void setBranchName (const std::string& val) { mBranchName = val; }
90- /* * Set child program command line to (optionally) execute */
91- void setProgCmd (const std::string& val) { mProgCmd = val; }
92- /* * Set the number of events to generate. */
93- void setNEvents (unsigned int nev) { mNEvents = nev; }
94- protected:
95- std::string mTreeName = " T" ;
96- std::string mBranchName = " Particles" ;
97- std::string mProgCmd = " " ;
98- std::list<std::string> mFileNames ;
99- unsigned int mNEvents = 0 ;
100- unsigned int mEntry = 0 ;
101- TChain* mChain ;
102- TClonesArray* mTParticles ;
83+ /* * Set the names of files to read, separated by commas */
84+ void setFileNames (const std::string& val);
85+ /* * Set the name of the tree in the files. The tree _must_
86+ reside in the top-level directory of the files. */
87+ void setTreeName (const std::string& val) { mTreeName = val; }
88+ /* * Set the branch name of the branch that holds a @c
89+ TClonesArray of @c TParticle objects */
90+ void setBranchName (const std::string& val) { mBranchName = val; }
91+ /* * Set child program command line to (optionally) execute */
92+ void setProgCmd (const std::string& val) { mProgCmd = val; }
93+ /* * Set the number of events to generate. */
94+ void setNEvents (unsigned int nev) { mNEvents = nev; }
10395
104- void waitForData ();
96+ protected:
97+ std::string mTreeName = " T" ;
98+ std::string mBranchName = " Particles" ;
99+ std::string mProgCmd = " " ;
100+ std::list<std::string> mFileNames ;
101+ unsigned int mNEvents = 0 ;
102+ unsigned int mEntry = 0 ;
103+ TChain* mChain ;
104+ TClonesArray* mTParticles ;
105105
106- ClassDefOverride (GeneratorTParticle,1 );
107- };
108- }
109- }
106+ void waitForData ();
107+
108+ ClassDefOverride (GeneratorTParticle, 1 );
109+ };
110+ } // namespace eventgen
111+ } // namespace o2
110112#endif
111113//
112114// EOF
113115//
114-
115-
116-
117-
0 commit comments