1 #include "StEEmcDisplayMaker.h"
3 #include "StEEmcPool/StEEmcA2EMaker/StEEmcA2EMaker.h"
4 #include "StEEmcPool/StEEmcClusterMaker/StEEmcGenericClusterMaker.h"
5 #include "StEEmcPool/StEEmcPointMaker/StEEmcGenericPointMaker.h"
6 #include "StEEmcPool/StEEmcPi0Mixer/StEEmcPi0Maker.h"
11 #include "StMuDSTMaker/COMMON/StMuDstMaker.h"
12 #include "StMuDSTMaker/COMMON/StMuDst.h"
13 #include "StMuDSTMaker/COMMON/StMuEvent.h"
14 #include "StMuDSTMaker/COMMON/StMuTriggerIdCollection.h"
16 #include "StEvent/StEvent.h"
17 #include "StEvent/StTriggerIdCollection.h"
18 #include "StEvent/StTriggerId.h"
20 #include "StEEmcDisplay.h"
27 StEEmcDisplayMaker::StEEmcDisplayMaker(
const Char_t *name ) :
StMaker(name)
37 Int_t StEEmcDisplayMaker::Init()
43 LOG_INFO<<
"creating TTree, resident in file="<<mFile->GetName()<<endm;
44 mTree=
new TTree(
"mTree",
"StEEmcDisplayMaker TTree");
45 mTree->Branch(
"display",&
mDisplay,32000,2);
46 mTree->SetDirectory( mFile );
49 return StMaker::Init();
58 Int_t
event = GetEventNumber();
60 LOG_INFO<<
"run="<<run<<
" event="<<
event<<endm;
63 if ( mCheckTrigger && !triggerid )
return kStOK;
86 for ( UInt_t ii=0;ii<pairs.size();ii++ )
88 if ( pair.mass() > 0.11 && pair.mass() < 0.16 ) go =
true;
89 if ( pair.mass() > 0.45 && pair.mass() < 0.65 ) go =
true;
91 if ( !go )
return kStOK;
104 TString name=
"R";name+=run;name+=
"-";name+=event;
105 TString title=
"run=";title+=run;
106 title+=
" event=";title+=event;
109 title+=
" ntow/pre1/pre2/post=";
126 for ( Int_t layer=0;layer<4;layer++ )
131 for ( Int_t sec=0;sec<12;sec++ )
132 for ( Int_t plane=0;plane<2;plane++ )
138 LOG_WARN<<
" adc-to-energy maker not in chain"<<endm;
147 StEEmcSmdClusterVec_t uclusters;
148 StEEmcSmdClusterVec_t vclusters;
149 std::vector<Int_t> uflags;
150 std::vector<Int_t> vflags;
151 std::map<Int_t,Int_t> umap;
152 std::map<Int_t,Int_t> vmap;
160 for ( Int_t sec=0;sec<12;sec++ )
163 for ( UInt_t ii=0;ii<u.size();ii++ )
165 uclusters.push_back( u[ii] );
167 umap[ u[ii].key() ] = nu;
168 LOG_INFO<<
"++++ ukey="<<u[ii].key()<<
" uid="<<nu << endm;
173 for ( UInt_t ii=0;ii<v.size();ii++ )
175 vclusters.push_back( v[ii] );
177 vmap[ v[ii].key() ] = nv;
178 LOG_INFO<<
"++++ vkey="<<v[ii].key()<<
" vid="<<nv << endm;
186 LOG_WARN<<
" cluster maker not in chain"<<endm;
197 std::vector<Int_t> pflags;
198 std::vector<Int_t> point_uid;
199 std::vector<Int_t> point_vid;
204 for ( UInt_t ii=0;ii<points.size();ii++ )
211 pflags.push_back( 0 );
212 Int_t uid=umap[ukey];
213 Int_t vid=vmap[vkey];
214 point_uid.push_back( uid );
215 point_vid.push_back( vid );
216 LOG_INFO<<
"++++" <<
" point key="<<p.key()<<
" ukey="<<ukey<<
" vkey="<<vkey <<
" uid="<<uid<<
" vid="<<vid << endm;
221 LOG_WARN<<
" point maker not in chain" << endm;
232 StEEmcPairVec_t pairs;
238 LOG_WARN<<
" pi0 maker is not in chain"<<endm;
252 for ( UInt_t i = 0; i < points.size(); i++ )
256 Int_t icol = 20 + 10 * ( i%3 ) + i/3;
269 uflags[ point_uid[i] ] = 1;
270 vflags[ point_vid[i] ] = 1;
276 for ( UInt_t i = 0; i < uclusters.size(); i++ )
279 if ( uflags[i] )
continue;
284 for ( UInt_t i = 0; i < vclusters.size(); i++ )
287 if ( vflags[i] )
continue;
297 LOG_WARN<<
" tree doesn't exist, no data saved"<<endm;
312 mFile=
new TFile(file,opts);
339 nominal = mumk->
muDst()->
event()->triggerIdCollection().nominal();
347 nominal=*
event->triggerIdCollection()->nominal();
373 static TString triggers=
"";
381 nominal = mumk->
muDst()->
event()->triggerIdCollection().nominal();
388 nominal=*
event->triggerIdCollection()->nominal();
408 return triggers.Data();
void clear()
clears all storage arrays, deletes all canvases and histograms
TFile * setFile(TFile *file)
StEEmcSmdClusterVec_t & smdclusters(Int_t sec, Int_t plane)
Return a vector of smd clusters.
void cluster(const StEEmcSmdCluster &c, Int_t plane)
Add an smd cluster to this point.
Base class for representing EEMC points.
StEEmcTower & hittower(Int_t hit, Int_t layer)
StEEmcGenericPointMaker * mEEpoints
const Char_t * triggerList()
void Clear(Option_t *opts="")
User defined functions.
std::vector< Int_t > mTriggerList
StEEmcStrip & hitstrip(Int_t sec, Int_t pl, Int_t hit)
StEEmcPairVec_t pairs()
Return a copy of the list of diphoton candidates.
Int_t numberOfHitStrips(Int_t sector, Int_t plane) const
Int_t numberOfHitTowers(Int_t layer) const
StEEmcA2EMaker * mEEanalysis
StEEmcGenericClusterMaker * mEEclusters
StEEmcPi0Maker * mEEpairs
void add(StEEmcTower tower)
Add a tower to the display.
static StMuEvent * event()
returns pointer to current StMuEvent (class holding the event wise information, e.g. event number, run number)
Int_t key()
Return a unique key assigned by the cluster maker.
virtual Int_t GetRunNumber() const
Returns the current RunNumber.
A base class for representing clusters of EEMC smd strips.
void points(StEEmcGenericPointMaker *p)
StEEmcPointVec_t & points()
Return vector of EEmc points.