1 #include "StFmsCalibMakerQa.h"
13 void StFmsCalibMakerQa::CreateQaHist(
int detId,
int maxCh)
15 if (detId == 8) mH1_nEvents =
new TH1F(
"nEvents",
";runNo", 16094000-16066000, 16066000-0.5, 16094000-0.5);
17 mH2_massWide[detId-8] =
new TH2F(Form(
"mass_d%i_wide", detId),
";ch;mass", maxCh,0.5,maxCh+0.5, 100,0.,1.0);
18 mH2_massWide[detId-8]->Sumw2();
20 for (
int i=0; i<7; i++)
22 mH2_massOpenA[detId-8][i] =
new TH2F(Form(
"mass_d%i_openA%i",detId,i),
"", 500,0.,0.05, 100,0.,1.);
23 mH2_massOpenA[detId-8][i]->SetTitle(Form(
"%2.1f < Zgg < %2.1f;openA;mass", 0.1*i, 0.1*(i+1)));
24 mH2_massOpenA[detId-8][i]->Sumw2();
27 for (
int i=0; i<7; i++)
29 mH2_massPairE[detId-8][i] =
new TH2F(Form(
"mass_d%i_pairE%i",detId,i),
"", 1000,0,100, 100,0.,1.);
30 mH2_massPairE[detId-8][i]->SetTitle(Form(
"%2.1f < Zgg < %2.1f;pairE;mass", 0.1*i, 0.1*(i+1)));
31 mH2_massPairE[detId-8][i]->Sumw2();
34 for (
int i=0; i<7; i++)
36 const char* Title = (i!=6)?Form(
"%2i < pair E < %2i", 20+10*i, 20+10*(i+1)):Form(
"%2i < pair E", 20+10*i);
37 mH2_massZgg[detId-8][i] =
new TH2F(Form(
"mass_d%i_zgg%i",detId,i),
"", 100,0,1, 100,0.,1.);
38 mH2_massZgg[detId-8][i]->SetTitle(Title);
39 mH2_massZgg[detId-8][i]->Sumw2();
42 mH2_pointsEP[detId-8] =
new TH2F(Form(
"pointsEP_d%i", detId),
";eta;phi", 72,2.5,4.3, 120,-M_PI,M_PI);
43 mH2_pointsEP[detId-8]->Sumw2();
47 for (
int i=0; i<2; i++)
48 for (
int j=0; j<3; j++)
50 const int tBin = (j<2)?210:110;
51 const float tEnd = (float)tBin/2;
52 mH2_pointsXY[i][j] =
new TH2F(Form(
"point%iXY_%i", i, j),
";X;Y", tBin,-tEnd,tEnd, tBin,-tEnd,tEnd);
53 mH2_pointsXY[i][j]->SetTitle(Form(
"Point %i", i));
54 mH2_pointsXY[i][j]->Sumw2();
62 void StFmsCalibMakerQa::CreateQaHistAdc(
int detId,
int maxCh,
int trigId)
64 if (detId == 8) mH1_trig =
new TH1F(
"trig",
";TrigId", 1000, trigId-500, trigId+500);
66 mH2_adc[detId-8] =
new TH2F(Form(
"adc_d%i", detId),
"", maxCh,0.5,maxCh+0.5, 250,0,250);
67 mH2_adc[detId-8]->SetTitle(Form(
"detId=%i, Triggered by %i;ch;adc", detId, trigId));
68 mH2_adc[detId-8]->Sumw2();
70 mH2_adcWide[detId-8] =
new TH2F(Form(
"adc_d%i_wide", detId),
"", maxCh,0.5,maxCh+0.5, 5000,0,5000);
71 mH2_adcWide[detId-8]->SetTitle(Form(
"detId=%i, Triggered by %i, extended range;ch;adc", detId, trigId));
72 mH2_adcWide[detId-8]->Sumw2();
78 void StFmsCalibMakerQa::CreateQaHistZVtx(
void)
80 mH1_bbcZ =
new TH1F(
"bbcZ",
"Bbc slewing corrected;bbcZ", 1000, -250, 250);
82 mH1_diffMass =
new TH1F(
"diff_mass",
";#DeltaMass (default - corr))", 800, -0.2, 0.2);
83 mH1_diffMass->Sumw2();
84 mH1_diffOpenA =
new TH1F(
"diff_openA",
";#DeltaOpenA (default - corr)", 800, -0.04, 0.04);
85 mH1_diffOpenA->Sumw2();
91 void StFmsCalibMakerQa::CreateQaTree(
void)
93 cout <<Form(
"\nCreating a tree for QA: large disk space will be used...") <<endl;
96 T =
new TTree(
"T",
"QA tree for StFmsCalibMaker");
98 T->Branch(
"hits", 0,
"nHit/s:detId[nHit]/s:ch[nHit]/s:pointB[nHit]/s:hitE[nHit]/F");
99 ((TLeaf*)T->GetBranch(
"hits")->GetListOfLeaves()->At(iLeaf))->SetAddress(&mNhit); iLeaf++;
100 ((TLeaf*)T->GetBranch(
"hits")->GetListOfLeaves()->At(iLeaf))->SetAddress(&mDetId); iLeaf++;
101 ((TLeaf*)T->GetBranch(
"hits")->GetListOfLeaves()->At(iLeaf))->SetAddress(&mCh); iLeaf++;
102 ((TLeaf*)T->GetBranch(
"hits")->GetListOfLeaves()->At(iLeaf))->SetAddress(&mPointB); iLeaf++;
103 ((TLeaf*)T->GetBranch(
"hits")->GetListOfLeaves()->At(iLeaf))->SetAddress(&mHitE); iLeaf=0;
105 T->Branch(
"clusters", 0,
"cluTowers[2]/s:cluMax[2]/F:cluMin[2]/F:cluX[2]/F:cluY[2]/F");
106 ((TLeaf*)T->GetBranch(
"clusters")->GetListOfLeaves()->At(iLeaf))->SetAddress(&mCluTowers); iLeaf++;
107 ((TLeaf*)T->GetBranch(
"clusters")->GetListOfLeaves()->At(iLeaf))->SetAddress(&mCluMax); iLeaf++;
108 ((TLeaf*)T->GetBranch(
"clusters")->GetListOfLeaves()->At(iLeaf))->SetAddress(&mCluMin); iLeaf++;
109 ((TLeaf*)T->GetBranch(
"clusters")->GetListOfLeaves()->At(iLeaf))->SetAddress(&mCluX); iLeaf++;
110 ((TLeaf*)T->GetBranch(
"clusters")->GetListOfLeaves()->At(iLeaf))->SetAddress(&mCluY); iLeaf=0;
112 T->Branch(
"points", 0,
"pointE[2]/F:pointX[2]/F:pointY[2]/F");
113 ((TLeaf*)T->GetBranch(
"points")->GetListOfLeaves()->At(iLeaf))->SetAddress(&mPointE); iLeaf++;
114 ((TLeaf*)T->GetBranch(
"points")->GetListOfLeaves()->At(iLeaf))->SetAddress(&mPointX); iLeaf++;
115 ((TLeaf*)T->GetBranch(
"points")->GetListOfLeaves()->At(iLeaf))->SetAddress(&mPointY); iLeaf=0;
117 T->Branch(
"pair", 0,
"mass/F:openA/F:zgg/F");
118 ((TLeaf*)T->GetBranch(
"pair")->GetListOfLeaves()->At(iLeaf))->SetAddress(&mMass); iLeaf++;
119 ((TLeaf*)T->GetBranch(
"pair")->GetListOfLeaves()->At(iLeaf))->SetAddress(&mOpenA); iLeaf++;
120 ((TLeaf*)T->GetBranch(
"pair")->GetListOfLeaves()->At(iLeaf))->SetAddress(&mZgg); iLeaf=0;
122 T->Branch(
"trig", &mTrigBit,
"trig/I");
129 void StFmsCalibMakerQa::ResetQaTree(
void)
132 for (
int i=0; i<mNhitMax; i++)
140 for (
int i=0; i<2; i++)
142 mCluTowers[i] = -999;