2 #include "StRoot/StEvent/StFgtCollection.h"
3 #include "StRoot/StEvent/StFgtHitCollection.h"
4 #include "StRoot/StEvent/StFgtPointCollection.h"
5 #include "StFgtPointPlotter.h"
7 #include "StRoot/StEvent/StFgtHit.h"
8 #include "StRoot/StEvent/StFgtPoint.h"
9 #include "StRoot/StFgtUtil/geometry/StFgtGeom.h"
10 #include "StRoot/StEvent/StEvent.h"
11 #include "StRoot/StEvent/StEventInfo.h"
12 #include "StRoot/StFgtUtil/geometry/StFgtGeom.h"
14 #include "StMuDSTMaker/COMMON/StMuDstMaker.h"
15 #include "StMuDSTMaker/COMMON/StMuPrimaryVertex.h"
16 #include "StMuDSTMaker/COMMON/StMuDst.h"
17 #include "StMuDSTMaker/COMMON/StMuEvent.h"
18 #include "StarClassLibrary/StThreeVectorF.hh"
31 Int_t StFgtPointPlotter::Init()
33 outRootFile=
new TFile(
"pointPlots.root",
"RECREATE");
35 histos=
new TH2D*[6*4];
36 tbHistos=
new TH1D*[6*4];
37 tbCorrelation=
new TH2D(
"tbCorrelation",
"tbCorrelation",15,0,15,15,0,15);
43 for(
int iq=0;iq<4;iq++)
45 sprintf(buffer,
"disk_%d_quad_%d",i,iq);
46 cout <<
"init histo: " << i*4+iq <<
", " << buffer <<endl;
47 histos[i*4+iq]=
new TH2D(buffer,buffer,100,-40,40,100,-40,40);
48 sprintf(buffer,
"MaxTimeBin_disk_%d_quad_%d",i,iq);
49 tbHistos[i*4+iq]=
new TH1D(buffer,buffer,15,0,14);
61 eventPtr = (
StEvent*)GetInputDS(
"StEvent");
64 LOG_ERROR <<
"Error getting pointer to StEvent from '" << ClassName() <<
"'" << endm;
71 fgtCollectionPtr=eventPtr->fgtCollection();
74 if( !fgtCollectionPtr) {
75 LOG_ERROR <<
"Error getting pointer to StFgtCollection from '" << ClassName() <<
"'" << endm;
80 if( !pointCollectionPtr ){
81 LOG_ERROR <<
"Error getting pointer to StFgtPointCollection from StFgtCollection" << endm;
84 Int_t numPoints=pointCollectionPtr->getNumPoints();
86 cout <<
"point plotter: we have " << numPoints <<
" points " <<endl;
87 const StSPtrVecFgtPoint& pointVec=pointCollectionPtr->getPointVec();
88 StSPtrVecFgtPointConstIterator iter1;
89 for(iter1 = pointVec.begin();iter1!=pointVec.end();++iter1)
91 Float_t R=(*iter1)->getPositionR();
92 Float_t Phi=(*iter1)->getPositionPhi();
94 Int_t disk=(*iter1)->getDisc();
95 Int_t quad=(*iter1)->getQuad();
100 Int_t tbR=(*iter1)->getHitR()->getMaxTimeBin();
101 Int_t tbPhi=(*iter1)->getHitPhi()->getMaxTimeBin();
103 cout <<
"disk: " << disk <<
" quad: " << quad <<
", point at (" <<x <<
", " << y <<
") "<<endl;
104 histos[disk*4+quad]->Fill(x,y);
105 tbHistos[disk*4+quad]->Fill(tbR);
106 tbHistos[disk*4+quad]->Fill(tbPhi);
108 tbCorrelation->Fill(tbR,tbPhi);
118 for(
int iq=0;iq<4;iq++)
120 histos[i*4+iq]->Write();
121 tbHistos[i*4+iq]->Write();
124 tbCorrelation->Write();
125 outRootFile->Write();
129 StFgtPointPlotter::~StFgtPointPlotter()
134 StFgtPointPlotter::StFgtPointPlotter(
const Char_t* name):
StMaker( name )