10 #include <TPolyLine.h>
14 #include "StFgtClustEvalMaker.h"
15 #include "StFgtSlowSimuMaker.h"
16 #include "StFgtClustFindMaker.h"
24 memset(hA,0,
sizeof(hA));
37 StFgtClustEvalMaker::~StFgtClustEvalMaker(){
44 StFgtClustEvalMaker::saveHisto(TString fname){
45 TString outName=fname+
".hist.root";
46 TFile f( outName,
"recreate");
48 printf(
"%d histos are written to '%s' ...\n",HList->GetEntries(),outName.Data());
61 LOG_INFO<<
"::Finish() \n"<< endm;
74 LOG_INFO <<
"::Make() inpEve="<< mInpEve<<endm;
80 printf(
" INPUT: \n disk #g2t_tracks #Rad_clust #Phi_clust \n");
84 for(
int iDisk=0;iDisk<kFgtMxDisk;iDisk++) {
86 for(
int iQuad=0; iQuad<kFgtMxQuad;iQuad++) nG+=ssMk->
mG2tHitList[iDisk][iQuad].size();
88 int nrR= cfMk->mRadClustList[iDisk].size();
89 int nrP= cfMk->mPhiClustList[iDisk].size();
91 int nmR=matchRadClust1D( ssMk->
mG2tHitList[iDisk],cfMk->mRadClustList[iDisk]);
92 int nmP=matchPhiClust1D( ssMk->
mG2tHitList[iDisk],cfMk->mPhiClustList[iDisk]);
95 hA[0]->Fill(10*iDisk+0,nG);
96 hA[0]->Fill(10*iDisk+1,nrR);
97 hA[0]->Fill(10*iDisk+2,nrP);
98 hA[0]->Fill(10*iDisk+3,nmR);
99 hA[0]->Fill(10*iDisk+4,nmP);
100 if(nrR>nG) printf(
"#OV Rad %d %d\n",nrR,nG);
101 if(nrR>nmR) printf(
"#MI Rad %d %d\n",nrR,nmR);
102 if(nrP>nG) printf(
"#OV Phi %d %d\n",nrP,nG);
103 if(nrP>nmP) printf(
"#MI Phi %d %d\n",nrP,nmP);
113 StFgtClustEvalMaker::matchRadClust1D( vector<fgt_g2t_auxil> *g2tTrL, vector<fgt_cluster1D> &clL){
120 for(
int iQuad=0; iQuad<kFgtMxQuad;iQuad++)
121 for(UInt_t ih=0;ih<g2tTrL[iQuad].size();ih++) {
122 double gR=g2tTrL[iQuad][ih].Rlab.Perp();
123 double minDelR=par_minDelRad;
125 for(UInt_t ic=0;ic<clL.size();ic++) {
126 if(clL[ic].matched)
continue;
127 double delR=clL[ic].position - gR;
128 if(TMath::Abs(minDelR)<TMath::Abs(delR))
continue;
133 hA[5]->Fill(minDelR*1e4);
134 hA[7]->Fill(gR,minDelR*1e4);
135 hA[9]->Fill(g2tTrL[iQuad][ih].Rlab.x(),g2tTrL[iQuad][ih].Rlab.y());
138 clL[jc].matched=
true;
149 StFgtClustEvalMaker::matchPhiClust1D( vector<fgt_g2t_auxil> *g2tTrL, vector<fgt_cluster1D> &clL){
150 const double pi=2.*acos(0.), dpi=2.*pi;
157 for(
int iQuad=0; iQuad<kFgtMxQuad;iQuad++)
158 for(UInt_t ih=0;ih<g2tTrL[iQuad].size();ih++) {
159 double gR=g2tTrL[iQuad][ih].Rlab.Perp();
160 double gPhi=g2tTrL[iQuad][ih].Rlab.Phi();
161 while (gPhi<-pi) gPhi+=dpi;
162 while (gPhi>pi) gPhi-=dpi;
164 double minRdPhi=par_minRdPhi;
166 for(UInt_t ic=0;ic<clL.size();ic++) {
167 if(clL[ic].matched)
continue;
168 double rPhi=clL[ic].position;
169 while (rPhi<-pi) rPhi+=dpi;
170 while (rPhi>pi) rPhi-=dpi;
171 double delPhi=gPhi-rPhi;
172 if(delPhi>pi) delPhi-=dpi;
173 if(delPhi<-pi) delPhi+=dpi;
174 double RdelPhi=gR*delPhi;
177 if(TMath::Abs(minRdPhi)<TMath::Abs(RdelPhi))
continue;
182 hA[6]->Fill(minRdPhi*1e4);
183 hA[8]->Fill(gR,minRdPhi*1e4);
184 hA[10]->Fill(g2tTrL[iQuad][ih].Rlab.x(),g2tTrL[iQuad][ih].Rlab.y());
187 clL[jc].matched=
true;
198 StFgtClustEvalMaker::Init(){
203 hA[0]=
new TH1F(
"ev_Stat1D",
"Eval clust matching; x=10*disk",100, -0.5,99.5);
205 double Yrange=2*geom->radStrip_pitch()*1e4;
207 hA[5]=
new TH1F(
"ev_errRad",
"error in reco R (track-recoClust); R_err (um)",100,-par_minDelRad*1e4,par_minDelRad*1e4);
208 hA[6]=
new TH1F(
"ev_RerrPhi",
"error in reco phi*R (track-recoClust); R*#Phi_err (um)",100,-par_minRdPhi*1e4,par_minRdPhi*1e4);
212 hA[7]=
new TH2F(
"ev_dRad_R",
"#DeltaR accuracy of reco cluster ;thrown R (cm); #DeltaR (um)",45,0.,45.,50,-Yrange,Yrange);
213 hA[8]=
new TH2F(
"ev_RdPhi_R",
"R*#Delta#Phi accuracy of reco cluster ;thrown R (cm);R*#Delta#Phi (um)",45,0.,45.,200,-Yrange,Yrange);
217 sprintf(text,
"gen clust X-Y , R-matched (#DeltaR<%.3fmm);Lab X (cm); Lab Y (cm); ",par_minDelRad*10);
218 hA[9]=
new TH2F(
"ev_RokXY",text,90,-45.,45.,90,-45.,45.);
220 sprintf(text,
"gen clust X-Y , #Phi-matched (R#Delta#Phi<%.3fmm);Lab X (cm); Lab Y (cm); ",par_minRdPhi*10);
221 hA[10]=
new TH2F(
"ev_PhiokXY",text,90,-45.,45.,90,-45.,45.);
225 TList *Lx; TLine *ln; TPolyLine *pln;
228 double x[100],y[100];
230 Lx=hA[7]->GetListOfFunctions();
231 double y1=par_minDelRad*1e4;
232 ln=
new TLine(0,y1,45,y1); ln->SetLineColor(kGreen);Lx->Add(ln);
233 ln=
new TLine(0,-y1,45,-y1); ln->SetLineColor(kGreen);Lx->Add(ln);
234 x[0]=x[9]=geom->Rin(); y[0]=y[9]=0;
235 x[1]=x[8]=x[0]; y[1]=geom->radStrip_pitch()*1e4/2; y[8]=-y[1];
236 x[2]=x[7]=geom->Rmid(); y[2]=y[1]; y[7]=-y[2];
237 x[3]=x[6]=x[2]; y[3]=geom->radStrip_pitch()*1e4/2; y[6]=-y[3];
238 x[4]=x[5]=geom->Rout(); y[4]=y[3]; y[5]=-y[4];
239 pln=
new TPolyLine(10,x,y);
240 pln->SetLineColor(kRed); Lx->Add(pln);
243 Lx=hA[8]->GetListOfFunctions();
245 ln=
new TLine(0,y1,45,y1); ln->SetLineColor(kGreen);Lx->Add(ln);
246 ln=
new TLine(0,-y1,45,-y1); ln->SetLineColor(kGreen);Lx->Add(ln);
247 double hl=geom->phiStrip_pitch()*1e4/2 * geom->Rin();
249 double hm=hh*geom->Rmid()/geom->Rmid();
250 x[0]=x[12]=x[11]=geom->Rin(); y[0]=y[12]=hl; y[11]=-y[0];
251 x[1]=x[10]=geom->Rmid(); y[1]=hh; y[10]=-y[1];
252 x[2]=x[9]=x[1]; y[2]=hm; y[9]=-y[2];
253 x[3]=x[8]=geom->Rmid(); y[3]=hh; y[8]=-y[3];
254 x[4]=x[7]=x[3]; y[4]=hl; y[7]=-y[4];
255 x[5]=x[6]=geom->Rout(); y[5]=hh; y[6]=-y[5];
256 pln=
new TPolyLine(13,x,y); pln->SetLineColor(kRed);Lx->Add(pln);
259 for(
int i=0;i<mxH;i++)
260 if(hA[i]) HList->Add(hA[i]);
262 LOG_INFO<<Form(
"::Init params match limit (cm) delR=%.3f R*delPhi=%.3f", par_minDelRad,par_minRdPhi)<< endm;
265 return StMaker::Init();
vector< fgt_g2t_auxil > mG2tHitList[kFgtMxDisk+1][kFgtMxQuad]
accepted track segements
virtual void Clear(Option_t *option="")
User defined functions.
virtual void Clear(Option_t *option="")
User defined functions.