1 #include "StFcsEcalHcalMipMaker.h"
2 #include "TDataSetIter.h"
3 #include "StDAQMaker/StDAQReader.h"
5 #include "StRoot/StEvent/StEvent.h"
6 #include "StRoot/St_base/StMessMgr.h"
7 #include "StRoot/StEvent/StTriggerData.h"
8 #include "StRoot/StEvent/StFcsCollection.h"
9 #include "StRoot/StEvent/StFcsHit.h"
10 #include "StRoot/StEvent/StFcsCluster.h"
11 #include "StRoot/StFcsDbMaker/StFcsDb.h"
12 #include "StRoot/StSpinPool/StFcsRawDaqReader/StFcsRawDaqReader.h"
41 mFcsDb =
static_cast<StFcsDb*
>(GetDataSet(
"fcsDb"));
43 sprintf(mFilename,
"%8d.mip.root",mRun);
44 LOG_INFO <<
"StFcsEcalHcalMipMaker::Init - Opening "<<mFilename<<endm;
45 mFile=
new TFile(mFilename,
"RECREATE");
47 const char* nameEH[2] = {
"Ecal",
"Hcal"};
48 const char* nameNS[kFcsNorthSouth] = {
"N",
"S"};
51 for(
int eh=0; eh<2; eh++){
52 mNClu[eh] =
new TH1F(Form(
"NCluster_%s",nameEH[eh]),
53 Form(
"NCluster_%s",nameEH[eh]),
55 mNTowClu[eh] =
new TH1F(Form(
"NTowerCluster_%s",nameEH[eh]),
56 Form(
"NTowerCluster_%s",nameEH[eh]),
58 mNNeiClu[eh] =
new TH1F(Form(
"NNeiCluster_%s",nameEH[eh]),
59 Form(
"NNeiCluster_%s",nameEH[eh]),
64 for(
int det=0; det<4; det++){
67 int maxid = mFcsDb->
maxId(det);
68 mAdc[det] =
new TH2F(Form(
"ADC_%s%s",nameEH[eh],nameNS[ns]),
69 Form(
"ADC %s%s",nameEH[eh],nameNS[ns]),
70 maxid,0,maxid,nbin,0,max);
71 mAdcSingleTower[det] =
new TH2F(Form(
"ADCSingle_%s%s",nameEH[eh],nameNS[ns]),
72 Form(
"ADCSingle %s%s",nameEH[eh],nameNS[ns]),
73 maxid,0,maxid,nbin,0,max);
74 mAdcEcalMatch[det] =
new TH2F(Form(
"ADCEcal_%s%s",nameEH[eh],nameNS[ns]),
75 Form(
"ADCEcalCoin %s%s",nameEH[eh],nameNS[ns]),
76 maxid,0,maxid,nbin,0,max);
78 mX =
new TH2F(
"X",
"X; XEcal; XHcal",100,-100,100,100,-100,100);
79 mY =
new TH2F(
"Y",
"Y; YEcal; YHcal",100, 0,200,100, 0,200);
80 mDXX=
new TH2F(
"DXX",
"DX; XHcal; DX",100,-100,100,100,-30,30);
81 mDXY=
new TH2F(
"DXY",
"DX; YHcal; DX",100, 0,200,100,-30,30);
82 mDYX=
new TH2F(
"DYX",
"DY; XHcal; DY",100,-100,100,100,-30,30);
83 mDYY=
new TH2F(
"DYY",
"DY; YHcal; DY",100, 0,200,100,-30,30);
84 mDR=
new TH2F(
"DR",
"DR; RHcal; DR",100,0,100,100,0,30);
94 LOG_INFO <<
"No StEvent found" << endm;
96 mFcsCollection=
event->fcsCollection();
99 LOG_INFO <<
"No StFcsCollection found" << endm;
103 const int maxTower=1;
104 const float ecalELow=0.15;
105 const float ecalEHigh=0.50;
106 const float dRCut=15.0;
108 for(
int ns=0; ns<2; ns++){
109 StSPtrVecFcsCluster& ecal= mFcsCollection->clusters(ns);
110 StSPtrVecFcsCluster& hcal= mFcsCollection->clusters(ns+2);
111 int nEcal=mFcsCollection->numberOfClusters(ns);
112 int nHcal=mFcsCollection->numberOfClusters(ns+2);
113 mNClu[0]->Fill(nEcal);
114 mNClu[1]->Fill(nHcal);
117 for(
int i=0; i<nEcal;i++){
119 int id=clu->hits()[0]->id();
120 int ntow=clu->nTowers();
121 int nnei=clu->nNeighbor();
122 mNTowClu[0]->Fill(ntow);
123 mNNeiClu[0]->Fill(nnei);
124 mAdc[ns]->Fill(
id,clu->energy());
125 if(ntow<=maxTower && nnei==0){
126 mAdcSingleTower[ns]->Fill(
id,clu->energy());
131 for(
int i=0; i<nHcal;i++){
133 int id=clu->hits()[0]->id();
134 int ntow=clu->nTowers();
135 int nnei=clu->nNeighbor();
136 mNTowClu[1]->Fill(ntow);
137 mNNeiClu[1]->Fill(nnei);
138 mAdc[ns+2]->Fill(
id,clu->energy());
139 if(ntow<=2 && nnei==0){
140 mAdcSingleTower[ns+2]->Fill(
id,clu->energy());
141 for(
int i=0; i<nEcal;i++){
143 int entow=eclu->nTowers();
144 int ennei=eclu->nNeighbor();
145 if(entow<=maxTower && ennei==0 && eclu->energy()>ecalELow && eclu->energy()<ecalEHigh){
148 double ex = eclu->x() * mFcsDb->
getXWidth(ns) * (ns*2-1);
149 double ey = eclu->y() * mFcsDb->
getYWidth(ns);
152 double pr=sqrt(px*px+py*py);
153 double dr=sqrt(dx*dx+dy*dy);
166 mAdcEcalMatch[ns+2]->Fill(
id,clu->energy());
179 printf(
"StFcsEcalHcalMipMaker::Finish - Closing %s\n",mFilename);
virtual Int_t Init()
Init - the top level StChain calls to initialize all its makers.
virtual Int_t Make()
Make - this method is called in loop for each event.
int northSouth(int det) const
Ecal=0, Hcal=1, Pres=2.
double getHcalProjectedToEcalX(int ns, double hcalLocalX, double zvtx=0.0)
Project Hcal local X to Ecal local X [cm].
StFcsEcalHcalMipMaker(const char *name="FcsEcalHcalMip")
constructor
float getXWidth(int det) const
get the angle of the detector
int ecalHcalPres(int det) const
Ecal North=0, Ecal South=1, Hcal North=2, Hcal South=3, Pres=4/5.
int maxId(int det) const
number of column
virtual ~StFcsEcalHcalMipMaker()
destructor
float getYWidth(int det) const
get the X width of the cell
double getHcalProjectedToEcalY(int ns, double hcalLocalY, double zvtx=0.0)
Project Hcal local Y to Ecal local Y [cm].