217 fParticleEvtInfoCat = 0;
218 fParameterFile =
"centrality.root";
220 isSimulation = kFALSE;
221 fReferenceMeanSelTrack= 36.44;
223 fEventPlaneCorrectionFlag = kNoCorrection;
224 fQVectorCalcDone = kFALSE;
227 useFWCut.resize(kNumFWCutValues);
231 excludeNoisyFWcells = kTRUE;
233 fRandom =
new TRandom2();
237 fCentralityPercentileHist.resize(kNumCentralityEstimator);
238 fCentralityHist.resize(kNumCentralityEstimator);
239 fEstimatorHist.resize(kNumCentralityEstimator);
240 for (
int centEst = 0; centEst < (int)kNumCentralityEstimator; ++centEst) fCentralityHist[centEst].resize(kNumCentralityClass);
241 fEventPlaneCorrectionHist.resize(kNumEventPlaneParameter);
242 fFWCutValuesHist.resize(kNumFWCutValues);
243 for (
int cutValue = 0; cutValue < (int)kNumFWCutValues; ++cutValue) fFWCutValuesHist[cutValue].resize(
MAXFWCELLS);
246 fFWminBeta.resize(3);
247 fFWmaxBeta.resize(3);
248 fFWminCharge.resize(3);
249 fFWminBeta[0]=0.84; fFWmaxBeta[0]=1.2; fFWminCharge[0]=80;
250 fFWminBeta[1]=0.85; fFWmaxBeta[1]=1.2; fFWminCharge[1]=84;
251 fFWminBeta[2]=0.8; fFWmaxBeta[2]=1.2; fFWminCharge[2]=88;
253 fFWChargeCuts.resize(6);
254 fFWChargeCuts[5]=386;
255 fFWChargeCuts[4]=339;
256 fFWChargeCuts[3]=298;
257 fFWChargeCuts[2]=241;
258 fFWChargeCuts[1]=175;
259 fFWChargeCuts[0]=84 ;
273 if(catKin) {
isSimulation=kTRUE; Info(
"init()",
"GeantKine found - is Simulation");}
274 else {
isSimulation=kFALSE;Info(
"init()",
"GeantKine not found - is not Simulation");}
278 if(!
fParticleEvtInfoCat) { Info(
"init()",
"No catParticleEvtInfo in input!");
return kFALSE;}
284 if(!
fCatWallHit) { Info(
"init()",
"No catWallHit in input!");}
287 Error(
"init()",
"NO EventStructure found!");
292 Error(
"init()",
"NO HADES found!");
299 Error(
"init()",
"NO Parameterfile found!");
315 TString tempFileName =
"";
327 if(tempFileName==
""){
347 if (gSystem->AccessPathName(path)) {
348 Error(
"init()",
"File %s does not exist!",path.Data());
358 if (gSystem->AccessPathName(path)) {
359 Error(
"loadParameterFile()",
"File %s does not exist!",path.Data());
362 fFile =
new TFile(path,
"OPEN");
363 TObject* ParameterFileVersion = (TObject*)
fFile->Get(
"HParticleEvtCharaVersion");
364 if(ParameterFileVersion){
365 TString Version(ParameterFileVersion->GetTitle());
366 Float_t fVersion = Version.Atof();
368 Error(
"loadParameterFile()",
"File %s is out-dated! Needed Version: %02.1f -- in file: %02.1f",path.Data(),
getVersion(), fVersion);
371 cout<<
"\n--------------------------------------------------------------------------------------" << endl;
372 Info(
"loadParameterFile()",
">>> Parameter input file (ver. %02.1f) : %s",fVersion,path.Data());
374 cout<<
"\n--------------------------------------------------------------------------------------" << endl;
377 Error(
"loadParameterFile()",
"In File %s no Version information found!",path.Data());
395 fFile =
new TFile(path,
"CREATE");
396 if(!
fFile)
return kFALSE;
397 cout <<
"Version of HParticleEvtChara: " <<
getVersion() << endl;
399 TNamed OutputVersion(
"HParticleEvtCharaVersion",version.Data());
400 OutputVersion.Write();
410 cout<<
"\n--------------------------------------------------------------------------------------" << endl;
411 Info(
"loadCentralityEstimatorHist()",
"Calibration for Centrality Estimator and Classes loading:");
419 if(fCentralityPercentileHist[centEst]){
420 printf(
"percentile");
429 if(fCentralityHist[centEst][centC]){
435 cout<<
"\n\nCentrality Percentile Curves #"<< m << endl;
436 cout<<
"Centrality Estimator and Classes #"<< n << endl;
437 cout<<
"--------------------------------------------------------------------------------------" << endl;
444 if(!
fFile)
return kFALSE;
445 fFile->mkdir(
"EstimatorHist");
446 fFile->cd(
"/EstimatorHist/");
448 cout<<
"\n--------------------------------------------------------------------------------------" << endl;
449 Info(
"saveCentralityEstimatorHist()",
"Estimator Hist saving:");
457 cout<<
"\n\nEstimator Hist #"<< m <<
"saved" << endl;
458 cout<<
"--------------------------------------------------------------------------------------" << endl;
460 fFile->mkdir(
"Centrality");
461 fFile->cd(
"/Centrality/");
463 cout<<
"\n--------------------------------------------------------------------------------------" << endl;
464 Info(
"saveCentralityEstimatorHist()",
"Calibration for Centrality Estimator and Classes saving:");
471 printf(
"percentile");
483 cout<<
"\n\nCentrality Percentile Curves #"<< m <<
"saved" << endl;
484 cout<<
"Centrality Estimator and Classes #"<< n <<
"saved" << endl;
485 cout<<
"--------------------------------------------------------------------------------------" << endl;
493 cout<<
"\n--------------------------------------------------------------------------------------" << endl;
494 Info(
"loadEventPlaneCorrectionHist()",
"Calibration for EventPlane Correction Histogramms loading:");
513 cout<<
"\n\nEventPlane Correction Histogramms #"<< n << endl;
514 cout<<
"--------------------------------------------------------------------------------------" << endl;
521 if(!hist)
return kFALSE;
523 if(epParam==
kChi)
return kTRUE;
527 hist->SetNameTitle(temp.Data(),temp.Data());
533 hist->SetNameTitle(temp.Data(),temp.Data());
544 if(!
fFile)
return kFALSE;
545 fFile->mkdir(
"EPcorr");
546 fFile->cd(
"/EPcorr/");
548 cout<<
"\n--------------------------------------------------------------------------------------" << endl;
549 Info(
"saveEventPlaneCorrectionHist()",
"Calibration for EventPlane Correction Histogramms saving:");
565 cout<<
"\n\nEventPlane Correction Histogramms #"<< n <<
"saved" << endl;
566 cout<<
"--------------------------------------------------------------------------------------" << endl;
573 cout<<
"\n--------------------------------------------------------------------------------------" << endl;
574 Info(
"loadFWCutValuesHist()",
"Histogramms with CutValues for FW Hits loading:");
579 for (
int iCell = 0; iCell <
MAXFWCELLS ; ++iCell){
592 printf(
"active cells:%2d ", m);
595 printf(
" not used for FWCut!");
599 cout<<
"\n\nHistogramms with CutValues for FW Hits #"<< n << endl;
600 cout<<
"--------------------------------------------------------------------------------------" << endl;
607 if(!hist)
return kFALSE;
609 if(cell<0 || cell >=
MAXFWCELLS)
return kFALSE;
612 hist->SetNameTitle(temp.Data(),temp.Data());
619 if(!
fFile)
return kFALSE;
620 fFile->mkdir(
"FWCutValue");
621 fFile->cd(
"/FWCutValue/");
623 cout<<
"\n--------------------------------------------------------------------------------------" << endl;
624 Info(
"saveFWCutValuesHist()",
"Histogramms with CutValues for FW Hits saving:");
629 for (
int iCell = 0; iCell < (int)
MAXFWCELLS; ++iCell){
643 printf(
"active cells:%2d ", m);
647 cout<<
"\n\ntotal Histogramms with CutValues for FW Hits #"<< n <<
"saved" << endl;
648 cout<<
"--------------------------------------------------------------------------------------" << endl;
701 if ( i < 0 || i > 301 )
return -1;
702 else if ( i==65 || i==66 || i==77 || i==78 )
return -1;
703 else if ( i<144 )
return 1;
704 else if ( i<208 )
return 2;
705 else if ( i<302 )
return 3;
719 if(!wall)
return kFALSE;
721 if(cell<0 || cell>=
MAXFWCELLS)
return kFALSE;
724 if(cell ==20 || cell ==53 || cell ==54
725 || cell ==64 || cell ==67 || cell ==79)
return kFALSE;
768 Float_t fCorrection = 0.;
777 Float_t fCorrectionError = 1.;
781 return fCorrectionError;
785 if(size==1)
return (
fRandom->Rndm(1) - 0.5 )*40.;
786 else if(size==2)
return (
fRandom->Rndm(1) - 0.5 )*80.;
787 else if(size==3)
return (
fRandom->Rndm(1) - 0.5 )*160.;
793 if(theta>max)
return 0.;
794 if(theta<min)
return 1.;
795 Float_t wtheta = 1. -( (theta-min)/(max-min) );
796 if(wtheta>0 && wtheta < 1.)
return wtheta;
807 for (Int_t i=0; i<nHits; i++){
818 Float_t wallXOrg=0,wallYOrg=0,wallZOrg=0;
819 Float_t wallX=0,wallY=0;
820 Float_t weight1 = 1.;
821 Float_t weight2 = 1.;
822 for(Int_t i = 0; i <
fCatWallHit->getEntries(); i ++ ){
827 wall->
getXYZLab(wallXOrg,wallYOrg,wallZOrg);
834 if(wallX==0 || wallY==0)
continue;
836 HitVector->
Set(wallX,wallY,weight1, weight2);
837 HitVector->
SetOrg(wallXOrg,wallYOrg);
846 for (Int_t i=0; i<nHits; i++){
848 if((i+1)*2 > nHits)
arrayOfHits[i]->SetSubEvent(1);
862 printf(
"printHitArray #Hits = %d\n", nHits );
864 for (Int_t i=0; i<nHits; i++){
888 Double_t dQX = 0.,dQY = 0.;
889 Double_t dQXA = 0.,dQYA = 0.;
890 Double_t dQXB = 0.,dQYB = 0.;
892 Double_t dQXShift = 0.,dQYShift = 0.;
893 Double_t dQXScale = 1.,dQYScale = 1.;
898 Double_t sumOfWeights=0;
901 if(nHits<4)
return kFALSE;
902 for (Int_t i=0; i<nHits; i++){
910 dQX += w * TMath::Cos(nHarmonic*phi);
911 dQY += w * TMath::Sin(nHarmonic*phi);
914 dQXA += w * TMath::Cos(nHarmonic*phi);
915 dQYA += w * TMath::Sin(nHarmonic*phi);
918 dQXB += w * TMath::Cos(nHarmonic*phi);
919 dQYB += w * TMath::Sin(nHarmonic*phi);
959 if(dQX==0 && dQX==0)
return kFALSE;
960 if(dQXA==0 && dQXA==0)
return kFALSE;
961 if(dQXB==0 && dQXB==0)
return kFALSE;
965 vQPhi[0] = TVector2::Phi_0_2pi(
getPhi(dQX ,dQY ) + corrPsi );
966 vQPhi[1] = TVector2::Phi_0_2pi(
getPhi(dQXA,dQYA) + corrPsi );
967 vQPhi[2] = TVector2::Phi_0_2pi(
getPhi(dQXB,dQYB) + corrPsi );
986 printf(
"QVector Calculation NOT Done !!!!!!! retry now\n");
990 printf(
"##### vQPhi: %.3f \t vQPhiA: %.3f \t vQPhiB: %.3f \t\t Corr: %s #####\n",
1005 Float_t corrPsi =
phi;
1036 if(SubEvent<3)
return vQPhi[SubEvent];
1042 if(SubEvent<3)
return vQPhi[SubEvent];
1077 if(
vQPhi[0]==-1)
return -999;
1111 if (estimator.CompareTo(
"TOFRPCtimecut")==0 || estimator.CompareTo(
"TOFRPC5")==0)
1113 else if (estimator.CompareTo(
"TOFRPCtimecutFOPI")==0 || estimator.CompareTo(
"TOFRPCFOPI")==0)
1115 else if (estimator.CompareTo(
"TOFRPCtimecut10")==0 || estimator.CompareTo(
"TOFRPC10")==0)
1118 Error(
"getCentralityClass()",
"No CentralityEstimator defined!");
1127 Error(
"getCentralityClass()",
"No HParticleEvtInfo");
1149 else if(centE==
kEt)
return getEt();
1190 if (estimator.CompareTo(
"TOFRPCtimecut")==0 || estimator.CompareTo(
"TOFRPC5")==0)
1192 else if (estimator.CompareTo(
"TOFRPCtimecutFOPI")==0 || estimator.CompareTo(
"TOFRPCFOPI")==0)
1194 else if (estimator.CompareTo(
"TOFRPCtimecut10")==0 || estimator.CompareTo(
"TOFRPC10")==0)
1197 Error(
"printCentralityClass()",
"Sorry. printCentralityClass() for %s not implemented yet!",estimator.Data());
1208 cout<<
"---------------------------------------------------------------------------------------------" << endl;
1217 Error(
"printCentralityClass()",
"Sorry. printCentralityClass() for ... not implemented yet!");
1221 cout<<
"---------------------------------------------------------------------------------------------" << endl;
1222 cout<<
"# of Classes: "<< htemp->GetNbinsX()-2 << endl;
1223 printf(
" Class lowEdge - upEdge Centrality[%%] BinWidth[%%] real CentralityBin[%%] BinCenter[%%]\n");
1225 for(Int_t i = htemp->GetNbinsX(); i>0 ; --i) {
1226 printf(
" %2.f : %8.2f - %8.2f %13s %13.3f %8.2f - %8.2f %13.2f\n",
1227 htemp->GetBinContent(i),
1228 (htemp->GetXaxis())->GetBinLowEdge(i),
1229 (htemp->GetXaxis())->GetBinUpEdge(i),
1230 (htemp->GetXaxis())->GetBinLabel(i),
1231 htemp->GetBinError(i),
1233 pcent+htemp->GetBinError(i),
1234 pcent+0.5*htemp->GetBinError(i) );
1235 pcent += htemp->GetBinError(i);
1237 cout<<
"---------------------------------------------------------------------------------------------" << endl;
1246 TString sName=hist->GetName();
1247 sName.Append(
"_res");
1249 Int_t nxBins = hist->GetNbinsX();
1250 Int_t nyBins = hist->GetNbinsY();
1252 TH2D* hresolution = (TH2D*)
new TH2D(sName.Data(), sName.Data(), nxBins, hist->GetXaxis()->GetXmin(), hist->GetXaxis()->GetXmax(),
1253 nyBins, hist->GetYaxis()->GetXmin(), hist->GetYaxis()->GetXmax());
1254 (hresolution->GetXaxis())->
SetTitle(hist->GetXaxis()->GetTitle());
1255 (hresolution->GetYaxis())->
SetTitle(hist->GetYaxis()->GetTitle());
1256 (hresolution->GetZaxis())->
SetTitle(hist->GetZaxis()->GetTitle());
1258 Int_t bin,binx,biny;
1259 for (binx =0;binx<=nxBins+1;binx++) {
1260 for (biny =0;biny<=nyBins+1;biny++) {
1261 bin = biny*(nxBins+2) + binx;
1263 Double_t dQaQb = hist->GetBinContent(bin);
1264 Double_t dEntriesQaQb = hist->GetBinEntries(bin);
1265 if( dQaQb <= 0 || dEntriesQaQb < 1 ){
1266 hresolution->SetBinContent(bin, 0. );
1267 hresolution->SetBinError( bin, 0. );
1270 Double_t dSpreadQaQb = hist->GetBinError(bin);
1271 Double_t dV = TMath::Sqrt(dQaQb);
1272 printf(
"\nbin=%d binX=%d binY=%d QaQb = %f +- %f V = %f\n",bin, binx, biny, dQaQb, dSpreadQaQb , dV);
1273 Double_t dChi =
FindXi(dV,1e-6);
1275 printf(
"An estimate of the event plane resolution is: %f\n", dV );
1276 Double_t dVerr = 0.;
1277 if(dQaQb > 0.) dVerr = (1./(2.*pow(dQaQb,0.5)))*dSpreadQaQb;
1278 Double_t dChiErr =
FindXi(dVerr,1e-6);
1279 printf(
"An estimate chi of the event plane is: %f +- %f\n", dChi, dChiErr );
1280 printf(
"R:(subevents) = %f +- %f\n",dV,dVerr);
1282 hresolution->SetBinContent(binx, biny, dChi );
1283 hresolution->SetBinError( binx, biny, dChiErr);
1286 hresolution->SetBinContent(binx, biny, dV );
1287 hresolution->SetBinError( binx, biny, dVerr );
1291 TString name=hist->GetName();
1292 hresolution->SetNameTitle(name.Data(),name.Data());
1293 hresolution->SetEntries(hist->GetEntries());
1300 TString sName=hist->GetName();
1301 sName.Append(
"_res");
1303 TAxis* axis = hist->GetZaxis();
1304 axis->SetRange(1, axis->GetNbins());
1305 TH1* temp = hist->Project3D(
"xy_1");
1307 axis->SetRange(axis->FindBin(TMath::PiOver2()), axis->GetNbins());
1308 TH1* temp2 = hist->Project3D(
"xy_2");
1309 temp2->Divide(temp);
1311 Int_t nxBins = temp2->GetNbinsX();
1312 Int_t nyBins = temp2->GetNbinsY();
1314 TH2D* hresolution = (TH2D*)
new TH2D(sName.Data(), sName.Data(), nxBins, temp2->GetXaxis()->GetXmin(), temp2->GetXaxis()->GetXmax(),
1315 nyBins, temp2->GetYaxis()->GetXmin(), temp2->GetYaxis()->GetXmax());
1316 (hresolution->GetXaxis())->
SetTitle(hist->GetXaxis()->GetTitle());
1317 (hresolution->GetYaxis())->
SetTitle(hist->GetYaxis()->GetTitle());
1318 (hresolution->GetZaxis())->
SetTitle(hist->GetZaxis()->GetTitle());
1320 Int_t bin,binx,biny;
1322 for (binx =0;binx<=nxBins+1;binx++) {
1323 for (biny =0;biny<=nyBins+1;biny++) {
1324 bin = biny*(nxBins+2) + binx;
1326 Double_t ratio = temp2->GetBinContent(binx,biny);
1327 printf(
"\nbin=%d binX=%d binY=%d Ratio=%f\n",bin, binx, biny, ratio);
1331 Double_t chisq = -2.*TMath::Log(2.*ratio);
1332 Double_t dChi = sqrt(chisq);
1333 printf(
"An estimate chi of the event plane is: %f\n", dChi );
1335 printf(
"An estimate of the event plane resolution is: %f\n", dV );
1336 Double_t dVerr = 0.;
1337 printf(
"R:(subevents) = %f +- %f\n",dV,dVerr);
1340 hresolution->SetBinContent(binx, biny, dChi );
1345 hresolution->SetBinContent(binx, biny, dV );
1346 hresolution->SetBinError( binx, biny, dVerr );
1351 TString name=hist->GetName();
1352 hresolution->SetNameTitle(name.Data(),name.Data());
1353 hresolution->SetEntries(hist->GetEntries());
1362 const Double_t FACTOR = 0.797884561;
1364 if (x<1e-7)
return 0;
1366 if (n==0)
return FACTOR*sqrt(x)*TMath::SinH(x)/x;
1367 else if (n==1)
return FACTOR*sqrt(x)*( -TMath::SinH(x)/(x*x) + TMath::CosH(x)/x );
1368 else if (n==2)
return FACTOR*sqrt(x)*( (3./(x*x)+1.)*TMath::SinH(x)/x - 3.*TMath::CosH(x)/(x*x) );
1369 return 0.5*(TMath::BesselI(n,x)+TMath::BesselI(n+1,x));
1377 printf(
"Warning: Estimation of total resolution might be WRONG. Please check!");
1386 Double_t b = TMath::Exp(-a);
1387 if (n==1) b *= TMath::BesselI0(a)+TMath::BesselI1(a);
1388 else if(n%2==1) b *= TMath::BesselI(n1,a)+TMath::BesselI(n2,a);
1390 return TMath::Sqrt(TMath::Pi())/2*x*b;
1399 printf(
"Warning: Resolution for subEvent is high. You reached the precision limit.");
1403 Double_t xtmp=0, xmin=0, xmax=51.3, rtmp=0, delta=2*prec;
1404 while( delta > prec ) {
1405 xtmp = 0.5*(xmin+xmax);
1407 delta = TMath::Abs( res-rtmp );
1408 if(rtmp>res) xmax = xtmp;
1409 if(rtmp<res) xmin = xtmp;
1417 if(!hist)
return kFALSE;
1418 if(fractionXsection<0.1)
return kFALSE;
1425 hist->SetName(temp.Data());
1426 hist->SetTitle(temp.Data());
1438 if(!htemp)
return 0;
1440 TH1F *hpercent = (TH1F*) htemp->Clone(
"hpercent");
1441 TString name=htemp->GetName();
1442 name.Append(
"_percentile");
1443 hpercent->SetNameTitle(name.Data(),name.Data());
1445 Float_t totIntegral = fractionXsection / htemp->Integral(1,htemp->GetNbinsX());
1447 for (
int ibin=1; ibin<=htemp->GetNbinsX(); ibin++){
1448 hpercent->SetBinContent(ibin, totIntegral * htemp->Integral(ibin,htemp->GetNbinsX()) );
1451 else if(direction>0){
1452 for (
int ibin=1; ibin<=htemp->GetNbinsX(); ibin++){
1453 hpercent->SetBinContent(ibin, totIntegral * htemp->Integral(1,ibin) );
1462 if(!htemp)
return 0;
1463 if(fractionXsection<0.1)
return 0;
1465 Double_t integral = htemp->Integral();
1466 Double_t norm = integral / fractionXsection;
1468 std::vector<Double_t> binEdge;
1469 std::vector<Double_t> xSection;
1470 std::vector<TString> fLabels;
1474 Int_t stop = htemp->GetNbinsX();
1477 start = htemp->GetNbinsX()-1;
1479 binEdge.push_back(htemp->GetBinLowEdge(htemp->GetNbinsX()));
1483 binEdge.push_back(htemp->GetBinLowEdge(1));
1492 lxs += htemp->GetBinContent(bin);
1493 Double_t pxs = lxs/norm;
1495 if (direction>0) binEdge.push_back(htemp->GetBinLowEdge(bin+1));
1496 else binEdge.push_back(htemp->GetBinLowEdge(bin));
1497 xSection.push_back(pxs);
1505 for (Int_t i = 0; i < nClasses; ++i) {
1507 totxs += PercentileArray[i];
1509 lxs += htemp->GetBinContent(bin);
1510 txs += htemp->GetBinContent(bin);
1511 Double_t pxs = txs/norm;
1512 Double_t tdiff = (txs+htemp->GetBinContent(bin+direction))/norm;
1514 || (TMath::Abs(pxs-totxs)<=TMath::Abs(tdiff-totxs)) )
1516 if (direction>0) binEdge.push_back(htemp->GetBinLowEdge(bin+1));
1517 else binEdge.push_back(htemp->GetBinLowEdge(bin));
1518 xSection.push_back(lxs/norm);
1523 if ( (direction>0 && bin>=stop) || (direction<0 && bin<=stop ) || (txs>=integral) )
break;
1525 if(totxs>fractionXsection || (direction>0 && bin>=stop) || (direction<0 && bin<=stop ) || (txs>=integral))
break;
1528 fLabels.push_back(
"overflow");
1529 Double_t totXsection =0;
1530 for(std::vector<double>::size_type index = 1; index < xSection.size()-1; ++index){
1531 fLabels.push_back(Form(
"%02.0f-%02.0f",round(totXsection),round(totXsection+xSection[index])) );
1532 totXsection += xSection[index];
1534 fLabels.push_back(
"underflow");
1536 std::reverse(fLabels.begin(),fLabels.end());
1537 std::reverse(binEdge.begin(), binEdge.end());
1538 std::reverse(xSection.begin(), xSection.end());
1540 Double_t xlowbins[binEdge.size()];
1541 std::copy(binEdge.begin(), binEdge.end(), xlowbins);
1543 TString name = htemp->GetTitle();
1545 TH1F *hfixedCuts =
new TH1F(name.Data(), name.Data(), binEdge.size()-1, xlowbins);
1547 for(std::vector<double>::size_type bin = 0; bin < fLabels.size(); ++bin){
1548 (hfixedCuts->GetXaxis())->SetBinLabel(bin+1,fLabels[bin]);
1549 hfixedCuts->SetBinContent(bin+1, fLabels.size()-bin-1);
1550 hfixedCuts->SetBinError(bin+1, xSection[bin]);
1562 if (estimator.CompareTo(
"TOFRPCtimecut")==0 || estimator.CompareTo(
"TOFRPC5")==0)
1564 else if (estimator.CompareTo(
"TOFRPCtimecutFOPI")==0 || estimator.CompareTo(
"TOFRPCFOPI")==0)
1566 else if (estimator.CompareTo(
"TOFRPCtimecut10")==0 || estimator.CompareTo(
"TOFRPC10")==0)
1568 else { Error(
"getNbins()",
"Sorry. getNbins() for %s not implemented yet!",estimator.Data());
return 0;}
1574 if(htemp)
return htemp->GetNbinsX();
1580 if(centC==
k1040)
return 6;
1581 else if(centC==
kFOPI)
return 6;
1583 if(binSize>0)
return round((100./binSize));
1593 if (nBins<1)
return 0;
1595 Float_t* arr =
new Float_t[nBins];
1598 for(Int_t i =0; i < nBins ; i++){
1601 arr[i] = (Float_t) binSize;
1604 arr[i] = 100. - (binSize*i);
1608 else if(centC==
k1040) {
1609 Double_t fxs[6] = {10.,30.,30, 10.,10.,10.};
1610 for(Int_t i =0; i < nBins ; i++) arr[i] = fxs[i];
1612 else if(centC==
kFOPI) {
1613 Double_t fxs[6] = {6.3,14.7,9.9,10.,10.,10.};
1614 for(Int_t i =0; i < nBins ; i++) arr[i] = fxs[i];
1626 Int_t nBins = htemp->GetNbinsX();
1627 Float_t* arr =
new Float_t[nBins];
1628 for(Int_t i =0; i < nBins ; i++) {
1630 arr[i] = (Float_t) (htemp->GetXaxis())->GetBinLowEdge(nBins-i);
1643 Int_t nBins = htemp->GetNbinsX();
1644 Float_t* arr =
new Float_t[nBins];
1646 for(Int_t i =0; i < nBins ; i++) {
1647 pcent += 0.5*htemp->GetBinError(i);
1648 arr[nBins-i] = (Float_t) pcent;
1661 Int_t nBins = htemp->GetNbinsX();
1662 for(Int_t i =1; i < nBins-1 ; i++) {
1664 TString prv = TString( (htemp->GetXaxis())->GetBinLabel(nBins-i) );
1721 if(!
gLoop)
return 0;
1728 Float_t SelectedParticleCandSecCorr=0;
1729 Int_t nGoodSectors=0;
1730 for (Int_t s = 0; s < 6; ++s ){
1736 if(nGoodSectors>0) SelectedParticleCandSecCorr /= nGoodSectors;
1737 return SelectedParticleCandSecCorr;
1747 Float_t w0 = -0.660682;
1748 Float_t w1 = -0.0652827;
1749 Float_t w2 = -0.660682;
1750 Float_t w3 = -0.0652827;
1751 Float_t w4 = -0.655548;
1752 Float_t w5 = -0.00547515;
1754 Int_t nRawWires = 0;
1756 Float_t WirePerTracks = 0;
1757 Float_t SelectedParticleCandCorrPerWire = 0;
1758 Float_t EffWirePerTrack = 0;
1759 for(Int_t s=0;s<6;s++) {
1763 WirePerTracks = Float_t(nRawWires)/nSelMult;
1764 EffWirePerTrack = 1/(exp(w0+w1*WirePerTracks) + exp(w2+w3*WirePerTracks) + exp(w4+w5*WirePerTracks));
1765 SelectedParticleCandCorrPerWire += nSelMult*EffWirePerTrack;
1768 return SelectedParticleCandCorrPerWire;
1773 Float_t MultFWSumChargeSpec=0;
1778 for(Int_t i = 0; i <
fCatWallHit->getEntries(); i ++ ){
1783 else MultFWSumChargeSpec += 93.*pow(wall->
getCharge(),0.46-0.006*sqrt(wall->
getCharge()));
1786 return MultFWSumChargeSpec;
1798 if(nHits<1)
return 0;
1799 for (Int_t i=0; i<nHits; i++){
1803 if(w<minZ)
continue;
1808 else if(SubEvent == 1 &&
arrayOfHits[i]->SubEvent() == 1) {
1811 else if(SubEvent == 2 &&
arrayOfHits[i]->SubEvent() == 2) {
1834 if(particle_cand->
getPID()==-1)
continue;
1836 if( TMath::Abs(particle_cand->Rapidity()-0.74)>0.5 && particle_cand->Pt()>300 ){
1837 Et += particle_cand->Et();
1846 Float_t RatioEtEz=0;
1862 if(particle_cand->
getPID()==-1)
continue;
1863 Ez += particle_cand->E()*particle_cand->CosTheta();
1864 Et += particle_cand->Et();
1879 Float_t Directivity=0;
1880 TLorentzVector QVector = TLorentzVector();
1895 if(particle_cand->
getPID()==-1)
continue;
1896 if( particle_cand->Rapidity() > 0.74 ){
1897 QVector += (TLorentzVector)* particle_cand;
1898 QVectorT += particle_cand->Pt();
1901 QVector -= (TLorentzVector)* particle_cand;
1902 QVectorT += particle_cand->Pt();
1906 if(QVectorT>0)Directivity = QVector.Pt() / QVectorT;
1907 else Directivity = 0;
TString getStringCentralityClass(UInt_t e)
Float_t getCorrectionError(UInt_t flag=kQx)
Float_t * getCentralityClassArray(UInt_t centC=k10)
Int_t getFWCharge(HWallHitSim *wall)
Int_t GetFWmoduleSize(HWallHitSim *wall)
vector< TString > getLabelArray(UInt_t centE=kTOFRPC, UInt_t centC=k10)
TString getStringCentralityEstimator(UInt_t e)
Double_t ComputeResolution(Double_t x, Int_t n=1) const
Float_t * getBinCenterArray(UInt_t centE=kTOFRPC, UInt_t centC=k10)
Float_t getSelectedParticleCandSecNorm()
Int_t getNbins(TString estimator)
vector< Int_t > getFWhits()
Float_t getDistance(void) const
Float_t getEventPlane(UInt_t EPcorr=kNoCorrection, UInt_t SubEvent=0, UInt_t nHarmonic=1)
Float_t getCentralityClassBinSize(UInt_t e)
Bool_t isFlagBit(eFlagBits bit)
Bool_t PassesCutsFW(HWallHitSim *wall)
Bool_t addEstimatorHist(TH1F *hist, Float_t fractionXsection=100., UInt_t centE=kTOFRPC, Int_t direction=-1)
Float_t getFWSumChargeSpec()
Bool_t saveCentralityEstimatorHist()
Double_t FindXi(Double_t res, Double_t prec=1e-6, Int_t n=1) const
Float_t getSelectedParticleCandCorrPerWire()
UInt_t getCentralityEstimatorFromString(TString s)
HDataSource * getDataSource(void) const
vector< TH1 * > fEstimatorHist
TH1F * getCentralityPercentileHist(UInt_t centE=kTOFRPC) const
Bool_t excludeNoisyFWcells
Int_t getSumRpcMultHit() const
Int_t getMdcWiresOuterMod()
HRuntimeDb * getRuntimeDb(void)
Bool_t saveEventPlaneCorrectionHist()
HEvent *& getCurrentEvent(void)
Float_t getVersion()
destructor
TString getStringEventPlaneCorrection(UInt_t e)
vector< Bool_t > useFWCut
virtual HEventHeader * getHeader(void) const
Float_t getCorrection(UInt_t flag=kQx)
Float_t getThetaWeight(HWallHitSim *wall, Float_t min=3.5, Float_t max=8.)
void Set(Float_t x, Float_t y, Float_t w1=1., Float_t w2=1.)
Int_t getMdcWiresMod(Int_t s, Int_t m)
Bool_t saveFWCutValuesHist()
p1 GetXaxis() -> SetLabelSize(0.06)
static T * getObject(T *pout, Short_t num=-1, Int_t index=-1, Bool_t silent=kFALSE)
Float_t getPhi(Float_t x, Float_t y)
static HCategory * getCategory(Short_t num, Int_t warn=0, TString name="")
Bool_t isFakeRejected(Int_t io=-1)
Text_t const * getCurrentFileName()
Bool_t loadCentralityEstimatorHist()
HCategory * fParticleEvtInfoCat
Float_t getTheta(void) const
ClassImp(HParticleEvtChara) HParticleEvtChara
Float_t * getUpEdgeArray(UInt_t centE=kTOFRPC, UInt_t centC=k10)
p1 GetYaxis() -> SetLabelSize(0.06)
Bool_t addFWCutValuesHist(TH1 *hist, Int_t cell, UInt_t eFWCut)
TH1F * makePercentiles(TH1F *hist, Float_t fractionXsection=100., Int_t direction=-1)
Float_t getCentralityPercentile(TString estimator)
Int_t getCell(void) const
TH1F * makeClasses(TH1F *h, Float_t fractionXsection=100., UInt_t centC=k10, Int_t direction=-1)
Int_t getCentralityClass(TString estimator)
Int_t getSumSelectedParticleCandMult() const
Bool_t loadParameterFile()
Bool_t setParameterFile(TString ParameterFile)
Float_t getCorrectionPhi(Float_t phi)
void SetOrg(Float_t x, Float_t y)
HCategory * fParticleCandCat
vector< TH2 * > fEventPlaneCorrectionHist
static Int_t getDayFileName(TString name, Bool_t print=kFALSE)
~HParticleEvtChara()
constructor
Float_t getCentralityEstimator(UInt_t centE=kTOFRPC)
Int_t getCentralityClass5(TString estimator)
static TString stripFileName(TString name, Bool_t removeEvtBuilder=kFALSE, Bool_t silent=kFALSE)
TH1F * getCentralityClassHist(UInt_t centE=kTOFRPC, UInt_t centC=k10) const
Bool_t isNewFile(TString &name)
Int_t getSelectedParticleCandMult(Int_t s) const
Float_t getEventPlaneParameter(UInt_t flag=kQx, Bool_t corr=kFALSE)
Bool_t isFlagSet(UInt_t flag, UInt_t status)
Float_t fReferenceMeanSelTrack
Int_t getCentralityClassNbins(UInt_t centC=k10)
UInt_t fEventPlaneCorrectionFlag
Bool_t goodSector(Int_t sector)
TH2D * makeEPresolution(TProfile2D *hist, Bool_t calcChi=kFALSE)
Float_t getFWSumZ(Int_t minZ=1, Int_t maxZ=99, UInt_t SubEvent=0)
Short_t getSystemUsed() const
void getXYZLab(Float_t &x, Float_t &y, Float_t &z)
Float_t getTime(void) const
Float_t getSmearValue(Int_t size=1)
Int_t getSumPrimaryParticleCandMult() const
TString getStringFWCutValues(UInt_t e)
const Cat_t catParticleEvtInfo
Bool_t loadEventPlaneCorrectionHist()
vector< TH1 * > fCentralityPercentileHist
vector< vector< TH1 * > > fFWCutValuesHist
Bool_t fillQVectors(UInt_t EPcorr=kNoCorrection, UInt_t nHarmonic=1)
Bool_t addEventPlaneCorrectionHist(TProfile2D *hist, UInt_t epParam=kQx)
vector< vector< TH1 * > > fCentralityHist
Float_t getCharge(void) const
Bool_t printCentralityClass(TString estimator)
Float_t getEventPlaneWeight(UInt_t EPcorr=kNoCorrection, UInt_t SubEvent=0, UInt_t nHarmonic=1)
Double_t ModifiedBesselI(Int_t n, Double_t x) const
TH1F * getEventPlaneCorrectionHist(UInt_t flag) const
Bool_t saveParameterFile()
UInt_t currentEventSeqNumber
TString getStringEventPlaneParameter(UInt_t e)
Bool_t loadFWCutValuesHist()
Int_t getCentralityClass10(TString estimator)
vector< Int_t > iFWHitvector
Int_t getSumTofMult() const
Int_t getSumTofMultCut() const
Int_t getSumRpcMultHitCut() const
const Cat_t catParticleCand
vector< SimpleQVector * > arrayOfHits
Bool_t isFlagAND(Int_t num,...)