]>
Commit | Line | Data |
---|---|---|
04236e67 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
15 | ||
16 | ||
17 | /* $Id$ */ | |
18 | ||
19 | //--- | |
20 | // Produces the data needed to calculate the quality assurance. | |
1d7681da | 21 | // Alla.Maevskaya@cern.ch |
04236e67 | 22 | //--- |
23 | ||
24 | // --- ROOT system --- | |
25 | #include <TClonesArray.h> | |
26 | #include <TFile.h> | |
27 | #include <TH1F.h> | |
1d7681da | 28 | #include <TH2F.h> |
04236e67 | 29 | #include <TDirectory.h> |
02d51eff | 30 | #include <TMath.h> |
04236e67 | 31 | // --- Standard library --- |
32 | ||
33 | // --- AliRoot header files --- | |
34 | #include "AliESDEvent.h" | |
35 | #include "AliLog.h" | |
36 | #include "AliT0digit.h" | |
37 | #include "AliT0hit.h" | |
38 | #include "AliT0RecPoint.h" | |
39 | #include "AliT0QADataMakerRec.h" | |
40 | #include "AliQAChecker.h" | |
41 | #include "AliT0RawReader.h" | |
332b9234 | 42 | #include "AliT0RecoParam.h" |
703bbd47 | 43 | #include "THnSparse.h" |
04236e67 | 44 | |
1d7681da | 45 | #include "Riostream.h" |
04236e67 | 46 | ClassImp(AliT0QADataMakerRec) |
47 | ||
48 | //____________________________________________________________________________ | |
49 | AliT0QADataMakerRec::AliT0QADataMakerRec() : | |
4e25ac79 | 50 | AliQADataMakerRec(AliQAv1::GetDetName(AliQAv1::kT0), |
92664bc8 | 51 | "T0 Quality Assurance Data Maker") |
52 | // fnEventCal(0), | |
53 | // fnEventPhys(0) | |
04236e67 | 54 | { |
55 | // ctor | |
92664bc8 | 56 | // RS: There is some inconsistency here: the separation of physics and calib. events/histos is done by |
57 | // fEventSpecie. Why do we book separate histos on different slots for calib and physics ? | |
58 | // I am changing this in such way that we don't need local counters like fNumTriggers (the corresponding | |
59 | // histos now incremented in the MakeRaws, and for the normalization I will use the framework's counters | |
60 | // AliQADataMaker::GetEvCountCycle(...), AliQADataMaker::GetEvCountTotal(...) | |
61 | // All these fTrEff.. feff.. will by directly filled in corresponding histos | |
62 | /* | |
1d7681da | 63 | for (Int_t i=0; i<6; i++) { |
64 | fNumTriggers[i]=0; | |
65 | fNumTriggersCal[i]=0; | |
332b9234 | 66 | fTrEffCal[i] = 0; |
67 | fTrEffPhys[i] = 0; | |
68 | ||
04236e67 | 69 | } |
f542cc56 | 70 | for (Int_t i=0; i<24; i++) { |
b9024d69 | 71 | feffC[i]=0; |
72 | feffA[i]=0; | |
394c1a6d | 73 | feffqtc[i]=0; |
be3ada9f | 74 | feffPhysC[i]=0; |
f7350425 | 75 | feffPhysA[i]=0; |
76 | feffqtcPhys[i]=0; | |
f542cc56 | 77 | fMeans[i]=2500; |
78 | } | |
92664bc8 | 79 | */ |
f542cc56 | 80 | for(Int_t i=0; i<24; i++) fMeans[i]=2500; |
02d51eff | 81 | // for(Int_t ic=0; ic<24; ic++) |
faca085d | 82 | // fMeans[ic] = new TH1F(Form("CFD1minCFD%d",ic+1),"CFD-CFD",100,-250,250); |
04236e67 | 83 | } |
84 | ||
f7350425 | 85 | |
04236e67 | 86 | //____________________________________________________________________________ |
87 | AliT0QADataMakerRec::AliT0QADataMakerRec(const AliT0QADataMakerRec& qadm) : | |
92664bc8 | 88 | AliQADataMakerRec() |
89 | // fnEventCal(0), | |
90 | // fnEventPhys(0) | |
04236e67 | 91 | { |
92 | //copy ctor | |
1d7681da | 93 | SetName((const char*)qadm.GetName()) ; |
04236e67 | 94 | SetTitle((const char*)qadm.GetTitle()); |
95 | } | |
96 | ||
97 | //__________________________________________________________________ | |
98 | AliT0QADataMakerRec& AliT0QADataMakerRec::operator = (const AliT0QADataMakerRec& qadm ) | |
99 | { | |
100 | // Equal operator. | |
101 | this->~AliT0QADataMakerRec(); | |
102 | new(this) AliT0QADataMakerRec(qadm); | |
103 | return *this; | |
104 | } | |
59f47540 | 105 | //__________________________________________________________________ |
106 | AliT0QADataMakerRec::~AliT0QADataMakerRec() | |
107 | { | |
108 | //destructor | |
59f47540 | 109 | } |
04236e67 | 110 | //____________________________________________________________________________ |
4e25ac79 | 111 | void AliT0QADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray ** list) |
92664bc8 | 112 | { |
113 | //Detector specific actions at end of cycle | |
114 | // do the QA checking | |
115 | AliInfo(Form("Task: %d",task)); | |
116 | ResetEventTrigClasses(); | |
117 | AliQAChecker::Instance()->Run(AliQAv1::kT0, task, list) ; | |
118 | // const Char_t *triggers[6] = {"mean", "vertex","ORA","ORC","central","semi-central"}; | |
119 | // | |
120 | TH1* htmp = 0; | |
121 | for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { | |
122 | // | |
123 | // RS: There is some inconsistency here: the separation of physics and calib. events/histos is done by | |
124 | // fEventSpecie. Why do we book separate histos on different slots for calib and physics ? | |
125 | // I am changing this in such way that we don't need local counters like fNumTriggers (the corresponding | |
126 | // histos now incremented in the MakeRaws, and for the normalization I will use the framework's counters | |
127 | // AliQADataMaker::GetEvCountCycle(...), AliQADataMaker::GetEvCountTotal(...) | |
128 | // | |
129 | // I think the histos xx+250 should be suppressed (the xx calib histos of specie==calibration will be | |
130 | // used automatically) | |
131 | // | |
132 | if (! IsValidEventSpecie(specie, list)) continue; | |
133 | SetEventSpecie(AliRecoParam::ConvertIndex(specie)); | |
134 | // | |
135 | for (int itc=-1;itc<GetNTrigClasses();itc++) { // RS: loop over eventual clones per trigger class | |
136 | // | |
137 | if ( task == AliQAv1::kRAWS ) { | |
138 | // | |
139 | float nEvent = GetEvCountCycleRaws(itc); // counted events for given trigger class | |
140 | if (nEvent>0) { | |
141 | if ( (htmp=GetRawsData(169,itc)) ) htmp->Scale(1./nEvent); // RS | |
142 | if ( (htmp=GetRawsData(169+250,itc)) ) htmp->Scale(1./nEvent); // RS I think this should be removed!!! | |
143 | // | |
144 | if ( (htmp=GetRawsData(207+250,itc)) ) htmp->Scale(1./nEvent); // RS // former feffC count. Remove? | |
145 | if ( (htmp=GetRawsData(207,itc)) ) htmp->Scale(1./nEvent); // RS // former feffPhysC count. | |
146 | ||
147 | if ( (htmp=GetRawsData(208+250,itc)) ) htmp->Scale(1./nEvent); // RS // former feffA count. Remove? | |
148 | if ( (htmp=GetRawsData(209+250,itc)) ) htmp->Scale(1./nEvent); // RS // former feffqtc count. | |
149 | // | |
150 | } | |
151 | } // kRAWS | |
152 | } // RS: loop over eventual clones per trigger class | |
153 | } // loop over species | |
154 | // | |
155 | } | |
156 | ||
157 | /* | |
158 | // RS Old version using custom cunters | |
159 | void AliT0QADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray ** list) | |
04236e67 | 160 | { |
161 | //Detector specific actions at end of cycle | |
162 | // do the QA checking | |
4e25ac79 | 163 | AliQAChecker::Instance()->Run(AliQAv1::kT0, task, list) ; |
8825d145 | 164 | |
57acd2d2 | 165 | for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { |
6252ceeb | 166 | if (! IsValidEventSpecie(specie, list)) |
eca4fa66 | 167 | continue ; |
8825d145 | 168 | SetEventSpecie(AliRecoParam::ConvertIndex(specie)) ; |
4e25ac79 | 169 | if ( task == AliQAv1::kRAWS ) { |
332b9234 | 170 | GetRawsData(0)->SetLabelSize(0.02); |
57acd2d2 | 171 | const Char_t *triggers[6] = {"mean", "vertex","ORA","ORC","central","semi-central"}; |
172 | for (Int_t itr=0; itr<6; itr++) { | |
332b9234 | 173 | if ( fnEventCal>0) |
174 | fTrEffCal[itr] = Float_t (fNumTriggersCal[itr])/Float_t (fnEventCal); | |
175 | if ( fnEventPhys>0) | |
176 | fTrEffPhys[itr] = Float_t (fNumTriggers[itr])/Float_t (fnEventPhys); | |
177 | ||
59f47540 | 178 | GetRawsData(169+250)->Fill(triggers[itr], fTrEffCal[itr]); |
179 | GetRawsData(169+250)->SetBinContent(itr+1, fTrEffCal[itr]); | |
be3ada9f | 180 | GetRawsData(169)->Fill(triggers[itr], fTrEffPhys[itr]); |
181 | GetRawsData(169)->SetBinContent(itr+1, fTrEffPhys[itr]); | |
332b9234 | 182 | } |
183 | Float_t effic=0; | |
184 | for(Int_t ik=0; ik<24; ik++) | |
185 | { | |
186 | effic=0; | |
6755a766 | 187 | if ( fnEventCal>0) effic = Float_t(feffC[ik])/Float_t(fnEventCal); |
59f47540 | 188 | GetRawsData(207+250)->SetBinContent(ik+1,effic) ; |
332b9234 | 189 | effic=0; |
6755a766 | 190 | if ( fnEventCal>0) effic = Float_t(feffA[ik])/Float_t(fnEventCal); |
59f47540 | 191 | GetRawsData(208+250)->SetBinContent(ik+1,effic ); |
332b9234 | 192 | effic=0; |
6755a766 | 193 | if ( fnEventCal>0) effic = Float_t(feffqtc[ik])/Float_t(fnEventCal); |
59f47540 | 194 | GetRawsData(209+250)->SetBinContent(ik+1, effic); |
be3ada9f | 195 | |
196 | effic=0; | |
197 | if ( fnEventPhys>0) effic = Float_t(feffPhysC[ik])/Float_t(fnEventPhys); | |
332b9234 | 198 | GetRawsData(207)->SetBinContent(ik+1, effic); |
be3ada9f | 199 | |
92664bc8 | 200 | } |
201 | } | |
57acd2d2 | 202 | } |
8825d145 | 203 | } |
92664bc8 | 204 | |
205 | */ | |
206 | ||
04236e67 | 207 | //____________________________________________________________________________ |
208 | void AliT0QADataMakerRec::StartOfDetectorCycle() | |
209 | { | |
210 | //Detector specific actions at start of cycle | |
211 | ||
212 | } | |
213 | ||
214 | //____________________________________________________________________________ | |
215 | void AliT0QADataMakerRec::InitRaws() | |
216 | { | |
217 | // create Raw histograms in Raw subdir | |
7d297381 | 218 | const Bool_t expert = kTRUE ; |
219 | const Bool_t saveCorr = kTRUE ; | |
220 | const Bool_t image = kTRUE ; | |
a46b18e9 | 221 | Float_t low[500]; |
222 | Float_t high[500]; | |
92664bc8 | 223 | //triggers |
224 | const Char_t *triggers[6] = {"mean", "vertex","ORA","ORC","central","semi-central"}; | |
225 | ||
7d297381 | 226 | |
a46b18e9 | 227 | for (Int_t i=0; i<500; i++){ |
703bbd47 | 228 | low[i] = 0; |
be3ada9f | 229 | high[i] = 30000; |
a46b18e9 | 230 | |
231 | } | |
232 | ||
1d7681da | 233 | TString timename, ampname, qtcname, ledname; |
234 | TString timeCalname, ampCalname, ledCalname, qtcCalname; | |
332b9234 | 235 | TString qt1name, qt0name, qt1Calname, qt0Calname; |
426a778b | 236 | TString nhits; |
04236e67 | 237 | |
be3ada9f | 238 | TH1F* fhRefPoint = new TH1F("hRefPoint","Ref Point", 10000, 0 ,50000); |
92664bc8 | 239 | fhRefPoint->SetLabelSize(0.02); |
8825d145 | 240 | Add2RawsList( fhRefPoint,0, expert, !image, !saveCorr); |
703bbd47 | 241 | |
be3ada9f | 242 | TH1F* fhRefPointcal = new TH1F("hRefPointcal","Ref Point laser", 5000, 0 ,20000); |
243 | Add2RawsList( fhRefPointcal,250, expert, !image, !saveCorr); | |
703bbd47 | 244 | |
245 | TH1F *fhRawCFD[24]; | |
246 | TH1F * fhRawLEDamp[24]; | |
1d7681da | 247 | TH1F *fhRawQTC[24]; TH1F * fhRawLED[24]; |
248 | TH1F *fhRawCFDcal[24]; TH1F * fhRawLEDampcal[24]; | |
be3ada9f | 249 | TH1F *fhRawQTCcal[24]; TH1F * fhRawLEDcal[24]; |
332b9234 | 250 | TH1F *fhRawQT0cal[24]; TH1F *fhRawQT1cal[24]; |
251 | TH1F *fhRawQT1[24]; TH1F *fhRawQT0[24]; | |
426a778b | 252 | TH1F* fhRawNhits[24]; |
703bbd47 | 253 | |
04236e67 | 254 | for (Int_t i=0; i<24; i++) |
255 | { | |
256 | timename ="hRawCFD"; | |
1d7681da | 257 | ledname = "hRawLED"; |
04236e67 | 258 | qtcname = "hRawQTC"; |
332b9234 | 259 | qt0name = "hRawQT0_"; |
260 | qt1name = "hRawQT1_"; | |
1d7681da | 261 | ampname = "hRawLEDminCFD"; |
426a778b | 262 | nhits = "hRawNhits"; |
332b9234 | 263 | timename += i+1; |
264 | ampname += i+1; | |
265 | qtcname += i+1; | |
266 | qt0name += i+1; | |
267 | qt1name += i+1; | |
268 | ledname += i+1; | |
426a778b | 269 | nhits += i+1; |
be3ada9f | 270 | fhRawCFD[i] = new TH1F(timename.Data(), Form("%s;CFD [#channels];Counts", timename.Data()),Int_t((high[i+1]-low[i+1])/4),low[i+1],high[i+1]); |
f542cc56 | 271 | // ForbidCloning(fhRawCFD[i]); //RS I don't know how histos 1-24 should be processed in MakeRaws, for the moment forbidding the cloning |
be3ada9f | 272 | Add2RawsList( fhRawCFD[i],i+1, expert, !image, !saveCorr); |
273 | fhRawLED[i] = new TH1F(ledname.Data(), Form("%s;LED[#channels];Counts", ledname.Data()),Int_t((high[i+25]-low[i+25])/4),low[i+25],high[i+25]); | |
274 | Add2RawsList( fhRawLED[i],i+25, expert, !image, !saveCorr); | |
332b9234 | 275 | fhRawLEDamp[i] = new TH1F(ampname.Data(), Form("%s;LED-CFD [#channels];Counts", ampname.Data()),1000,0,1000); |
be3ada9f | 276 | Add2RawsList( fhRawLEDamp[i],i+49, expert, !image, !saveCorr); |
332b9234 | 277 | fhRawQTC[i] = new TH1F(qtcname.Data(), Form("%s;QTC[#channels];Counts", qtcname.Data()),10000,0,10000); |
be3ada9f | 278 | Add2RawsList( fhRawQTC[i],i+73, expert, !image, !saveCorr); |
279 | fhRawQT1[i] = new TH1F(qt1name.Data(), Form("%s;QT1[#channels];Counts", qt1name.Data()),Int_t((high[97+i]-low[97+i])/4),low[97+i],high[97+i]); | |
280 | Add2RawsList( fhRawQT1[i],97+i, expert, !image, !saveCorr); | |
281 | fhRawQT0[i] = new TH1F(qt0name.Data(), Form("%s;QT0[#channels];Counts", qt0name.Data()),Int_t((high[121+i]-low[121+i])/4),low[121+i],high[121+i]); | |
282 | Add2RawsList( fhRawQT0[i],121+i, expert, !image, !saveCorr); | |
283 | ||
284 | fhRawNhits[i] = new TH1F(nhits.Data(), Form("%s;#Hits;Events", nhits.Data()),20, 0, 20); | |
285 | Add2RawsList( fhRawNhits[i],176+i, expert, !image, !saveCorr); | |
286 | ||
287 | ||
5ed41460 | 288 | timeCalname ="hRawCFDcal"; |
1d7681da | 289 | ledCalname = "hRawLEDcal"; |
290 | ampCalname = "hRawLEDminCFDcal"; | |
5ed41460 | 291 | qtcCalname = "hRawQTCcal"; |
332b9234 | 292 | qt0Calname = "hRawQT0cal"; |
293 | qt1Calname = "hRawQT1cal"; | |
294 | timeCalname += i+1; | |
295 | ledCalname += i+1; | |
296 | ampCalname += i+1; | |
297 | qtcCalname += i+1; | |
298 | qt0Calname += i+1; | |
299 | qt1Calname += i+1; | |
be3ada9f | 300 | fhRawCFDcal[i] = new TH1F(timeCalname.Data(), Form("LASER: %s;Time ;Counts", timeCalname.Data()),Int_t((high[251+i]-low[251+i])/4),low[251+i],high[251+i]); |
301 | Add2RawsList( fhRawCFDcal[i],251+i, expert, !image, !saveCorr); | |
302 | ||
303 | fhRawLEDcal[i] = new TH1F(ledCalname.Data(), Form("LASER: %s;Time ;Counts", ledCalname.Data()),Int_t((high[251+i+24]-low[251+i+24])/4),low[251+i+24],high[251+i+24]); | |
304 | Add2RawsList( fhRawLEDcal[i],251+i+24, expert, !image, !saveCorr); | |
305 | ||
306 | fhRawLEDampcal[i] = new TH1F(ampCalname.Data(), Form("LASER: %s;Amplitude [ADC counts];Counts", ampCalname.Data()),1000,0,1000); | |
307 | Add2RawsList( fhRawLEDampcal[i],251+i+48, expert, !image, !saveCorr); | |
308 | ||
309 | fhRawQTCcal[i] = new TH1F(qtcCalname.Data(), Form("LASER: %s;QTC[#channels]; ;Counts",qtcCalname.Data()),10000,0,10000); | |
310 | Add2RawsList( fhRawQTCcal[i],251+i+72, expert, !image, !saveCorr); | |
311 | ||
312 | fhRawQT0cal[i] = new TH1F(qt0Calname.Data(), Form("LASER: %s;QT0[#channels] ;Counts",qt0Calname.Data()),Int_t((high[251+96+i]-low[251+96+i])/4),low[251+96+i],high[251+96+i]); | |
313 | Add2RawsList( fhRawQT0cal[i],251+96+i, expert, !image, !saveCorr); | |
314 | ||
315 | fhRawQT1cal[i] = new TH1F(qt1Calname.Data(), Form("LASER: %s;QT1[#channels] ;Counts",qt1Calname.Data()),Int_t((high[i+251+120]-low[i+251+120])/4),low[i+251+120],high[i+251+120]); | |
316 | Add2RawsList( fhRawQT1cal[i],i+251+120, expert, !image, !saveCorr); | |
317 | ||
318 | } | |
319 | ||
320 | ||
321 | TH1F* fhRawTrigger = new TH1F("hRawTrigger"," phys triggers;Trigger ;Counts",6,0,6); | |
92664bc8 | 322 | for (Int_t itr=0; itr<6; itr++) fhRawTrigger->Fill(triggers[itr], 0); // RS Modified to allow cloning (no fNumTriggers member anymore) |
323 | ||
be3ada9f | 324 | Add2RawsList(fhRawTrigger ,169, expert, image, !saveCorr); |
325 | ||
326 | TH1F* fhRawMean = new TH1F("hRawMean","online mean signal, physics event;",Int_t((high[170]-low[170])/4),low[170],high[170]); | |
327 | Add2RawsList( fhRawMean,170, expert, !image, !saveCorr); | |
a46b18e9 | 328 | |
be3ada9f | 329 | TH1F* fhRawVertex = new TH1F("hRawVertex","online vertex signal; counts",Int_t((high[171]-low[171])/4),low[171],high[171]); |
330 | Add2RawsList( fhRawVertex,171, expert, image, !saveCorr); | |
1d7681da | 331 | |
be3ada9f | 332 | TH1F* fhRawORA = new TH1F("hRawORA","online OR A; counts",Int_t((high[172]-low[172])/4),low[172],high[172]); |
333 | Add2RawsList( fhRawORA,172, expert, !image, !saveCorr); | |
334 | TH1F* fhRawORC = new TH1F("hRawORC","online OR C;counts",Int_t(( high[173]-low[173])/4),low[173],high[173]); | |
335 | Add2RawsList( fhRawORC,173, expert, !image, !saveCorr); | |
336 | TH1F* fhMultCentr = new TH1F("hMultCentr","online trigger Central;counts ",Int_t(( high[174]-low[174])/4),low[174],high[174]); | |
337 | Add2RawsList( fhMultCentr,174, expert, !image, !saveCorr); | |
338 | TH1F* fhMultSeCentr = new TH1F("hMultSemiCentr","online trigger SemiCentral;counts ",Int_t(( high[175]-low[175])/4),low[175],high[175]); | |
339 | Add2RawsList( fhMultSeCentr,175, expert, !image, !saveCorr); | |
332b9234 | 340 | |
332b9234 | 341 | |
92664bc8 | 342 | TH1F* fhRawTriggerCal = new TH1F("hRawTriggerCal"," laser triggers",6,0,6); // RS Modified to allow cloning (no fNumTriggersCall member anymore) |
343 | for (Int_t itr=0; itr<6; itr++) fhRawTriggerCal->Fill(triggers[itr], 0); | |
213e2f96 | 344 | Add2RawsList(fhRawTriggerCal ,169+250 , !expert, image, !saveCorr); |
be3ada9f | 345 | |
213e2f96 | 346 | TH1F* fhRawMeanCal = new TH1F("hRawMeanCal","online mean signal, calibration event",Int_t((high[170+250]-low[170+250])/4),low[170+250],high[170+250]); |
347 | Add2RawsList( fhRawMeanCal,170+250, expert, !image, !saveCorr); | |
be3ada9f | 348 | |
213e2f96 | 349 | TH1F* fhRawVertexCal = new TH1F("hRawVertexCal","online vertex signal, calibration event ",Int_t((high[171+250]-low[171+250])/4),low[171+250],high[171+250] ); |
350 | Add2RawsList( fhRawVertexCal,171+250, expert, !image, !saveCorr); | |
be3ada9f | 351 | |
352 | ||
213e2f96 | 353 | TH1F* fhRawORAcal = new TH1F("hRawORAcal","laser OR A; counts",Int_t((high[172+250]-low[172+250])/4),low[172+250],high[172+250]); |
354 | Add2RawsList( fhRawORAcal,172+250, expert, !image, !saveCorr ); | |
be3ada9f | 355 | |
356 | ||
357 | TH1F* fhRawORCcal = new TH1F("hRawORCcal","laserOR C;counts ",Int_t(( high[173]-low[173])/4),low[173],high[173]); | |
213e2f96 | 358 | Add2RawsList( fhRawORCcal,173+250, expert, !image, !saveCorr); |
be3ada9f | 359 | |
360 | TH1F* fhMultCentrcal = new TH1F("hMultCentrcal","laser trigger Central;counts ",Int_t(( high[174]-low[174])/4),low[174],high[174]); | |
213e2f96 | 361 | Add2RawsList( fhMultCentrcal,174+250, expert, !image, !saveCorr); |
be3ada9f | 362 | TH1F* fhMultSeCentrcal = new TH1F("hMultSemiCentrcal","laser trigger SemiCentral;counts ",Int_t(( high[175]-low[175])/4),low[175],high[175]); |
213e2f96 | 363 | Add2RawsList( fhMultSeCentrcal,175+250, expert, !image, !saveCorr); |
be3ada9f | 364 | |
332b9234 | 365 | //multiplicity trigger |
be3ada9f | 366 | //side A |
367 | TH1F* fhMultAcal = new TH1F("hMultAcal","laser: full mulltiplicity;Multiplicity A side;Entries",Int_t((high[201]-low[201])/4),low[201],high[201]); | |
213e2f96 | 368 | Add2RawsList( fhMultAcal,201+250, expert, !image, !saveCorr ); |
be3ada9f | 369 | TH1F* fhMultAScal = new TH1F("hMultASemical","laser:full multiplicity with semi-central trigger A side;Multiplicity;Entries", |
370 | Int_t((high[202]-low[202])/4),low[202],high[202] ); | |
213e2f96 | 371 | Add2RawsList( fhMultAScal,202+250, expert, !image, !saveCorr); |
be3ada9f | 372 | TH1F* fhMultACcal = new TH1F("hMultACentrcal","laser:full multiplicity with central trigger A side;Multiplicity;Entries", |
373 | Int_t((high[203]-low[203])/4),low[203],high[203]); | |
213e2f96 | 374 | Add2RawsList( fhMultACcal,203+250, expert, !image, !saveCorr); |
a46b18e9 | 375 | |
be3ada9f | 376 | TH1F* fhMultA = new TH1F("hMultA","full mulltiplicity A side;Multiplicity;Entries", Int_t((high[201]-low[201])/4) ,low[201],high[201]); |
377 | Add2RawsList( fhMultA,201, expert, image, !saveCorr ); | |
378 | ||
379 | TH1F* fhMultAS = new TH1F("hMultASemi","full multiplicity with semi-central trigger A side ;Multiplicity;Entries", | |
380 | Int_t((high[202]-low[202])/4),low[202],high[202] ); | |
381 | Add2RawsList( fhMultAS, 202, expert, !image, !saveCorr); | |
382 | TH1F* fhMultAC = new TH1F("hMultACentr","full multiplicity with central trigger;Multiplicity;Entries", | |
383 | Int_t((high[203]-low[203])/4),low[203],high[203]); | |
384 | Add2RawsList( fhMultAC, 203, expert, !image, !saveCorr); | |
385 | ||
386 | ||
387 | //side C | |
388 | TH1F* fhMultCcal = new TH1F("hMultCcal","laser:full mulltiplicity C side;Multiplicity;Entries",Int_t((high[204]-low[204])/4),low[204],high[204]); | |
213e2f96 | 389 | Add2RawsList( fhMultCcal,204+250, expert, !image, !saveCorr ); |
be3ada9f | 390 | TH1F* fhMultCScal = new TH1F("hMultCSemical","laser:full multiplicity with semi-central trigger C side;Multiplicity;Entries", |
391 | Int_t((high[205]-low[205])/4),low[205],high[205] ); | |
213e2f96 | 392 | Add2RawsList( fhMultCScal,205+250, expert, !image, !saveCorr); |
be3ada9f | 393 | TH1F* fhMultCCcal = new TH1F("hMultCCentrcal","laser:full multiplicity with central trigger C side;Multiplicity;Entries", |
394 | Int_t((high[206]-low[206])/4),low[206],high[206]); | |
213e2f96 | 395 | Add2RawsList( fhMultCCcal,206+250, expert, !image, !saveCorr); |
be3ada9f | 396 | |
d5fa4835 | 397 | TH1F* fhMultC = new TH1F("hMultC","full mulltiplicity C side;Multiplicity;Entries", Int_t(high[204]-low[204]/4) ,low[204],high[204]); |
be3ada9f | 398 | Add2RawsList( fhMultC,204, expert, image, !saveCorr ); |
399 | TH1F* fhMultCS = new TH1F("hMultCSemi","full multiplicity with semi-central trigger C side;Multiplicity;Entries", | |
400 | Int_t((high[205]-low[205])/4),low[205],high[205] ); | |
401 | Add2RawsList( fhMultCS,205, expert, !image, !saveCorr); | |
402 | TH1F* fhMultCC = new TH1F("hMultCentr","full multiplicity with central trigger C side;Multiplicity;Entries", | |
403 | Int_t((high[206]-low[206])/4),low[206],high[206]); | |
404 | Add2RawsList( fhMultCC,206, expert, !image, !saveCorr); | |
405 | ||
406 | ||
407 | //efficiency | |
408 | TH1F* fhEffCFD = new TH1F("hEffCFDcal","CFD efficiecy laser ;#PMT; #CFD counts/nEvents",24, 0 ,24); | |
213e2f96 | 409 | Add2RawsList( fhEffCFD,207+250, !expert, image, !saveCorr); |
be3ada9f | 410 | |
411 | TH1F* fhCFDeffpsys= new TH1F("fhCFDeffpsys"," CFD efficiency; #PMT; #CFD counts/nEvents",24, 0 ,24); | |
412 | // fhCFDeffpsys->SetMaximum(2); | |
413 | Add2RawsList( fhCFDeffpsys, 207, expert, image, !saveCorr); | |
414 | ||
415 | TH1F* fhEffLED = new TH1F("hEffLEDcal","LEDefficiecy; #PMT; #LED counts/nEvent",24, 0 ,24); | |
213e2f96 | 416 | Add2RawsList( fhEffLED,208+250, !expert, image, !saveCorr); |
be3ada9f | 417 | |
418 | TH1F* fhEffQTC = new TH1F("hEffQTCcal","QTC efficiecy; #PMT; QTC efficiency%s;",24, 0 ,24); | |
213e2f96 | 419 | Add2RawsList( fhEffQTC,209+250, !expert, image, !saveCorr); |
be3ada9f | 420 | |
421 | ||
92664bc8 | 422 | TH2F* fhCFD = new TH2F("hCFD","CFD phys; #PMT; CFD {#channnels}",25, 0 ,25,Int_t((high[210]-low[210])/4),low[210],high[210]); |
be3ada9f | 423 | fhCFD->SetOption("COLZ"); |
424 | Add2RawsList( fhCFD,210, expert, image, !saveCorr); | |
425 | ||
426 | TH2F* fhLED = new TH2F("hLED","LED phys; #PMT; LED [#channnels]",25, 0 ,25,Int_t((high[211]-low[211])/4),low[211],high[211]); | |
427 | fhLED->SetOption("COLZ"); | |
428 | Add2RawsList( fhLED,211, expert, image, !saveCorr); | |
a46b18e9 | 429 | |
be3ada9f | 430 | TH2F* fhQTC = new TH2F("hQTC","QTC phys; #PMT; QTC [#channnels]",25, 0 ,25,Int_t( high[212]-low[212]),low[212],high[212]); |
431 | fhQTC->SetOption("COLZ"); | |
432 | Add2RawsList( fhQTC,212, expert, image, !saveCorr); | |
a46b18e9 | 433 | |
be3ada9f | 434 | TH2F* fhCFDcal = new TH2F("hCFDcal","CFD laser; #PMT; CFD {#channnels}",25, 0 ,25,Int_t((high[210]-low[210])/4),low[210],high[210]); |
435 | fhCFDcal->SetOption("COLZ"); | |
213e2f96 | 436 | Add2RawsList( fhCFDcal,210+250, expert, image, !saveCorr); |
be3ada9f | 437 | |
438 | ||
439 | TH2F* fhLEDcal = new TH2F("hLEDcal","LED laser; #PMT; LED [#channnels]",25, 0 ,25,Int_t((high[211]-low[211])/4),low[211],high[211]); | |
394c1a6d | 440 | fhLEDcal->SetOption("COLZ"); |
213e2f96 | 441 | Add2RawsList( fhLEDcal,211+250, expert, image, !saveCorr); |
be3ada9f | 442 | |
443 | TH2F* fhQTCcal = new TH2F("hQTCcal","QTC laser; #PMT; QTC [#channnels]",25, 0 ,25,Int_t( high[212]-low[212]),low[212],high[212]); | |
703bbd47 | 444 | fhQTCcal->SetOption("COLZ"); |
213e2f96 | 445 | Add2RawsList( fhQTCcal,212+250, expert, image, !saveCorr); |
be3ada9f | 446 | |
447 | ||
703bbd47 | 448 | TH1F* fhNumPMTA= new TH1F("hNumPMTA","number of PMT hitted per event",13, 0 ,13); |
be3ada9f | 449 | Add2RawsList(fhNumPMTA ,213, expert, image, !saveCorr); |
450 | ||
703bbd47 | 451 | TH1F* fhNumPMTC= new TH1F("hNumPMTC","number of PMT hitted per event",13, 0 ,13); |
be3ada9f | 452 | Add2RawsList(fhNumPMTC ,214, expert, image, !saveCorr); |
453 | ||
454 | TH1F* fhHitsOrA= new TH1F("fhHitsOrA","T0_OR A hit multiplicitie",20, 0 ,20); | |
455 | Add2RawsList( fhHitsOrA,215, expert, !image, !saveCorr); | |
456 | ||
457 | TH1F* fhHitsOrC= new TH1F("fhHitsOrC","T0_OR C hit multiplicitie",20, 0 ,20); | |
458 | Add2RawsList(fhHitsOrC ,216, expert, !image, !saveCorr); | |
459 | ||
460 | ||
fce2006a | 461 | TH1F* fhOrCminOrA= new TH1F("fhOrCminOrA","T0_OR C - T0_OR A",10000,-5000,5000); |
be3ada9f | 462 | Add2RawsList( fhOrCminOrA,219, expert, !image, !saveCorr); |
463 | ||
fce2006a | 464 | TH1F* fhOrCminOrAcal= new TH1F("fhOrCminOrAcal","T0_OR C - T0_OR A",10000,-5000,5000); |
213e2f96 | 465 | Add2RawsList( fhOrCminOrAcal,219+250, expert, !image, !saveCorr); |
703bbd47 | 466 | |
fce2006a | 467 | TH1F* fhOrCminOrATvdcOn= new TH1F("fhOrCminOrATvdcOn","T0_OR C - T0_OR A TVDC on",10000,-5000,5000); |
be3ada9f | 468 | Add2RawsList( fhOrCminOrATvdcOn,217, expert, !image, !saveCorr); |
469 | ||
fce2006a | 470 | TH1F* fhOrCminOrATvdcOncal= new TH1F("fhOrCminOrATvdcOncal","T0_OR C - T0_OR A TVDC on laser",10000,-5000,5000); |
213e2f96 | 471 | Add2RawsList( fhOrCminOrATvdcOncal,217+250, expert, !image, !saveCorr); |
703bbd47 | 472 | |
fce2006a | 473 | TH1F* fhOrCminOrATvdcOff= new TH1F("fhOrCminOrATvdcOff","T0_OR C - T0_OR A TVDC off",10000,-5000,5000); |
be3ada9f | 474 | Add2RawsList( fhOrCminOrATvdcOff,218, expert, !image, !saveCorr); |
b2acd28d | 475 | |
b2acd28d | 476 | |
be3ada9f | 477 | TH1F* fhOrCminOrATvdcOffcal= new TH1F("fhOrCminOrATvdcOffcal","T0_OR C - T0_OR ATVDC off laser",10000,-5000,5000); |
213e2f96 | 478 | Add2RawsList( fhOrCminOrATvdcOffcal,218+250, expert, !image, !saveCorr); |
02d51eff | 479 | |
faca085d | 480 | //satellite & beam background |
f542cc56 | 481 | TH2F* fhBeam = new TH2F("fhBeam", " Mean vs Vertex ", 120, -30, 30, 120, -30, 30); |
482 | fhBeam->SetOption("COLZ"); | |
483 | fhBeam->GetXaxis()->SetTitle("(T0C-T0A/2, ns"); | |
484 | fhBeam->GetYaxis()->SetTitle("(T0C+T0A/2, ns"); | |
485 | Add2RawsList( fhBeam,220, !expert, image, !saveCorr); | |
486 | TH2F* fhBeamTVDCon = new TH2F("fhBeamTVDCon", " Mean vs Vertex TVDC on ",50, -5, 5, 50, -5, 5) ; | |
487 | fhBeamTVDCon->SetOption("COLZ"); | |
488 | fhBeamTVDCon->GetXaxis()->SetTitle("(T0C-T0A/2, ns"); | |
489 | fhBeamTVDCon->GetYaxis()->SetTitle("(T0C+T0A/2, ns"); | |
02d51eff | 490 | Add2RawsList( fhBeamTVDCon,221, expert, image, !saveCorr); |
f542cc56 | 491 | TH2F* fhBeamTVDCoff = new TH2F("fhBeamTVDCoff", " Mean vs Vertex TVDC off", 120, -30, 30, 120, -30, 30); |
492 | fhBeamTVDCoff->GetXaxis()->SetTitle("(T0C-T0A/2, ns"); | |
493 | fhBeamTVDCoff->GetYaxis()->SetTitle("(T0C+T0A/2, ns"); | |
494 | fhBeamTVDCoff->SetOption("COLZ"); | |
02d51eff | 495 | Add2RawsList( fhBeamTVDCoff,222, expert, image, !saveCorr); |
f542cc56 | 496 | TH1F* fhMean = new TH1F("fhMean", " (T0A+T0C)/2, ns ", 200, -2000, 2000); |
faca085d | 497 | Add2RawsList( fhMean,223, !expert, image, !saveCorr); |
92664bc8 | 498 | // |
f542cc56 | 499 | TH2F* fhBCID = new TH2F("fhBCID", "header BCID vs TRM BC ID ", 500, 0, 5000, 500, 0, 5000); |
500 | fhBCID->SetOption("COLZ"); | |
501 | fhBCID->GetXaxis()->SetTitle("TRM BC ID"); | |
502 | fhBCID->GetYaxis()->SetTitle("event header BC ID"); | |
503 | Add2RawsList(fhBCID ,224, !expert, image, !saveCorr); | |
504 | ||
92664bc8 | 505 | ClonePerTrigClass(AliQAv1::kRAWS); // this should be the last line |
44ed7a66 | 506 | } |
be3ada9f | 507 | |
44ed7a66 | 508 | //____________________________________________________________________________ |
509 | void AliT0QADataMakerRec::InitDigits() | |
510 | { | |
511 | // create Digits histograms in Digits subdir | |
512 | const Bool_t expert = kTRUE ; | |
513 | const Bool_t image = kTRUE ; | |
514 | ||
f628b9d2 | 515 | TH2F * fhDigCFD = new TH2F("fhDigCFD", " CFD digits; #PMT; CFD digits[#channels]",25,-0.5,24.5,100,0,1000); |
eca4fa66 | 516 | fhDigCFD->SetOption("COLZ"); |
f628b9d2 | 517 | Add2DigitsList( fhDigCFD,0, !expert, image); |
518 | TH2F *fhDigLEDamp = new TH2F("fhDigLEDamp", " LED-CFD digits; #PMT; LED-CFD amplitude ",25,-0.5,24.5,100,100,1000); | |
eca4fa66 | 519 | fhDigLEDamp->SetOption("COLZ"); |
394c1a6d | 520 | Add2DigitsList( fhDigLEDamp,1, !expert, !image); |
f628b9d2 | 521 | TH2F * fhDigQTC = new TH2F("fhDigQTC", " QTC digits; #PMT; QTC amplitude",25,-0.5,24.5,100,100,10000); |
eca4fa66 | 522 | fhDigQTC->SetOption("COLZ"); |
b2acd28d | 523 | Add2DigitsList( fhDigQTC,2, !expert, !image); |
92664bc8 | 524 | // |
525 | ClonePerTrigClass(AliQAv1::kDIGITS); // this should be the last line | |
b2acd28d | 526 | } |
04236e67 | 527 | |
528 | //____________________________________________________________________________ | |
529 | ||
530 | void AliT0QADataMakerRec::InitRecPoints() | |
531 | { | |
532 | // create cluster histograms in RecPoint subdir | |
7d297381 | 533 | const Bool_t expert = kTRUE ; |
534 | const Bool_t image = kTRUE ; | |
1d7681da | 535 | |
703bbd47 | 536 | TH2F* fhRecCFD = new TH2F("hRecCFD"," CFD time;#PMT; CFD Time [ns];",24, 0 ,24, |
b9024d69 | 537 | 100,-50,50); |
eca4fa66 | 538 | fhRecCFD->SetOption("COLZ"); |
7d297381 | 539 | Add2RecPointsList ( fhRecCFD,0, !expert, image); |
b9024d69 | 540 | |
703bbd47 | 541 | TH2F* fhRecAmpDiff = new TH2F("hRecAmpDiff"," LED-CFD min QTC amplitude;#PMT; difference [MIPs];", |
b9024d69 | 542 | 24, 0 ,24, 200,-10,10); |
eca4fa66 | 543 | fhRecAmpDiff->SetOption("COLZ"); |
7d297381 | 544 | Add2RecPointsList (fhRecAmpDiff, 1, !expert, image); |
04236e67 | 545 | |
f628b9d2 | 546 | TH1F *fhMean = new TH1F("hMean","online - rec mean;online - rec mean[#channels];",2000, -1000, 1000); |
7d297381 | 547 | Add2RecPointsList ( fhMean,2, !expert, image); |
92664bc8 | 548 | // |
549 | ClonePerTrigClass(AliQAv1::kRECPOINTS); // this should be the last line | |
eca4fa66 | 550 | } |
04236e67 | 551 | |
552 | //____________________________________________________________________________ | |
553 | void AliT0QADataMakerRec::InitESDs() | |
554 | { | |
555 | //create ESDs histograms in ESDs subdir | |
7d297381 | 556 | const Bool_t expert = kTRUE ; |
557 | const Bool_t image = kTRUE ; | |
558 | ||
be3ada9f | 559 | TH1F *fhESDMean = new TH1F("hESDmean"," ESD mean; mean time[%channels]",1000, -5, 5); |
a581ca38 | 560 | Add2ESDsList(fhESDMean, 0, expert, !image) ; |
f628b9d2 | 561 | TH1F * fhESDVertex = new TH1F("hESDvertex","ESDvertex; vertex[cm];",82,-30,30); |
a581ca38 | 562 | Add2ESDsList(fhESDVertex, 1, expert, !image) ; |
c724dd64 | 563 | |
be3ada9f | 564 | TH1F * fhESDResolution = new TH1F("hESDResolution","(T0A-T0C)/2 corrected by SPD vertex; ns",800,-2,2); |
a581ca38 | 565 | Add2ESDsList(fhESDResolution, 2, !expert, image) ; |
92664bc8 | 566 | // |
567 | ClonePerTrigClass(AliQAv1::kESDS); // this should be the last line | |
04236e67 | 568 | } |
569 | ||
570 | //____________________________________________________________________________ | |
571 | void AliT0QADataMakerRec::MakeRaws( AliRawReader* rawReader) | |
572 | { | |
02d51eff | 573 | Int_t time[24] ; |
574 | for(Int_t i=0; i<24; i++) time[i] = 0; | |
9e289a53 | 575 | |
332b9234 | 576 | rawReader->Reset() ; |
04236e67 | 577 | //fills QA histos for RAW |
5ed41460 | 578 | Int_t shift=0; |
45c5ba2d | 579 | // Int_t refPointParam = GetRecoParam()->GetRefPoint(); |
332b9234 | 580 | Int_t refpoint = 0; |
45c5ba2d | 581 | Int_t refPointParam = 0; |
f542cc56 | 582 | |
86c020af | 583 | AliT0RawReader *start = new AliT0RawReader(rawReader); |
332b9234 | 584 | |
f542cc56 | 585 | if (! start->Next()) { |
5379c4a3 | 586 | AliDebug(AliQAv1::GetQADebugLevel(),Form(" no raw data found!!")); |
f542cc56 | 587 | delete start; |
588 | return; | |
589 | } | |
590 | UInt_t type =rawReader->GetType(); | |
591 | if (GetEventSpecie()==AliRecoParam::kCalib && type!=8) { | |
592 | delete start; | |
593 | return; | |
594 | } | |
595 | // | |
596 | // RS: Don't use custom counters, they create problems with trigger cloning | |
597 | // Use instead framework counters, incremented in the end of this routine | |
598 | // RS: There is some inconsistency here: the separation of physics and calib. events/histos is done by | |
599 | // fEventSpecie. Why do we book separate histos on different slots for calib and physics ? | |
600 | // I am changing this in such way that we don't need local counters like fNumTriggers (the corresponding | |
601 | // histos now incremented in the MakeRaws, and for the normalization I will use the framework's counters | |
602 | // AliQADataMaker::GetEvCountCycle(...), AliQADataMaker::GetEvCountTotal(...) | |
603 | // | |
604 | // I think the histos xx+250 should be suppressed (the xx calib histos of specie==calibration will be | |
605 | // used automatically) | |
be3ada9f | 606 | |
f542cc56 | 607 | if (type == 8){ shift=250; /*fnEventCal++;*/} |
608 | if (type == 7){ shift=0; /*fnEventPhys++;*/} | |
609 | // | |
610 | //BC ID | |
611 | if (type == 7){ | |
612 | UInt_t bcid = rawReader->GetBCID(); | |
613 | UInt_t trmbcid = start->GetTRMBunchID(); | |
614 | FillRawsData(224,trmbcid, bcid); | |
615 | } | |
616 | // if (type == 7){ shift=1; fnEventPhys++;} | |
617 | Int_t allData[110][5]; | |
618 | for (Int_t i0=0; i0<110; i0++) | |
619 | { | |
620 | for (Int_t j0=0; j0<5; j0++) allData[i0][j0]=0; | |
621 | } | |
622 | for (Int_t i=0; i<107; i++) | |
623 | for (Int_t iHit=0; iHit<5; iHit++) | |
624 | allData[i][iHit]= start->GetData(i,iHit); | |
92664bc8 | 625 | |
f542cc56 | 626 | if ( allData[0][0] > 0 && (type == 7)) |
627 | FillRawsData(0, allData[0][0]); | |
628 | if ( allData[0][0] > 0 && (type == 8)) | |
629 | FillRawsData(250, allData[0][0]); | |
92664bc8 | 630 | |
f542cc56 | 631 | refpoint = allData[refPointParam][0]; |
632 | if (refPointParam < 0 ) refpoint=0; | |
633 | if (refPointParam == 0 ) refpoint = allData[0][0] - 5000; | |
92664bc8 | 634 | |
f542cc56 | 635 | Int_t sideshift, sideshiftqtc; |
636 | Int_t numPmtC=0; | |
637 | Int_t numPmtA=0; | |
638 | for (Int_t ik = 0; ik<24; ik++) { | |
639 | if(ik<12) { | |
640 | sideshift=1; | |
641 | sideshiftqtc=1; | |
642 | if(allData[ik+sideshift][0]>0 && type == 7 ) numPmtC++; | |
643 | } | |
644 | else { | |
645 | if(allData[ik+45][0]>0 && type == 7 ) numPmtA++; | |
646 | sideshift=45; | |
647 | sideshiftqtc=33; | |
648 | } | |
649 | Int_t nhitsPMT=0; | |
be3ada9f | 650 | |
f542cc56 | 651 | for (Int_t iHt=0; iHt<5; iHt++) { |
652 | //cfd | |
653 | if(allData[ik+sideshift][iHt]>0) { | |
654 | FillRawsData(shift+ik+1, allData[ik+sideshift][iHt]); | |
655 | FillRawsData(210+shift, ik+1, allData[ik+sideshift][iHt]); | |
656 | if(type == 8 ) { // RS I think the type check should be removed | |
657 | //feffC[ik]++; | |
658 | FillRawsData(207+shift,ik,1.); // instead of incrementing former feff's, increment histo directly | |
92664bc8 | 659 | } |
f542cc56 | 660 | AliDebug(50,Form("%i CFD %i data %s",ik, ik+sideshift, GetRawsData(shift+ik+1)->GetName())); |
661 | if(type == 7 ) { // RS I think the type check should be removed | |
662 | nhitsPMT++; | |
663 | // feffPhysC[ik]++; | |
664 | FillRawsData(207 ,ik,1.); // instead of incrementing former feff's, increment histo directly | |
92664bc8 | 665 | } |
92664bc8 | 666 | |
f542cc56 | 667 | } |
668 | //led | |
669 | if(allData[ik+12+sideshift][iHt] > 0) { | |
670 | FillRawsData(shift+ik+24+1,allData[ik+12+sideshift][iHt]); | |
671 | FillRawsData(211+shift,ik+1, allData[ik+12+sideshift][iHt]); | |
672 | AliDebug(50,Form("%i LED %i data %s",ik, ik+12+sideshift, GetRawsData(shift+ik+1+24)->GetName())); | |
673 | if(type == 8 ) { | |
674 | FillRawsData(208+shift,ik,1.); // instead of incrementing former feff's, increment histo directly | |
675 | // feffA[ik]++; | |
213e2f96 | 676 | } |
f542cc56 | 677 | } |
678 | //led -cfd | |
679 | ||
680 | if(allData[ik+12+sideshift][iHt] > 0 && allData[ik+sideshift][iHt] >0 ) | |
681 | FillRawsData(shift+ik+48+1, allData[ik+12+sideshift][iHt]-allData[ik+sideshift][iHt]); | |
682 | ||
683 | //qtc | |
684 | if(allData[2*ik+sideshiftqtc+24][iHt] > 0 && | |
685 | allData[2*ik+sideshiftqtc+25][iHt] > 0) { | |
686 | FillRawsData(shift+ik+72+1, allData[2*ik+sideshiftqtc+24][iHt]-allData[2*ik+sideshiftqtc+25][iHt]); | |
687 | FillRawsData(212+shift,ik+1, allData[2*ik+sideshiftqtc+24][iHt]-allData[2*ik+sideshiftqtc+25][iHt]); | |
688 | if(type == 8) { | |
689 | FillRawsData(209+shift,ik,1.); // instead of incrementing former feff's, increment histo directly | |
690 | // feffqtc[ik]++; | |
be3ada9f | 691 | } |
f542cc56 | 692 | AliDebug(50,Form("%i QTC %i data %s",ik, 2*ik+sideshiftqtc+24, GetRawsData(shift+ik+1+72)->GetName())); |
693 | ||
694 | } | |
695 | if(allData[2*ik+sideshiftqtc+24][iHt] > 0) { | |
696 | AliDebug(50,Form("%i QT0 %i data %s",ik, 2*ik+sideshiftqtc+24, GetRawsData(shift+ik+1+96)->GetName())); | |
697 | FillRawsData(shift+ik+96+1,allData[2*ik+sideshiftqtc+24][iHt]); | |
698 | } | |
699 | if(allData[2*ik+sideshiftqtc+25][iHt] > 0) { | |
700 | AliDebug(50,Form("%i QT0 %i data %s",ik, 2*ik+sideshiftqtc+25, GetRawsData(shift+ik+1+120)->GetName())); | |
701 | FillRawsData(shift+ik+120+1,allData[2*ik+sideshiftqtc+25][iHt]); | |
92664bc8 | 702 | } |
f542cc56 | 703 | } |
92664bc8 | 704 | |
f542cc56 | 705 | if(type == 7 ) { |
706 | FillRawsData(ik+176,nhitsPMT); | |
707 | FillRawsData(213,numPmtC); | |
708 | FillRawsData(214,numPmtA); | |
709 | } | |
710 | } | |
92664bc8 | 711 | |
f542cc56 | 712 | Int_t trChannel[6] = {49,50,51,52,55,56}; |
713 | Float_t ch2cm = 24.4*0.029979; | |
714 | Int_t nhitsOrA=0; | |
715 | Int_t nhitsOrC=0; | |
716 | for (Int_t iHt=0; iHt<5; iHt++) { | |
92664bc8 | 717 | |
f542cc56 | 718 | //orA-orC phys tvdc 1 |
719 | if((allData[51][iHt]>0 && allData[52][iHt]>0) && allData[50][iHt]>0) { | |
720 | AliDebug(10,Form("orA-orC phys tvdc 1 %i data %s", 217+shift, GetRawsData(shift+217)->GetName())); | |
be3ada9f | 721 | |
f542cc56 | 722 | FillRawsData(217+shift,(allData[52][iHt]-allData[51][iHt])*ch2cm); |
723 | // FillRawsData(345,(allData[51][iHt]+allData[52][iHt])/2.); | |
724 | } | |
725 | //orA-orC phys tvdc 0 | |
726 | if((allData[51][iHt]>0 && allData[52][iHt]>0) && allData[50][iHt]<=0) { | |
727 | AliDebug(10,Form("orA-orC phys tvdc 0 %i data %s", 218+shift, GetRawsData(shift+218)->GetName())); | |
92664bc8 | 728 | |
f542cc56 | 729 | FillRawsData(218+shift,(allData[52][iHt]-allData[51][iHt])*ch2cm); |
730 | } | |
731 | if(allData[51][iHt]>0 && allData[52][iHt]>0) { | |
732 | AliDebug(50,Form("orA-orC phys tvdc all %i data %s", 219+shift, GetRawsData(shift+219)->GetName())); | |
733 | FillRawsData(219+shift,(allData[52][iHt]-allData[51][iHt])*ch2cm); | |
734 | } | |
735 | for (Int_t itr=0; itr<6; itr++) { | |
736 | if (allData[trChannel[itr]][iHt] >0) { | |
737 | // | |
738 | // RS instead of incremented custom counters, fill directly the specie-specific histos | |
739 | FillRawsData(169+shift, 0.5+itr, 1.); // RS: increment counters | |
740 | // if(type == 7 )fNumTriggers[itr]++; | |
741 | // if(type == 8 )fNumTriggersCal[itr]++; | |
742 | AliDebug(50,Form(" triggers %i data %s", 170+itr+shift, GetRawsData(170+itr+shift)->GetName())); | |
92664bc8 | 743 | |
f542cc56 | 744 | FillRawsData(170+itr+shift,allData[trChannel[itr]][iHt]); |
be3ada9f | 745 | } |
f542cc56 | 746 | } |
213e2f96 | 747 | |
f542cc56 | 748 | if(type == 7) if(allData[51][iHt] >0) nhitsOrA++; |
749 | if(type == 7) if(allData[52][iHt] >0) nhitsOrC++; | |
92664bc8 | 750 | |
f542cc56 | 751 | //mult trigger signals phys |
752 | //C side | |
753 | if(allData[53][iHt]>0 && allData[54][iHt]>0) { | |
754 | AliDebug(50,Form(" mpdA %i data %s", 201+shift, GetRawsData(201+shift)->GetName())); | |
92664bc8 | 755 | |
f542cc56 | 756 | FillRawsData(201+shift,allData[53][iHt]-allData[54][iHt]); |
757 | if(allData[56][iHt]>0) FillRawsData(202+shift,allData[53][iHt]-allData[54][iHt]); | |
758 | if(allData[55][iHt]>0) FillRawsData(203+shift,allData[53][iHt]-allData[54][iHt]); | |
759 | } | |
92664bc8 | 760 | |
f542cc56 | 761 | //A side |
762 | if(allData[105][iHt]>0 && allData[106][iHt]>0) { | |
763 | AliDebug(50,Form(" mpdC %i data %s", 204+shift, GetRawsData(204+shift)->GetName())); | |
92664bc8 | 764 | |
f542cc56 | 765 | FillRawsData(204+shift,allData[105][iHt]-allData[106][iHt]); |
766 | if(allData[56][iHt]>0) FillRawsData(205+shift,allData[105][iHt]-allData[106][iHt]); | |
767 | if(allData[55][iHt]>0) FillRawsData(206+shift,allData[105][iHt]-allData[106][iHt]); | |
92664bc8 | 768 | } |
f542cc56 | 769 | } |
92664bc8 | 770 | |
f542cc56 | 771 | FillRawsData(215,nhitsOrA); |
772 | FillRawsData(216,nhitsOrC); | |
92664bc8 | 773 | |
f542cc56 | 774 | //draw satellite |
775 | for (int itr=-1;itr<GetNEventTrigClasses();itr++) { //RS loop over all active trigger classes, including the global one | |
776 | int itrID = itr==-1 ? -1 : GetEventTrigClass(itr)->GetUniqueID(); | |
777 | int nEvent = GetEvCountCycleRaws(itrID); | |
778 | // | |
779 | if(type == 7) { // RS Do we need here event type check, specie should do the job | |
780 | if(nEvent == 1000) { | |
781 | for (Int_t ik=0; ik<24; ik++) { | |
782 | // | |
783 | TH1* hik = (TH1*) GetRawsData(ik+1,itrID); if (!hik) continue; | |
784 | hik->GetXaxis()->SetRangeUser(2000, 3000); | |
785 | int maxBin = hik->GetMaximumBin(); | |
786 | double meanEstimate = hik->GetBinCenter( maxBin); | |
787 | TF1* fit= new TF1("fit","gaus", meanEstimate - 40, meanEstimate + 40); | |
788 | fit->SetParameters (hik->GetBinContent(maxBin), meanEstimate, 80); | |
789 | hik->Fit("fit","RQ","Q", meanEstimate-40, meanEstimate+40); | |
790 | fMeans[ik]= (Int_t) fit->GetParameter(1); | |
791 | hik->GetXaxis()->SetRangeUser(0, 30000); | |
92664bc8 | 792 | } |
f542cc56 | 793 | } |
794 | // | |
795 | TH2 *h220 = (TH2*)GetRawsData(220,itrID); | |
796 | TH2 *h221 = (TH2*)GetRawsData(221,itrID); | |
797 | TH2 *h222 = (TH2*)GetRawsData(222,itrID); | |
798 | TH1 *h223 = (TH1*)GetRawsData(223,itrID); | |
799 | if( nEvent>1000 && (h220 || h221 || h222 || h223) ) { | |
800 | Int_t besttimeA=9999999; | |
801 | Int_t besttimeC=9999999; | |
802 | for (Int_t ipmt=0; ipmt<12; ipmt++){ | |
803 | if(allData[ipmt+1][0] > 1 ) { | |
804 | // time[ipmt] = allData[ipmt+1][0] - Int_t(GetRawsData(1)->GetMean()); | |
805 | time[ipmt] = allData[ipmt+1][0] - fMeans[ipmt]; | |
806 | if(TMath::Abs(time[ipmt]) < TMath::Abs(besttimeC)) | |
807 | besttimeC=time[ipmt]; //timeC | |
92664bc8 | 808 | } |
f542cc56 | 809 | } |
810 | for ( Int_t ipmt=12; ipmt<24; ipmt++){ | |
811 | if(allData[ipmt+45][0] > 0) { | |
812 | time[ipmt] = allData[ipmt+45][0] - fMeans[ipmt] ; | |
813 | if(TMath::Abs(time[ipmt]) < TMath::Abs(besttimeA) ) | |
814 | besttimeA=time[ipmt]; //timeA | |
92664bc8 | 815 | } |
f542cc56 | 816 | } |
817 | if(besttimeA<99999 &&besttimeC< 99999) { | |
818 | Float_t t0 = 24.4 * (Float_t( besttimeA+besttimeC)/2. ); | |
819 | Float_t ver = 24.4 * Float_t( besttimeA-besttimeC)/2.; | |
820 | if (h220) h220->Fill(0.001*ver, 0.001*(t0)); | |
821 | if(allData[50][0] > 0) if (h221) h221->Fill(0.001*ver, 0.001*(t0)); | |
822 | if(allData[50][0] <= 0) if (h222) h222->Fill(0.001*ver, 0.001*(t0)); | |
823 | if (h223) h223->Fill(t0); | |
824 | } | |
825 | } //event >100 | |
826 | } //type 7 | |
827 | } // RS loop over all active trigger classes, including the global one | |
92664bc8 | 828 | // |
829 | IncEvCountCycleRaws(); | |
830 | IncEvCountTotalRaws(); | |
831 | // | |
332b9234 | 832 | } |
833 | ||
44ed7a66 | 834 | //____________________________________________________________________________ |
835 | void AliT0QADataMakerRec::MakeDigits( TTree *digitsTree) | |
836 | { | |
837 | //fills QA histos for Digits | |
eca4fa66 | 838 | |
44ed7a66 | 839 | TArrayI *digCFD = new TArrayI(24); |
840 | TArrayI *digLED = new TArrayI(24); | |
841 | TArrayI *digQT0 = new TArrayI(24); | |
842 | TArrayI *digQT1 = new TArrayI(24); | |
843 | Int_t refpoint=0; | |
844 | ||
845 | TBranch *brDigits=digitsTree->GetBranch("T0"); | |
846 | AliT0digit *fDigits = new AliT0digit() ; | |
847 | if (brDigits) { | |
848 | brDigits->SetAddress(&fDigits); | |
849 | }else{ | |
850 | AliError(Form("EXEC Branch T0 digits not found")); | |
92664bc8 | 851 | delete digCFD; |
852 | delete digLED; | |
853 | delete digQT0; | |
854 | delete digQT1; | |
44ed7a66 | 855 | return; |
856 | } | |
857 | digitsTree->GetEvent(0); | |
858 | digitsTree->GetEntry(0); | |
859 | brDigits->GetEntry(0); | |
860 | fDigits->GetTimeCFD(*digCFD); | |
861 | fDigits->GetTimeLED(*digLED); | |
862 | fDigits->GetQT0(*digQT0); | |
863 | fDigits->GetQT1(*digQT1); | |
864 | refpoint = fDigits->RefPoint(); | |
92664bc8 | 865 | for (Int_t i=0; i<24; i++) { |
44ed7a66 | 866 | if (digCFD->At(i)>0) { |
867 | Int_t cfd=digCFD->At(i)- refpoint; | |
92664bc8 | 868 | FillDigitsData(0,i,cfd); |
869 | FillDigitsData(1,i, (digLED->At(i) - digCFD->At(i))); | |
870 | FillDigitsData(2,i, (digQT1->At(i) - digQT0->At(i))); | |
44ed7a66 | 871 | } |
92664bc8 | 872 | } |
44ed7a66 | 873 | |
874 | delete digCFD; | |
875 | delete digLED; | |
876 | delete digQT0; | |
877 | delete digQT1; | |
92664bc8 | 878 | // |
879 | IncEvCountCycleDigits(); | |
880 | IncEvCountTotalDigits(); | |
881 | // | |
44ed7a66 | 882 | } |
883 | ||
04236e67 | 884 | //____________________________________________________________________________ |
885 | void AliT0QADataMakerRec::MakeRecPoints(TTree * clustersTree) | |
886 | { | |
887 | //fills QA histos for clusters | |
888 | ||
446d6ec4 | 889 | AliT0RecPoint* frecpoints= new AliT0RecPoint (); |
f628b9d2 | 890 | if (!frecpoints) { |
394c1a6d | 891 | AliError(":MakeRecPoints >> no recpoints found"); |
04236e67 | 892 | return; |
893 | } | |
894 | TBranch *brRec =clustersTree ->GetBranch("T0"); | |
895 | if (brRec) { | |
896 | brRec->SetAddress(&frecpoints); | |
897 | }else{ | |
f628b9d2 | 898 | AliError(Form("EXEC Branch T0 rec not found ")); |
899 | return; | |
04236e67 | 900 | } |
eca4fa66 | 901 | |
04236e67 | 902 | brRec->GetEntry(0); |
f628b9d2 | 903 | |
04236e67 | 904 | for ( Int_t i=0; i<24; i++) { |
1d7681da | 905 | if(i<12) |
92664bc8 | 906 | FillRecPointsData(0, i, frecpoints -> GetTime(i) - frecpoints -> GetTime(0)); |
1d7681da | 907 | if(i>11) |
92664bc8 | 908 | FillRecPointsData(0, i, frecpoints -> GetTime(i) - frecpoints -> GetTime(12)); |
909 | FillRecPointsData(1, i, frecpoints -> GetAmp(i) - frecpoints->AmpLED(i)); | |
04236e67 | 910 | } |
b9024d69 | 911 | Double_t mmm=frecpoints->GetOnlineMean()- frecpoints->GetMeanTime(); |
92664bc8 | 912 | FillRecPointsData(2,mmm); |
913 | // | |
914 | IncEvCountCycleRecPoints(); | |
915 | IncEvCountTotalRecPoints(); | |
916 | // | |
04236e67 | 917 | } |
918 | ||
919 | //____________________________________________________________________________ | |
920 | void AliT0QADataMakerRec::MakeESDs(AliESDEvent * esd) | |
921 | { | |
922 | //fills QA histos for ESD | |
f628b9d2 | 923 | |
a581ca38 | 924 | const Double32_t *mean; |
925 | mean = esd->GetT0TOF(); | |
926 | Double32_t t0time= 0.001*mean[0]; | |
927 | Double32_t orA= 0.001*mean[1]; | |
928 | Double32_t orC=0.001* mean[2]; | |
929 | ||
92664bc8 | 930 | if (t0time<99) FillESDsData(0,t0time); |
931 | if( esd->GetT0zVertex() <99) FillESDsData(1, esd->GetT0zVertex()); | |
932 | if( orA<99 && orC<99) FillESDsData(2,(orA-orC)/2.); | |
933 | // | |
934 | IncEvCountCycleESDs(); | |
935 | IncEvCountTotalESDs(); | |
936 | // | |
04236e67 | 937 | } |
02d51eff | 938 | //____________________________________________________________________________ |
939 | ||
940 | /* | |
941 | void AliT0QADataMakerRec::GetMeanAndSigma(TH1F* hist, Float_t &mean, Float_t &sigma) | |
942 | { | |
943 | ||
944 | const double window = 3.; //fit window | |
945 | ||
946 | double meanEstimate, sigmaEstimate; | |
947 | int maxBin; | |
948 | maxBin = hist->GetMaximumBin(); //position of maximum | |
949 | meanEstimate = hist->GetBinCenter( maxBin); // mean of gaussian sitting in maximum | |
950 | sigmaEstimate = hist->GetRMS(); | |
951 | TF1* fit= new TF1("fit","gaus", meanEstimate - window*sigmaEstimate, meanEstimate + window*sigmaEstimate); | |
952 | fit->SetParameters(hist->GetBinContent(maxBin), meanEstimate, sigmaEstimate); | |
953 | hist->Fit("fit","RQ","Q"); | |
954 | ||
955 | mean = (Float_t) fit->GetParameter(1); | |
956 | sigma = (Float_t) fit->GetParameter(2); | |
957 | ||
958 | delete fit; | |
959 | } | |
960 | */ |