5 #include "StMuEEDemoMaker.h"
8 #include "St_DataSetIter.h"
10 #include "StMuDSTMaker/COMMON/StMuDstMaker.h"
11 #include "StMuDSTMaker/COMMON/StMuDst.h"
12 #include "StMuDSTMaker/COMMON/StMuEmcCollection.h"
14 #include "StEEmcUtil/EEmcGeom/EEmcGeomSimple.h"
15 #include "StEEmcUtil/StEEmcSmd/StEEmcSmdGeom.h"
18 #include "StEEmcUtil/database/StEEmcDb.h"
19 #include "StEEmcUtil/database/EEmcDbItem.h"
20 #include "StEEmcUtil/EEfeeRaw/EEname2Index.h"
28 geomSmd = StEEmcSmdGeom::instance();
33 StMuEEDemoMaker::~StMuEEDemoMaker(){
42 eeDb = (
StEEmcDb*)this->GetDataSet(
"StEEmcDb");
44 printf(
"eemcDB must be in the chain, fix it or drop %s-maker, JB\n",
GetName());
50 return StMaker::Init();
61 printf(
"%s::Make() is called .................................\n",
GetName());
63 if(eeDb->valid()<=0) {
64 printf(
"%s aborted, due to no eemcDb records\n",
GetName());
70 printf(
" No EMC data for this event\n");
74 int isec,ieta,isub,istrip,adc,ipre;
79 printf(
"\nTotal %d hits in Tower\n",emc->getNEndcapTowerADC());
81 for (i=0; i< emc->getNEndcapTowerADC(); i++) {
82 emc->getEndcapTowerADC(i,adc,isec,isub,ieta);
87 float phiCenter =geomTw->
getPhiMean(isec,isub);
88 TVector3 r= geomTw-> getTowerCenter(isec, isub,ieta);
90 printf(
"\nTower %2.2dT%c%2.2d phi/deg=%6.1f eta=%5.2f x=%4.1f y=%4.1f z=%5.1f: adc=%4d\n ",isec+1,isub+
'A',ieta+1,phiCenter/3.14*180,etaCenter,r.x(),r.y(),r.z(),adc );
98 TVector3 r1=geomTw-> getDirection( etaCenter, phiCenter);
102 const EEmcDbItem *dbItem=eeDb->getT(isec+1,isub+
'A',ieta+1);
106 printf(
"Total %d towers with ADC>0\n",nh);
109 nh= emc->getNEndcapPrsHits();
110 printf(
"\nTotal %d hits in pre1+2+post\n",nh);
111 for (i=0; i<nh; i++) {
112 hit=emc->getEndcapPrsHit(i,isec,isub,ieta,ipre);
113 printf(
"\n\npre/post(%d) %2.2d%c%c%2.2d : energy=%f adc=%d\n",ipre+1,isec+1,ipre+
'P',isub+
'A',ieta+1,hit->
getEnergy(),hit->
getAdc());
116 sprintf(name,
"%2.2d%c%c%2.2d",isec+1,ipre+
'P',isub+
'A',ieta+1);
117 printf(
" DB: name='%s'",name);
118 int index=EEname2Index(name);
119 printf(
", index=%d, ", index);
129 for(uv=
'U'; uv<=
'V'; uv++) {
130 nh= emc->getNEndcapSmdHits(uv);
131 printf(
"\nTotal %d hits in SMD-%c\n",nh,uv);
132 for (i=0; i<nh; i++) {
133 hit=emc->getEndcapSmdHit(uv,i,isec,istrip);
134 printf(
"\nSMD-%c %2.2d%c%3.3d : energy=%f adc=%d\n",uv,isec+1,uv,istrip+1,hit->
getEnergy(),hit->
getAdc());
147 printf(
" x1=%6.2f y1=%6.2f z1=%6.2f x2=%6.2f y2=%6.2f z2=%6.2f\n",
148 end1.x(),end1.y(),end1.z(),end2.x(),end2.y(),end2.z());
155 const EEmcDbItem *dbItem=eeDb-> getByStrip0(isec,iuv,istrip);
163 for (
int n=eemc ; n<=esmdv; n++) {
164 int nClusters = emc->getNClusters(n);
165 printf(
"EEMC depth=%d nClust=%d\n",n,nClusters);
166 for (
int i=0; i<nClusters; i++) {
168 printf(
"Cluster(%02i,%02i): energy=%f phi=%f eta=%f nHits=%d\n"
174 int nPoints = emc->getNEndcapPoints();
175 printf(
"Points: %d\n",nPoints);
176 for (
int n=0; n<nPoints; n++) {
virtual base class for Maker
float getEnergy() const
Return Hit energy.
float getEnergy() const
Return Energy of the point.
const EEmcDbItem * getByIndex(int ikey) const
returns full DB info for one pixel
Float_t getEtaHalfWidth(UInt_t eta) const
virtual Int_t Make()
Make - this method is called in loop for each event.
int getNHits() const
Return Number of hits of the cluster.
Float_t getPhiMean(UInt_t sec) const
int getAdc() const
Return ADC value.
virtual Int_t Init()
Init - is a first method the top level StChain calls to initialize all its makers.
float getPhi() const
Return Phi of the cluster.
static StMuEmcCollection * muEmcCollection()
returns pointer to current StMuEmcCollection
Float_t getPhiHalfWidth(UInt_t sec=0, UInt_t ssec=0) const
virtual const char * GetName() const
special overload
float getPhi() const
Return Phi of the point.
StructEEmcStrip * getStripPtr(const Int_t iStrip, const Int_t iUV, const Int_t iSec)
return a strip pointer from indices
float getEta() const
Return Eta of the cluster.
float getEta() const
Return Eta of the point.
Float_t getEtaMean(UInt_t eta) const