14 #ifndef StMcEEmcTreeMaker_H_
15 #define StMcEEmcTreeMaker_H_
44 void Clear(Option_t *opts=
"");
50 enum iostatus_t { READ, WRITE, UNSET };
53 void setTreeStatus( iostatus_t iostatus,
const Char_t* fileName );
54 void setMaxNumEvents( Int_t maxNum );
55 void setEnergyThreshold( Float_t val );
57 void addTrigger( Int_t trig );
58 void removeTrigger( Int_t trig );
62 Int_t getNumAncestorParticles()
const;
63 Int_t getNumVertices()
const;
65 TIter getIncidentParticleIter();
66 TIter getAncestorParticleIter();
68 TVector3* getVertex( Int_t idx);
77 std::string mFilename;
94 Float_t mTowEnergyThres;
97 std::set< Int_t > mTriggerSet;
102 TClonesArray *mAncestorParticleArr;
103 TClonesArray *mIncidentParticleArr;
104 TClonesArray *mVertexArr;
105 Double_t mBjX1, mBjX2;
108 std::map< const StMcTrack*, Int_t > mAncestorMap;
109 std::map< const StMcVertex*, Int_t > mVertexMap;
110 std::map< const StMcTrack*, Int_t >::iterator mAncestorMapIter;
111 std::map< const StMcVertex*, Int_t >::iterator mVertexMapIter;
115 Int_t getAncestorIdx(
const StMcTrack* );
127 inline Int_t StMcEEmcTreeMaker_t::getNumAncestorParticles()
const {
return mAncestorParticleArr->GetEntriesFast(); };
128 inline Int_t StMcEEmcTreeMaker_t::getNumVertices()
const {
return mVertexArr ->GetEntriesFast(); };
130 inline TIter StMcEEmcTreeMaker_t::getIncidentParticleIter(){
return TIter( mIncidentParticleArr ); };
131 inline TIter StMcEEmcTreeMaker_t::getAncestorParticleIter(){
return TIter( mAncestorParticleArr ); };
133 inline McParticle_t* StMcEEmcTreeMaker_t::getAncestor( Int_t idx ) {
134 return (
McParticle_t*)( idx < mAncestorParticleArr->GetEntriesFast() ? (*mAncestorParticleArr)[idx] : 0 );
137 inline TVector3* StMcEEmcTreeMaker_t::getVertex( Int_t idx ) {
138 return (TVector3*)( idx < mVertexArr->GetEntriesFast() ? (*mVertexArr)[idx] : 0 );
141 inline void StMcEEmcTreeMaker_t::addTrigger( Int_t trig ){ mTriggerSet.insert( trig ); };
142 inline void StMcEEmcTreeMaker_t::removeTrigger( Int_t trig ){ mTriggerSet.erase( trig ); };
Int_t getNumIncidentParticles() const
accessors
virtual ~StMcEEmcTreeMaker_t()
deconstructor
iostatus_t mIOStat
filenames
Monte Carlo Track class All information on a simulated track is stored in this class: kinematics...
void setTreeStatus(iostatus_t iostatus, const Char_t *fileName)
modifiers
StMcEEmcTreeMaker_t(const Char_t *myName)
constructor
Int_t Make()
Build an event.
TChain * mChain
TChains for reading.
Int_t Finish()
Write everything to file.
void Clear(Option_t *opts="")
Clear for next event.
Int_t mMaxNumEvents
max number of events
TClonesArray * mEEmcEnergyArr
The data.
Int_t mNumEvents
number of events processed / written outt
TFile * mFile
TFiles/TTrees for writing.