7 #include "StEEsoloPi0Maker.h"
10 #include "TClonesArray.h"
11 #include "StL0Trigger.h"
12 #include "StEventInfo.h"
13 #include "StEventSummary.h"
14 #include "StarClassLibrary/StThreeVectorF.hh"
15 #include "StMuDSTMaker/COMMON/StMuEvent.h"
16 #include "StMuDSTMaker/COMMON/StMuTrack.h"
17 #include "StMuDSTMaker/COMMON/StMuDstMaker.h"
18 #include "StMuDSTMaker/COMMON/StMuTriggerIdCollection.h"
19 #include "StEvent/StTriggerId.h"
22 #include "StEEmcUtil/database/EEmcDbItem.h"
23 #include "StEEmcUtil/database/StEEmcDb.h"
25 #include <StMessMgr.h>
41 StEEsoloPi0Maker::~StEEsoloPi0Maker(){
48 Int_t StEEsoloPi0Maker::InitRun(
int runNo){
51 if( !MCflag) initRun(runNo);
53 if(first)
return kStOK;
61 Int_t StEEsoloPi0Maker::Init(){
62 eeDb = (
StEEmcDb*)this->GetDataSet(
"StEEmcDb");
64 LOG_INFO <<
"has MCflag="<< MCflag<<endm;
65 return StMaker::Init();
82 static int n0=0,n1=0,n2=0,n3=0;
86 if( !MCflag&& !unpackMuTrig())
return kStOK;
90 float sum=getCtbSum(); sum=sum;
95 if(!unpackMuEemc())
return kStOK;
108 bool StEEsoloPi0Maker::unpackMuTrig(){
118 vector<unsigned int> trgId=oflTrgId.triggerIds();
123 printf(
"\n\n ==================== processing eventID %d nPrim=%d nTrig=%d==============\n", info.id(),nPrim, trgId.size());
128 for(i = 0; i < trgId.size() ; i++){
132 if(trgId[i]==10) isGood=
true;
133 if(trgId[i]==45010) isGood=
true;
134 if(trgId[i]==45020) isGood=
true;
137 if(trgId[i]==127641) isGood=
true;
142 #if 0 // TPC vertex, not used (yet)
147 if( fabs(ver.x())<0.000001 &&fabs(ver.y())<0.000001 &&fabs(ver.z())<0.000001 ) b.zTpc=999;
155 bool StEEsoloPi0Maker::unpackMuEemc(){
158 gMessMgr->Debug() <<
GetName()<<
"::unpackMuDst() is called "<<endm;
163 gMessMgr->Warning() <<
"No EMC data for this event"<<endm;
return false;
169 for (i=0; i< emc->getNEndcapTowerADC(); i++) {
172 emc->getEndcapTowerADC(i,val,sec,sub,eta);
173 assert(sec>0 && sec<=MaxSectors);
176 if(sec<eeDb->getFirstSector() || sec>eeDb->getLastSector())
continue;
178 const EEmcDbItem *x=eeDb->getTile(sec,
'A'+sub-1,eta,
'T');
181 if(x->fail )
continue;
183 int iphi=(x->sec-1)*MaxSubSec+(x->sub-
'A');
185 assert(iphi>=0 && iphi<MaxPhiBins);
186 assert(ieta>=0 && ieta<MaxEtaBins);
187 int irad=iphi*MaxEtaBins+ieta;
188 assert(irad>=0 && irad<EEsoloPi0::MxTw);
193 if(rawAdc<x->thr)
continue;
194 float adc=rawAdc-x->ped;
195 if(x->gain) ene=adc/x->gain;
199 int ii=(x->sec-1)*60+(x->sub-
'A')*12+x->eta-1;
210 float recoEner=ene/scaleFactor;
212 soloMip[irad].e= recoEner;
216 gMessMgr->Debug() <<
GetName()<<
"::unpackMuDst(), found total" <<n1<<
" towers with ADC>thr"<<endm;
223 float StEEsoloPi0Maker::getCtbSum(){
234 for (UInt_t slat = 0; slat < ctbDet->numberOfSlats(); slat++) {
235 for (UInt_t tray = 0; tray < ctbDet->numberOfTrays(); tray++) {
236 float adc = ctbDet->mips(tray,slat,0);
Axample to access muDst and pass it to ezTree analyzis class.
static TObjArray * primaryTracks()
returns pointer to a list of tracks belonging to the selected primary vertex
static StMuEmcCollection * muEmcCollection()
returns pointer to current StMuEmcCollection
static StMuEvent * event()
returns pointer to current StMuEvent (class holding the event wise information, e.g. event number, run number)
virtual const char * GetName() const
special overload
Collection of trigger ids as stored in MuDst.