CGEM BOSS 6.6.5.g
BESIII Offline Software System
Loading...
Searching...
No Matches
CalibBase Class Referenceabstract

#include <CalibBase.h>

+ Inheritance diagram for CalibBase:

Public Member Functions

 CalibBase ()
 
virtual ~CalibBase ()
 
virtual void init (TObjArray *hlist, MdcCosGeom *pGeom)=0
 
virtual void mergeHist (TFile *fhist)=0
 
virtual void calib (MdcCalibConst *calconst, TObjArray *newXtList, TObjArray *r2tList)=0
 

Detailed Description

Used as a base for all objects in the calibration data store. Implement IValidity.

Permits implementation of deep copy by means of virtual update method. [Used in CalibMySQLCnvSvc::updateCalib]

Author
J. Bogart

Implementation of base class for all calibration data objects

Definition at line 21 of file Mdc/MdcCalibAlg/MdcCalibAlg-00-09-02/share/distcalib/src/include/CalibBase.h.

Constructor & Destructor Documentation

◆ CalibBase()

CalibBase::CalibBase ( )

Definition at line 8 of file CalibBase.cpp.

8 {
9}

◆ ~CalibBase()

CalibBase::~CalibBase ( )
virtual

Definition at line 11 of file CalibBase.cpp.

11 {
12}

Member Function Documentation

◆ calib()

void CalibBase::calib ( MdcCalibConst calconst,
TObjArray *  newXtList,
TObjArray *  r2tList 
)
pure virtual

Implemented in GrXtCalib, IniCalib, PreT0Calib, PreXtCalib, QtCalib, T0Calib, XtCalib, and XtInteCalib.

Definition at line 711 of file CalibBase.cpp.

711 {
712 int nGoodAll = 0;
713 int nGoodInn = 0;
714 int nGoodStp = 0;
715 int nGoodOut = 0;
716 int nTotAll = 0;
717 int nTotInn = 0;
718 int nTotStp = 0;
719 int nTotOut = 0;
720 ofstream feffi("MdcLayerEffi.dat");
721 for(int lay=0; lay<NLAYER; lay++){
722 double effNtrk = m_effNtrk->GetBinContent(lay+1);
723 double effGoodHit = m_effNtrkRecHit->GetBinContent(lay+1);
724 nGoodAll += effGoodHit;
725 if(lay < 8) nGoodInn += effGoodHit;
726 else if (lay < 20) nGoodStp += effGoodHit;
727 else nGoodOut += effGoodHit;
728
729 nTotAll += effNtrk;
730 if(lay < 8) nTotInn += effNtrk;
731 else if (lay < 20) nTotStp += effNtrk;
732 else nTotOut += effNtrk;
733
734 double effi = (double)effGoodHit / (double)effNtrk;
735 double effErr = sqrt(effi * (1-effi) / (double)effNtrk);
736 feffi << setw(5) << lay << setw(15) << effi << setw(15) << effErr
737 << setw(15) << effGoodHit << setw(15) << effNtrk << endl;
738 }
739 double effiAll = (double)nGoodAll / (double)(nTotAll);
740 double errAll = sqrt(effiAll * (1-effiAll) / (double)(nTotAll));
741 double effiInn = (double)nGoodInn / (double)(nTotInn);
742 double errInn = sqrt(effiInn * (1-effiInn) / (double)(nTotInn));
743 double effiStp = (double)nGoodStp / (double)(nTotStp);
744 double errStp = sqrt(effiStp * (1-effiStp) / (double)(nTotStp));
745 double effiOut = (double)nGoodOut / (double)(nTotOut);
746 double errOut = sqrt(effiOut * (1-effiOut) / (double)(nTotOut));
747 feffi << endl << "EffiAll: " << setw(15) << effiAll << setw(15) << errAll
748 << setw(15) << nGoodAll << setw(15) << nTotAll << endl;
749 feffi << endl << "EffiInn: " << setw(15) << effiInn << setw(15) << errInn
750 << setw(15) << nGoodInn << setw(15) << nTotInn << endl;
751 feffi << endl << "EffiStp: " << setw(15) << effiStp << setw(15) << errStp
752 << setw(15) << nGoodStp << setw(15) << nTotStp << endl;
753 feffi << endl << "EffiOut: " << setw(15) << effiOut << setw(15) << errOut
754 << setw(15) << nGoodOut << setw(15) << nTotOut << endl;
755 feffi.close();
756
757 // update resolution function
758 Stat_t histEntry;
759 int nSdBin[43];
760 for(int lay=0; lay<8; lay++) nSdBin[lay] = 12; // 14
761 for(int lay=8; lay<43; lay++) nSdBin[lay] = 16; // 18
762 double sigm[NSDBIN];
763 if(1 == gCalSigma){
764 ofstream fr2d("logr2d.dat");
765 for(int lay=0; lay<43; lay++){
766 int nbinLim = 13;
767 if(lay<8) nbinLim = 9;
768 if(0 == gFgCalib[lay]) continue;
769 for(int iEntr=0; iEntr<gNEntr[lay]; iEntr++){
770 for(int lr=0; lr<2; lr++){
771 fr2d << setw(3) << lay << setw(3) << iEntr << setw(3) << lr << endl;
772 for(int bin=0; bin<nSdBin[lay]; bin++){
773 if(1 == gResiType){
774 histEntry = m_hr2dExc[lay][iEntr][lr][bin]->GetEntries();
775 double rms = m_hr2dExc[lay][iEntr][lr][bin]->GetRMS();
776 m_hr2dExc[lay][iEntr][lr][bin]->Fit("gaus", "Q");
777 double gausSigm = m_hr2dExc[lay][iEntr][lr][bin]->GetFunction("gaus")->GetParameter(2);
778// if(histEntry<50){
779// sigm[bin] = calconst->getSdpar(lay, iEntr, lr, bin);
780// } else if((lay>2) && (histEntry>500) && (fabs(rms-gausSigm)<0.02)){
781// sigm[bin] = gausSigm;
782// } else{
783// sigm[bin] = rms;
784// }
785
786 if(histEntry > 500){
787 sigm[bin] = gausSigm;
788 } else if(histEntry>100){
789 sigm[bin] = rms;
790 } else{
791 sigm[bin] = calconst->getSdpar(lay, iEntr, lr, bin);
792 }
793 if(bin>=nbinLim){
794 if(sigm[bin] < sigm[bin-1]) sigm[bin] = sigm[bin-1];
795 }
796 } else{
797 histEntry = m_hr2dInc[lay][iEntr][lr][bin]->GetEntries();
798 double rms = m_hr2dInc[lay][iEntr][lr][bin]->GetRMS();
799 m_hr2dInc[lay][iEntr][lr][bin]->Fit("gaus", "Q");
800 double gausSigm = m_hr2dInc[lay][iEntr][lr][bin]->GetFunction("gaus")->GetParameter(2);
801 if(histEntry<50){
802 sigm[bin] = calconst->getSdpar(lay, iEntr, lr, bin);
803 } else if((lay>2) && (histEntry>500) && (fabs(rms-gausSigm)<0.02)){
804 sigm[bin] = gausSigm;
805 } else{
806 sigm[bin] = rms;
807 }
808 if(bin>=nbinLim){
809 if(sigm[bin] < sigm[bin-1]) sigm[bin] = sigm[bin-1];
810 }
811// if(histEntry > 500){
812// m_hr2dInc[lay][iEntr][lr][bin]->Fit("gaus", "Q");
813// sigm[bin] = m_hr2dInc[lay][iEntr][lr][bin]->GetFunction("gaus")->GetParameter(2);
814// } else if(histEntry>100){
815// sigm[bin] = m_hr2dInc[lay][iEntr][lr][bin]->GetRMS();
816// } else{
817// sigm[bin] = 0.2;
818// }
819 }
820 if(sigm[bin] < 0.05) sigm[bin] = 0.05; // for boundary layers
821 } // end of bin loop
822 for(int bin=nSdBin[lay]; bin<NSDBIN; bin++){
823 sigm[bin] = sigm[bin-1];
824 }
825
826 for(int bin=0; bin<NSDBIN; bin++){
827 if(1 == gNEntr[lay]){
828 for(int i=0; i<6; i++) calconst->resetSdpar(lay, i, lr, bin, sigm[bin]);
829 } else if(2 == gNEntr[lay]){
830 if(0 == iEntr){
831 for(int i=0; i<3; i++){ // entr<0
832 calconst->resetSdpar(lay, i, lr, bin, sigm[bin]);
833 }
834 } else{
835 for(int i=3; i<6; i++){ // entr>0
836 calconst->resetSdpar(lay, i, lr, bin, sigm[bin]);
837 }
838 }
839 }
840 fr2d << setw(5) << bin << setw(15) << sigm[bin] << endl;
841 }
842 } // lr loop
843 } // entr loop
844 } // layer loop
845 fr2d.close();
846 }
847
848 int entrId, lrId;
849 double tdr, sigma;
850 char hname[200];
851 r2tList->Clear();
852 TTree* r2ttr[NLAYER];
853 for(int lay=0; lay<NLAYER; lay++){
854 sprintf(hname, "r2t%02d", lay);
855 r2ttr[lay] = new TTree(hname, hname);
856 r2ttr[lay]->Branch("iEntr", &entrId, "iEntr/I");
857 r2ttr[lay]->Branch("lr", &lrId, "lr/I");
858 r2ttr[lay]->Branch("t", &tdr, "t/D");
859 r2ttr[lay]->Branch("s", &sigma, "s/D");
860 for(int iEntr=0; iEntr<NENTRXT; iEntr++){
861 for(int lr=0; lr<2; lr++){
862 for(int bin=0; bin<45; bin++){
863 entrId = iEntr;
864 lrId = lr;
865 tdr = (double)bin * 10.0 + 5.0;
866 sigma = 0.13;
867 r2ttr[lay]->Fill();
868 }
869 }
870 }
871 r2tList->Add(r2ttr[lay]);
872 }
873
874 renameHist();
875}
*******INTEGER m_nBinMax INTEGER m_NdiMax !No of bins in histogram for cell exploration division $ !Last vertex $ !Last active cell $ !Last cell in buffer $ !No of sampling when dividing cell $ !No of function total $ !Flag for random ceel for $ !Flag for type of for WtMax $ !Flag which decides whether vertices are included in the sampling $ entire domain is hyp !Maximum effective eevents per bin
Definition: FoamA.h:85
void resetSdpar(int lay, int entr, int lr, int bin, double val)
double getSdpar(int lay, int entr, int lr, int bin)
std::ofstream ofstream
Definition: bpkt_streams.h:42

Referenced by GrXtCalib::calib(), QtCalib::calib(), T0Calib::calib(), XtCalib::calib(), XtInteCalib::calib(), and main().

◆ init()

void CalibBase::init ( TObjArray *  hlist,
MdcCosGeom pGeom 
)
pure virtual

Implemented in GrXtCalib, IniCalib, PreT0Calib, PreXtCalib, QtCalib, T0Calib, XtCalib, and XtInteCalib.

Definition at line 14 of file CalibBase.cpp.

14 {
15 char hname[200];
16
17 m_fdcom = new TFolder("mcommon", "common");
18 hlist -> Add(m_fdcom);
19
20 m_effNtrk = new TH1F("meffNtrk", "", 43, -0.5, 42.5);
21 m_fdcom->Add(m_effNtrk);
22
23 m_effNtrkRecHit = new TH1F("meffNtrkRecHit", "", 43, -0.5, 42.5);
24 m_fdcom->Add(m_effNtrkRecHit);
25
26 m_hresAllInc = new TH1F("mHResAllInc", "", 200, -1.0, 1.0);
27 m_fdcom -> Add(m_hresAllInc);
28
29 m_hresAllExc = new TH1F("mHResAllExc", "", 200, -1.0, 1.0);
30 m_fdcom -> Add(m_hresAllExc);
31
32 m_hresAllAve = new TH1F("mHResAllAve", "", 200, -1.0, 1.0);
33 m_fdcom -> Add(m_hresAllAve);
34
35 m_hresInnInc = new TH1F("mHResInnInc", "", 200, -1.0, 1.0);
36 m_fdcom -> Add(m_hresInnInc);
37
38 m_hresInnExc = new TH1F("mHResInnExc", "", 200, -1.0, 1.0);
39 m_fdcom -> Add(m_hresInnExc);
40
41 m_hresStpInc = new TH1F("mHResStpInc", "", 200, -1.0, 1.0);
42 m_fdcom -> Add(m_hresStpInc);
43
44 m_hresStpExc = new TH1F("mHResStpExc", "", 200, -1.0, 1.0);
45 m_fdcom -> Add(m_hresStpExc);
46
47 m_hresOutInc = new TH1F("mHResOutInc", "", 200, -1.0, 1.0);
48 m_fdcom -> Add(m_hresOutInc);
49
50 m_hresOutExc = new TH1F("mHResOutExc", "", 200, -1.0, 1.0);
51 m_fdcom -> Add(m_hresOutExc);
52
53 m_fdResQ = new TFolder("mResQ", "ResQ");
54 hlist->Add(m_fdResQ);
55 for(int i=0; i<14; i++){
56 sprintf(hname, "mresoAll_qbin%02d", i);
57 m_hresAveAllQ[i] = new TH1F(hname, "", 200, -1, 1);
58 m_fdResQ->Add(m_hresAveAllQ[i]);
59
60 sprintf(hname, "mresoOut_qbin%02d", i);
61 m_hresAveOutQ[i] = new TH1F(hname, "", 200, -1, 1);
62 m_fdResQ->Add(m_hresAveOutQ[i]);
63 }
64 for(int lay=0; lay<43; lay++){
65 for(int i=0; i<14; i++){
66 sprintf(hname, "mresoLay%02d_qbin%02d", lay, i);
67 m_hresAveLayQ[lay][i] = new TH1F(hname, "", 200, -1, 1);
68 m_fdResQ->Add(m_hresAveLayQ[lay][i]);
69 }
70 }
71
72 m_hbbTrkFlg = new TH1F("mBbTrkFlg", "", 100, 0, 6);
73 m_fdcom -> Add(m_hbbTrkFlg);
74
75 m_hTesAll = new TH1F("mTesAll", "", 1000, 0, 2000);
76 m_fdcom -> Add(m_hTesAll);
77
78 m_hTesGood = new TH1F("mTesGood", "", 1000, 0, 2000);
79 m_fdcom -> Add(m_hTesGood);
80
81 m_hTesAllFlag = new TH1F("mTesAllFlag", "", 300, -0.5, 299.5);
82 m_fdcom -> Add(m_hTesAllFlag);
83
84 m_hTesRec = new TH1F("mTesRec", "", 1000, 0, 2000);
85 m_fdcom -> Add(m_hTesRec);
86
87 m_hTesCalFlag = new TH1F("mTesCalFlag", "", 1000, 0, 2000);
88 m_fdcom -> Add(m_hTesCalFlag);
89
90 m_hTesCalUse = new TH1F("mTesCalUse", "", 1000, 0, 2000);
91 m_fdcom -> Add(m_hTesCalUse);
92
93 m_hnRawHit = new TH1F("mNRawHit", "", 6797, -0.5, 6796.5);
94 m_fdcom -> Add(m_hnRawHit);
95
96 m_hpt = new TH1F("mHPt", "", 800, 0, 3);
97 m_fdcom -> Add(m_hpt);
98
99 m_hptPos = new TH1F("mHPtPos", "", 800, 0, 3);
100 m_fdcom -> Add(m_hptPos);
101
102 m_hptNeg = new TH1F("mHPtNeg", "", 800, 0, 3);
103 m_fdcom -> Add(m_hptNeg);
104
105 m_hp = new TH1F("mHP", "", 800, 0, 3);
106 m_fdcom -> Add(m_hp);
107
108 m_hp_cms = new TH1F("mHPCMS", "", 800, 0, 3);
109 m_fdcom -> Add(m_hp_cms);
110
111 m_hpMax = new TH1F("mHPMax", "", 800, 0, 3);
112 m_fdcom -> Add(m_hpMax);
113
114 m_hpMaxCms = new TH1F("mHPMax_Cms", "", 800, 0, 3);
115 m_fdcom -> Add(m_hpMaxCms);
116
117 m_hpPos = new TH1F("mHP_Pos", "", 800, 0, 3);
118 m_fdcom -> Add(m_hpPos);
119
120 m_hpNeg = new TH1F("mHP_Neg", "", 800, 0, 3);
121 m_fdcom -> Add(m_hpNeg);
122
123 m_hpPoscms = new TH1F("mHP_Pos_cms", "", 800, 0, 3);
124 m_fdcom -> Add(m_hpPoscms);
125
126 m_hpNegcms = new TH1F("mHP_Neg_cms", "", 800, 0, 3);
127 m_fdcom -> Add(m_hpNegcms);
128
129 m_hp_cut = new TH1F("mHPCut", "", 800, 0, 3);
130 m_fdcom -> Add(m_hp_cut);
131
132 m_hchisq = new TH1F("mChisq", "", 10, 0, 100);
133 m_fdcom -> Add(m_hchisq);
134
135 m_hnTrk = new TH1F("mHNtrack", "HNtrack", 10, -0.5, 9.5);
136 m_fdcom -> Add(m_hnTrk);
137
138 m_hnTrkCal = new TH1F("mHNtrackCal", "HNtrackCal", 10, -0.5, 9.5);
139 m_fdcom -> Add(m_hnTrkCal);
140
141 m_hnhitsRec = new TH1F("mHNhitsRec", "", 100, -0.5, 99.5);
142 m_fdcom -> Add(m_hnhitsRec);
143
144 m_hnhitsRecInn = new TH1F("mHNhitsInnRec", "", 60, 0.5, 60.5);
145 m_fdcom -> Add(m_hnhitsRecInn);
146
147 m_hnhitsRecStp = new TH1F("mHNhitsStpRec", "", 60, 0.5, 60.5);
148 m_fdcom -> Add(m_hnhitsRecStp);
149
150 m_hnhitsRecOut = new TH1F("mHNhitsOutRec", "", 60, 0.5, 60.5);
151 m_fdcom -> Add(m_hnhitsRecOut);
152
153 m_hnhitsCal = new TH1F("mHNhitsCal", "", 100, -0.5, 99.5);
154 m_fdcom -> Add(m_hnhitsCal);
155
156 m_hnhitsCalInn = new TH1F("mHNhitsCalInn", "", 60, 0.5, 60.5);
157 m_fdcom -> Add(m_hnhitsCalInn);
158
159 m_hnhitsCalStp = new TH1F("mHNhitsCalStp", "", 60, 0.5, 60.5);
160 m_fdcom -> Add(m_hnhitsCalStp);
161
162 m_hnhitsCalOut = new TH1F("mHNhitsCalOut", "", 60, 0.5, 60.5);
163 m_fdcom -> Add(m_hnhitsCalOut);
164
165 m_wirehitmap = new TH1F("mWire_HitMap", "Wire_HitMap", 6796, -0.5, 6795.5);
166 m_fdcom -> Add(m_wirehitmap);
167
168 m_layerhitmap = new TH1F("mLayer_HitMap", "Layer_HitMap", 43, -0.5, 42.5);
169 m_fdcom -> Add(m_layerhitmap);
170
171 m_hnoisephi = new TH1F("mphi_noise", "", 100, 0, 6.284);
172 m_fdcom -> Add(m_hnoisephi);
173
174 m_hnoiselay = new TH1F("mLayer_noise", "Layer_noise", 43, -0.5, 42.5);
175 m_fdcom -> Add(m_hnoiselay);
176
177 m_hnoisenhits = new TH1F("mnhits_noise", "nhits_noise", 6796, -0.5, 6795.5);
178 m_fdcom -> Add(m_hnoisenhits);
179
180 m_hratio = new TH1F("mratio", "", 100, 0, 1);
181 m_fdcom -> Add(m_hratio);
182
183 m_hdr = new TH1F("mdr", "", 500, -500, 500);
184 m_fdcom -> Add(m_hdr);
185
186 m_hphi0 = new TH1F("mphi0", "", 100, 0, 6.284);
187 m_fdcom -> Add(m_hphi0);
188
189 m_hkap = new TH1F("mkappa", "", 400, -50, 50);
190 m_fdcom -> Add(m_hkap);
191
192 m_hdz = new TH1F("mdz", "", 500, -1000, 1000);
193 m_fdcom -> Add(m_hdz);
194
195 m_htanl = new TH1F("mtanl", "", 200, -5, 5);
196 m_fdcom -> Add(m_htanl);
197
198 m_hcosthe = new TH1F("mcostheta", "", 200, -1, 1);
199 m_fdcom -> Add(m_hcosthe);
200
201 m_hcostheNeg = new TH1F("mcosthetaNeg", "", 200, -1, 1);
202 m_fdcom -> Add(m_hcostheNeg);
203
204 m_hcosthePos = new TH1F("mcosthetaPos", "", 200, -1, 1);
205 m_fdcom -> Add(m_hcosthePos);
206
207 m_hx0 = new TH1F("mx0", "", 100, -10, 10);
208 m_fdcom -> Add(m_hx0);
209
210 m_hy0 = new TH1F("my0", "", 100, -10, 10);
211 m_fdcom -> Add(m_hy0);
212
213 m_hdelZ0 = new TH1F("mdelta_z0", "", 100, -50, 50);
214 m_fdcom -> Add(m_hdelZ0);
215
216 m_nGrPoint = 0;
217 m_grX0Y0 = new TGraph();
218 m_grX0Y0->SetName("mx0y0");
219 m_fdcom -> Add(m_grX0Y0);
220
221 m_hitEffAll = new TH1F("mhitEffAll", "", 6800, -0.5, 6799.5);
222 m_fdcom -> Add(m_hitEffAll);
223
224 m_hitEffRaw = new TH1F("mhitEffRaw", "", 6800, -0.5, 6799.5);
225 m_fdcom -> Add(m_hitEffRaw);
226
227 m_hitEffRec = new TH1F("mhitEffRec", "", 6800, -0.5, 6799.5);
228 m_fdcom -> Add(m_hitEffRec);
229
230 // histograms for drift time
231 m_fdTime = new TFolder("mtime", "time");
232 hlist -> Add(m_fdTime);
233
234 for(int lay=0; lay<NLAYER; lay++){
235 sprintf(hname, "mTraw%02d", lay);
236 m_htraw[lay] = new TH1F(hname, "", 1000, 0, 2000);
237 m_fdTime -> Add(m_htraw[lay]);
238
239 sprintf(hname, "mTdr%02d", lay);
240 m_htdr[lay] = new TH1F(hname, "", 510, -10, 500);
241 m_fdTime -> Add(m_htdr[lay]);
242
243 for(int lr=0; lr<2; lr++){
244 sprintf(hname, "mTdr%02d_lr%01d", lay, lr);
245 m_htdrlr[lay][lr] = new TH1F(hname, "", 510, -10, 500);
246 m_fdTime -> Add(m_htdrlr[lay][lr]);
247 }
248 }
249
250 // histograms for resolution
251 m_fdres = new TFolder("mresolution", "resolution");
252 hlist -> Add(m_fdres);
253
254 for(int lay=0; lay<NLAYER; lay++){
255 sprintf(hname, "mReso%02dInc", lay);
256 m_hresInc[lay] = new TH1F(hname, "", 1000, -5, 5);
257 m_fdres -> Add(m_hresInc[lay]);
258
259 sprintf(hname, "mReso%02dExc", lay);
260 m_hresExc[lay] = new TH1F(hname, "", 1000, -5, 5);
261 m_fdres -> Add(m_hresExc[lay]);
262
263 for (int lr=0; lr<2; lr++){
264 sprintf(hname, "mReso%02dInc_lr%01d", lay, lr);
265 m_hreslrInc[lay][lr] = new TH1F(hname, "", 1000, -5, 5);
266 m_fdres->Add(m_hreslrInc[lay][lr]);
267
268 sprintf(hname, "mReso%02dExc_lr%01d", lay, lr);
269 m_hreslrExc[lay][lr] = new TH1F(hname, "", 1000, -5, 5);
270 m_fdres->Add(m_hreslrExc[lay][lr]);
271 }
272 }
273
274 /* histograms for momentum vs phi */
275 m_fdmomPhi = new TFolder("mmomPhi", "momPhi");
276 hlist -> Add(m_fdmomPhi);
277
278 int thbin;
279 for(int bin=0; bin<NPhiBin; bin++){
280 sprintf(hname, "mhPpos_phi%02d", bin);
281 m_ppPhi[bin] = new TH1F(hname, "", 400, 1.0, 2.5);
282 m_fdmomPhi->Add(m_ppPhi[bin]);
283
284 sprintf(hname, "mhPneg_phi%02d", bin);
285 m_pnPhi[bin] = new TH1F(hname, "", 400, 1.0, 2.5);
286 m_fdmomPhi->Add(m_pnPhi[bin]);
287
288 sprintf(hname, "mhPpos_phi_cms%02d", bin);
289 m_ppPhiCms[bin] = new TH1F(hname, "", 400, 1.0, 2.5);
290 m_fdmomPhi->Add(m_ppPhiCms[bin]);
291
292 sprintf(hname, "mhPneg_phi_cms%02d", bin);
293 m_pnPhiCms[bin] = new TH1F(hname, "", 400, 1.0, 2.5);
294 m_fdmomPhi->Add(m_pnPhiCms[bin]);
295
296 for(thbin=0; thbin<NThetaBin; thbin++){
297 sprintf(hname, "mhPpos_theta%02d_phi%02d", thbin, bin);
298 m_ppThePhi[thbin][bin] = new TH1F(hname, "", 400, 1.0, 2.5);
299 m_fdmomPhi->Add(m_ppThePhi[thbin][bin]);
300
301 sprintf(hname, "mhPneg_theta%02d_phi%02d", thbin, bin);
302 m_pnThePhi[thbin][bin] = new TH1F(hname, "", 400, 1.0, 2.5);
303 m_fdmomPhi->Add(m_pnThePhi[thbin][bin]);
304
305 sprintf(hname, "mhPposCms_theta%02d_phi%02d", thbin, bin);
306 m_ppThePhiCms[thbin][bin] = new TH1F(hname, "", 400, 1.0, 2.5);
307 m_fdmomPhi->Add(m_ppThePhiCms[thbin][bin]);
308
309 sprintf(hname, "mhPnegCms_theta%02d_phi%02d", thbin, bin);
310 m_pnThePhiCms[thbin][bin] = new TH1F(hname, "", 400, 1.0, 2.5);
311 m_fdmomPhi->Add(m_pnThePhiCms[thbin][bin]);
312 }
313 }
314 for(thbin=0; thbin<NThetaBin; thbin++){
315 sprintf(hname, "mhPpos_the%02d", thbin);
316 m_ppThe[thbin] = new TH1F(hname, "", 400, 1.0, 2.5);
317 m_fdmomPhi->Add(m_ppThe[thbin]);
318
319 sprintf(hname, "mhPneg_the%02d", thbin);
320 m_pnThe[thbin] = new TH1F(hname, "", 400, 1.0, 2.5);
321 m_fdmomPhi->Add(m_pnThe[thbin]);
322
323 sprintf(hname, "mhPposCms_the%02d", thbin);
324 m_ppTheCms[thbin] = new TH1F(hname, "", 400, 1.0, 2.5);
325 m_fdmomPhi->Add(m_ppTheCms[thbin]);
326
327 sprintf(hname, "mhPnegCms_the%02d", thbin);
328 m_pnTheCms[thbin] = new TH1F(hname, "", 400, 1.0, 2.5);
329 m_fdmomPhi->Add(m_pnTheCms[thbin]);
330 }
331
332 m_fdr2d = new TFolder("mres2d", "res2d");
333 hlist -> Add(m_fdr2d);
334 for(int lay=0; lay<43; lay++){
335 for(int iEntr=0; iEntr<gNEntr[lay]; iEntr++){
336 for(int lr=0; lr<2; lr++){
337 for(int bin=0; bin<NSDBIN; bin++){
338 sprintf(hname, "mR2d%02d_%02d_%01d_%02dInc", lay, iEntr, lr, bin);
339 m_hr2dInc[lay][iEntr][lr][bin] = new TH1F(hname, "", 200, -1, 1);
340 m_fdr2d -> Add(m_hr2dInc[lay][iEntr][lr][bin]);
341
342 sprintf(hname, "mR2d%02d_%02d_%01d_%02dExc", lay, iEntr, lr, bin);
343 m_hr2dExc[lay][iEntr][lr][bin] = new TH1F(hname, "", 200, -1, 1);
344 m_fdr2d -> Add(m_hr2dExc[lay][iEntr][lr][bin]);
345 }
346 }
347 }
348 }
349
350// m_fdr2t = new TFolder("mres2t", "res2t");
351// hlist -> Add(m_fdr2t);
352// for(int lay=0; lay<43; lay++){
353// for(int iEntr=0; iEntr<18; iEntr++){
354// for(int lr=0; lr<2; lr++){
355// for(int bin=0; bin<45; bin++){
356// sprintf(hname, "mr2t%02d_%02d_%01d_%02d", lay, iEntr, lr, bin);
357// m_hr2t[lay][iEntr][lr][bin] = new TH1F(hname, "", 600, -3, 3);
358// m_fdr2t -> Add(m_hr2t[lay][iEntr][lr][bin]);
359// }
360// }
361// }
362// }
363}

Referenced by GrXtCalib::init(), QtCalib::init(), T0Calib::init(), XtCalib::init(), XtInteCalib::init(), and main().

◆ mergeHist()

void CalibBase::mergeHist ( TFile *  fhist)
pure virtual

Implemented in GrXtCalib, IniCalib, PreT0Calib, PreXtCalib, QtCalib, T0Calib, XtCalib, and XtInteCalib.

Definition at line 365 of file CalibBase.cpp.

365 {
366 char hname[200];
367 TH1F* hist;
368 TFolder* fdcom = (TFolder*)fhist->Get("common");
369 TFolder* fdResQ = (TFolder*)fhist->Get("ResQ");
370 TFolder* fdTime = (TFolder*)fhist->Get("time");
371 TFolder* fdres = (TFolder*)fhist->Get("resolution");
372 TFolder* fdmomPhi = (TFolder*)fhist->Get("momPhi");
373 TFolder* fdres2d = (TFolder*)fhist->Get("res2d");
374
375 hist = (TH1F*)fdcom->FindObjectAny("effNtrk");
376 m_effNtrk->Add(hist);
377
378 hist = (TH1F*)fdcom->FindObjectAny("effNtrkRecHit");
379 m_effNtrkRecHit->Add(hist);
380
381 hist = (TH1F*)fdcom->FindObjectAny("HResAllInc");
382 m_hresAllInc->Add(hist);
383
384 hist = (TH1F*)fdcom->FindObjectAny("HResAllExc");
385 m_hresAllExc->Add(hist);
386
387 hist = (TH1F*)fdcom->FindObjectAny("HResAllAve");
388 m_hresAllAve->Add(hist);
389
390 hist = (TH1F*)fdcom->FindObjectAny("HResInnInc");
391 m_hresInnInc->Add(hist);
392
393 hist = (TH1F*)fdcom->FindObjectAny("HResInnExc");
394 m_hresInnExc->Add(hist);
395
396 hist = (TH1F*)fdcom->FindObjectAny("HResStpInc");
397 m_hresStpInc->Add(hist);
398
399 hist = (TH1F*)fdcom->FindObjectAny("HResStpExc");
400 m_hresStpExc->Add(hist);
401
402 hist = (TH1F*)fdcom->FindObjectAny("HResOutInc");
403 m_hresOutInc->Add(hist);
404
405 hist = (TH1F*)fdcom->FindObjectAny("HResOutExc");
406 m_hresOutExc->Add(hist);
407
408 hist = (TH1F*)fdcom->FindObjectAny("BbTrkFlg");
409 m_hbbTrkFlg->Add(hist);
410
411 hist = (TH1F*)fdcom->FindObjectAny("TesAll");
412 m_hTesAll->Add(hist);
413
414 hist = (TH1F*)fdcom->FindObjectAny("TesGood");
415 m_hTesGood->Add(hist);
416
417 hist = (TH1F*)fdcom->FindObjectAny("TesAllFlag");
418 m_hTesAllFlag->Add(hist);
419
420 hist = (TH1F*)fdcom->FindObjectAny("TesRec");
421 m_hTesRec->Add(hist);
422
423 hist = (TH1F*)fdcom->FindObjectAny("TesCalFlag");
424 m_hTesCalFlag->Add(hist);
425
426 hist = (TH1F*)fdcom->FindObjectAny("TesCalUse");
427 m_hTesCalUse->Add(hist);
428
429 hist = (TH1F*)fdcom->FindObjectAny("nRawHit");
430 m_hnRawHit->Add(hist);
431
432 hist = (TH1F*)fdcom->FindObjectAny("HPt");
433 m_hpt->Add(hist);
434
435 hist = (TH1F*)fdcom->FindObjectAny("HPtPos");
436 m_hptPos->Add(hist);
437
438 hist = (TH1F*)fdcom->FindObjectAny("HPtNeg");
439 m_hptNeg->Add(hist);
440
441 hist = (TH1F*)fdcom->FindObjectAny("HP");
442 m_hp->Add(hist);
443
444 hist = (TH1F*)fdcom->FindObjectAny("HPCMS");
445 m_hp_cms->Add(hist);
446
447 hist = (TH1F*)fdcom->FindObjectAny("HPMax");
448 m_hpMax->Add(hist);
449
450 hist = (TH1F*)fdcom->FindObjectAny("HPMax_Cms");
451 m_hpMaxCms->Add(hist);
452
453 hist = (TH1F*)fdcom->FindObjectAny("HP_Pos");
454 m_hpPos->Add(hist);
455
456 hist = (TH1F*)fdcom->FindObjectAny("HP_Neg");
457 m_hpNeg->Add(hist);
458
459 hist = (TH1F*)fdcom->FindObjectAny("HP_Pos_cms");
460 m_hpPoscms->Add(hist);
461
462 hist = (TH1F*)fdcom->FindObjectAny("HP_Neg_cms");
463 m_hpNegcms->Add(hist);
464
465 hist = (TH1F*)fdcom->FindObjectAny("HPCut");
466 m_hp_cut->Add(hist);
467
468 hist = (TH1F*)fdcom->FindObjectAny("Chisq");
469 m_hchisq->Add(hist);
470
471 hist = (TH1F*)fdcom->FindObjectAny("HNtrack");
472 m_hnTrk->Add(hist);
473
474 hist = (TH1F*)fdcom->FindObjectAny("HNtrackCal");
475 m_hnTrkCal->Add(hist);
476
477 hist = (TH1F*)fdcom->FindObjectAny("HNhitsRec");
478 m_hnhitsRec->Add(hist);
479
480 hist = (TH1F*)fdcom->FindObjectAny("HNhitsInnRec");
481 m_hnhitsRecInn->Add(hist);
482
483 hist = (TH1F*)fdcom->FindObjectAny("HNhitsStpRec");
484 m_hnhitsRecStp->Add(hist);
485
486 hist = (TH1F*)fdcom->FindObjectAny("HNhitsOutRec");
487 m_hnhitsRecOut->Add(hist);
488
489 hist = (TH1F*)fdcom->FindObjectAny("HNhitsCal");
490 m_hnhitsCal->Add(hist);
491
492 hist = (TH1F*)fdcom->FindObjectAny("HNhitsCalInn");
493 m_hnhitsCalInn->Add(hist);
494
495 hist = (TH1F*)fdcom->FindObjectAny("HNhitsCalStp");
496 m_hnhitsCalStp->Add(hist);
497
498 hist = (TH1F*)fdcom->FindObjectAny("HNhitsCalOut");
499 m_hnhitsCalOut->Add(hist);
500
501 hist = (TH1F*)fdcom->FindObjectAny("Wire_HitMap");
502 m_wirehitmap->Add(hist);
503
504 hist = (TH1F*)fdcom->FindObjectAny("Layer_HitMap");
505 m_layerhitmap->Add(hist);
506
507 hist = (TH1F*)fdcom->FindObjectAny("phi_noise");
508 m_hnoisephi->Add(hist);
509
510 hist = (TH1F*)fdcom->FindObjectAny("Layer_noise");
511 m_hnoiselay->Add(hist);
512
513 hist = (TH1F*)fdcom->FindObjectAny("nhits_noise");
514 m_hnoisenhits->Add(hist);
515
516 hist = (TH1F*)fdcom->FindObjectAny("ratio");
517 m_hratio->Add(hist);
518
519 hist = (TH1F*)fdcom->FindObjectAny("dr");
520 m_hdr->Add(hist);
521
522 hist = (TH1F*)fdcom->FindObjectAny("phi0");
523 m_hphi0->Add(hist);
524
525 hist = (TH1F*)fdcom->FindObjectAny("kappa");
526 m_hkap->Add(hist);
527
528 hist = (TH1F*)fdcom->FindObjectAny("dz");
529 m_hdz->Add(hist);
530
531 hist = (TH1F*)fdcom->FindObjectAny("tanl");
532 m_htanl->Add(hist);
533
534 hist = (TH1F*)fdcom->FindObjectAny("costheta");
535 m_hcosthe->Add(hist);
536
537 hist = (TH1F*)fdcom->FindObjectAny("costhetaNeg");
538 m_hcostheNeg->Add(hist);
539
540 hist = (TH1F*)fdcom->FindObjectAny("costhetaPos");
541 m_hcosthePos->Add(hist);
542
543 hist = (TH1F*)fdcom->FindObjectAny("x0");
544 m_hx0->Add(hist);
545
546 hist = (TH1F*)fdcom->FindObjectAny("y0");
547 m_hy0->Add(hist);
548
549 hist = (TH1F*)fdcom->FindObjectAny("delta_z0");
550 m_hdelZ0->Add(hist);
551
552 hist = (TH1F*)fdcom->FindObjectAny("hitEffAll");
553 m_hitEffAll->Add(hist);
554
555 hist = (TH1F*)fdcom->FindObjectAny("hitEffRaw");
556 m_hitEffRaw->Add(hist);
557
558 hist = (TH1F*)fdcom->FindObjectAny("hitEffRec");
559 m_hitEffRec->Add(hist);
560
561 TGraph* gr = (TGraph*)fdcom->FindObjectAny("x0y0");
562 int np = gr->GetN();
563 double xx;
564 double yy;
565 for(int i=0; i<np; i++){
566 gr->GetPoint(i, xx, yy);
567 m_grX0Y0->SetPoint(m_nGrPoint, xx, yy);
568 m_nGrPoint++;
569 }
570
571
572 for(int i=0; i<14; i++){
573 sprintf(hname, "resoAll_qbin%02d", i);
574 hist = (TH1F*)fdResQ->FindObjectAny(hname);
575 m_hresAveAllQ[i]->Add(hist);
576
577 sprintf(hname, "resoOut_qbin%02d", i);
578 hist = (TH1F*)fdResQ->FindObjectAny(hname);
579 m_hresAveOutQ[i]->Add(hist);
580 }
581
582 for(int lay=0; lay<43; lay++){
583 for(int i=0; i<14; i++){
584 sprintf(hname, "resoLay%02d_qbin%02d", lay, i);
585 hist = (TH1F*)fdResQ->FindObjectAny(hname);
586 m_hresAveLayQ[lay][i]->Add(hist);
587 }
588 }
589
590 for(int lay=0; lay<NLAYER; lay++){
591 sprintf(hname, "Traw%02d", lay);
592 hist = (TH1F*)fdTime->FindObjectAny(hname);
593 m_htraw[lay]->Add(hist);
594
595 sprintf(hname, "Tdr%02d", lay);
596 hist = (TH1F*)fdTime->FindObjectAny(hname);
597 m_htdr[lay]->Add(hist);
598
599 for(int lr=0; lr<2; lr++){
600 sprintf(hname, "Tdr%02d_lr%01d", lay, lr);
601 hist = (TH1F*)fdTime->FindObjectAny(hname);
602 m_htdrlr[lay][lr]->Add(hist);
603 }
604 }
605
606 for(int lay=0; lay<NLAYER; lay++){
607 sprintf(hname, "Reso%02dInc", lay);
608 hist = (TH1F*)fdres->FindObjectAny(hname);
609 m_hresInc[lay]->Add(hist);
610
611 sprintf(hname, "Reso%02dExc", lay);
612 hist = (TH1F*)fdres->FindObjectAny(hname);
613 m_hresExc[lay]->Add(hist);
614
615 for (int lr=0; lr<2; lr++){
616 sprintf(hname, "Reso%02dInc_lr%01d", lay, lr);
617 hist = (TH1F*)fdres->FindObjectAny(hname);
618 m_hreslrInc[lay][lr]->Add(hist);
619
620 sprintf(hname, "Reso%02dExc_lr%01d", lay, lr);
621 hist = (TH1F*)fdres->FindObjectAny(hname);
622 m_hreslrExc[lay][lr]->Add(hist);
623 }
624 }
625
626 int thbin;
627 for(int bin=0; bin<NPhiBin; bin++){
628 sprintf(hname, "hPpos_phi%02d", bin);
629 hist = (TH1F*)fdmomPhi->FindObjectAny(hname);
630 m_ppPhi[bin]->Add(hist);
631
632 sprintf(hname, "hPneg_phi%02d", bin);
633 hist = (TH1F*)fdmomPhi->FindObjectAny(hname);
634 m_pnPhi[bin]->Add(hist);
635
636 sprintf(hname, "hPpos_phi_cms%02d", bin);
637 hist = (TH1F*)fdmomPhi->FindObjectAny(hname);
638 m_ppPhiCms[bin]->Add(hist);
639
640 sprintf(hname, "hPneg_phi_cms%02d", bin);
641 hist = (TH1F*)fdmomPhi->FindObjectAny(hname);
642 m_pnPhiCms[bin]->Add(hist);
643
644 for(thbin=0; thbin<NThetaBin; thbin++){
645 sprintf(hname, "hPpos_theta%02d_phi%02d", thbin, bin);
646 hist = (TH1F*)fdmomPhi->FindObjectAny(hname);
647 m_ppThePhi[thbin][bin]->Add(hist);
648
649 sprintf(hname, "hPneg_theta%02d_phi%02d", thbin, bin);
650 hist = (TH1F*)fdmomPhi->FindObjectAny(hname);
651 m_pnThePhi[thbin][bin]->Add(hist);
652
653 sprintf(hname, "hPposCms_theta%02d_phi%02d", thbin, bin);
654 hist = (TH1F*)fdmomPhi->FindObjectAny(hname);
655 m_ppThePhiCms[thbin][bin]->Add(hist);
656
657 sprintf(hname, "hPnegCms_theta%02d_phi%02d", thbin, bin);
658 hist = (TH1F*)fdmomPhi->FindObjectAny(hname);
659 m_pnThePhiCms[thbin][bin]->Add(hist);
660 }
661 }
662
663 for(thbin=0; thbin<NThetaBin; thbin++){
664 sprintf(hname, "hPpos_the%02d", thbin);
665 hist = (TH1F*)fdmomPhi->FindObjectAny(hname);
666 m_ppThe[thbin]->Add(hist);
667
668 sprintf(hname, "hPneg_the%02d", thbin);
669 hist = (TH1F*)fdmomPhi->FindObjectAny(hname);
670 m_ppThe[thbin]->Add(hist);
671
672 sprintf(hname, "hPposCms_the%02d", thbin);
673 hist = (TH1F*)fdmomPhi->FindObjectAny(hname);
674 m_ppTheCms[thbin]->Add(hist);
675
676 sprintf(hname, "hPnegCms_the%02d", thbin);
677 hist = (TH1F*)fdmomPhi->FindObjectAny(hname);
678 m_pnTheCms[thbin]->Add(hist);
679 }
680
681 for(int lay=0; lay<43; lay++){
682 for(int iEntr=0; iEntr<gNEntr[lay]; iEntr++){
683 for(int lr=0; lr<2; lr++){
684 for(int bin=0; bin<NSDBIN; bin++){
685 sprintf(hname, "r2d%02d_%02d_%01d_%02dInc", lay, iEntr, lr, bin);
686 hist = (TH1F*)fdres2d->FindObjectAny(hname);
687 m_hr2dInc[lay][iEntr][lr][bin]->Add(hist);
688
689 sprintf(hname, "r2d%02d_%02d_%01d_%02dExc", lay, iEntr, lr, bin);
690 hist = (TH1F*)fdres2d->FindObjectAny(hname);
691 m_hr2dExc[lay][iEntr][lr][bin]->Add(hist);
692 }
693 }
694 }
695 }
696
697// TFolder* fdres2t = (TFolder*)fhist->Get("res2t");
698// for(int lay=0; lay<43; lay++){
699// for(int iEntr=0; iEntr<18; iEntr++){
700// for(int lr=0; lr<2; lr++){
701// for(int bin=0; bin<45; bin++){
702// sprintf(hname, "r2t%02d_%02d_%01d_%02d", lay, iEntr, lr, bin);
703// hist = (TH1F*)fdres2t->FindObjectAny(hname);
704// m_hr2t[lay][iEntr][lr][bin]->Add(hist);
705// }
706// }
707// }
708// }
709}
TGraph * gr

Referenced by main(), GrXtCalib::mergeHist(), QtCalib::mergeHist(), T0Calib::mergeHist(), XtCalib::mergeHist(), and XtInteCalib::mergeHist().


The documentation for this class was generated from the following files: