]>
Commit | Line | Data |
---|---|---|
ebdd0606 | 1 | /************************************************************************** |
2 | * Copyright(c) 2007-2009, 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 | /* $Id$ */ | |
17 | ||
18 | // ************************************************************* | |
19 | // Checks the quality assurance | |
20 | // by comparing with reference data | |
21 | // contained in a DB | |
22 | // ------------------------------------------------------------- | |
23 | // W. Ferrarese + P. Cerello Feb 2008 | |
8b7e858c | 24 | // M.Siciliano Aug 2008 QA RecPoints |
ebdd0606 | 25 | // INFN Torino |
26 | ||
27 | // --- ROOT system --- | |
ad300de9 | 28 | |
ebdd0606 | 29 | #include <TProfile2D.h> |
92664bc8 | 30 | #include <TH2F.h> |
58ceb8ca | 31 | #include <TH1F.h> |
ebdd0606 | 32 | #include <TBranch.h> |
33 | #include <TTree.h> | |
ebdd0606 | 34 | #include <TMath.h> |
ed340566 | 35 | //#include <TObjArray.h> |
3f90b3dc | 36 | |
ebdd0606 | 37 | // --- Standard library --- |
38 | ||
39 | // --- AliRoot header files --- | |
40 | #include "AliITSQASDDDataMakerRec.h" | |
4e25ac79 | 41 | #include "AliQAv1.h" |
ebdd0606 | 42 | #include "AliRawReader.h" |
e41192d7 | 43 | #include "AliITSRawStream.h" |
ebdd0606 | 44 | #include "AliITSRawStreamSDD.h" |
5192f264 | 45 | #include "AliITSdigit.h" |
ebdd0606 | 46 | #include "AliITSRecPoint.h" |
e62fe478 | 47 | #include "AliITSRecPointContainer.h" |
ebdd0606 | 48 | #include "AliITSgeomTGeo.h" |
ebdd0606 | 49 | #include "AliCDBManager.h" |
ebdd0606 | 50 | #include "AliCDBEntry.h" |
3f90b3dc | 51 | #include "AliITSCalibrationSDD.h" |
fc89f88c | 52 | |
cfb59c70 | 53 | class TGaxis; |
54 | class TF1; | |
55 | class TSystem; | |
56 | class AliLog; | |
57 | class AliQAChecker; | |
58 | class AliITSRawStreamSDDCompressed; | |
59 | class AliCDBStorage; | |
60 | class Riostream; | |
61 | class AliITSdigitSDD; | |
62 | class AliITS; | |
63 | class AliRunLoader; | |
64 | class AliITSLoader; | |
65 | class AliITSDetTypeRec; | |
66 | ||
67 | ||
ebdd0606 | 68 | |
69 | ClassImp(AliITSQASDDDataMakerRec) | |
70 | ||
71 | //____________________________________________________________________________ | |
72 | AliITSQASDDDataMakerRec::AliITSQASDDDataMakerRec(AliITSQADataMakerRec *aliITSQADataMakerRec, Bool_t kMode, Short_t ldc) : | |
73 | TObject(), | |
74 | fAliITSQADataMakerRec(aliITSQADataMakerRec), | |
75 | fkOnline(kMode), | |
76 | fLDC(ldc), | |
ad300de9 | 77 | fSDDhRawsTask(0), |
44ed7a66 | 78 | fSDDhDigitsTask(0), |
ad300de9 | 79 | fSDDhRecPointsTask(0), |
78fb0b3d | 80 | fOnlineOffsetRaws(0), |
81 | fOnlineOffsetRecPoints(0), | |
ad300de9 | 82 | fGenRawsOffset(0), |
44ed7a66 | 83 | fGenDigitsOffset(0), |
ad300de9 | 84 | fGenRecPointsOffset(0), |
ebdd0606 | 85 | fTimeBinSize(1), |
3f90b3dc | 86 | fDDLModuleMap(0), |
87 | fCalibration(0), | |
88 | fHistoCalibration(0) | |
ebdd0606 | 89 | { |
90 | //ctor used to discriminate OnLine-Offline analysis | |
8b7e858c | 91 | if(fLDC < 0 || fLDC > 6) { |
ebdd0606 | 92 | AliError("Error: LDC number out of range; return\n"); |
93 | } | |
8b7e858c | 94 | fGenRawsOffset = new Int_t[AliRecoParam::kNSpecies]; |
95 | fGenRecPointsOffset = new Int_t[AliRecoParam::kNSpecies]; | |
4a903927 | 96 | fGenDigitsOffset = new Int_t[AliRecoParam::kNSpecies]; |
8b7e858c | 97 | for(Int_t i=0; i<AliRecoParam::kNSpecies; i++) { |
98 | fGenRawsOffset[i] = 0; | |
99 | fGenRecPointsOffset[i] = 0; | |
4a903927 | 100 | fGenDigitsOffset[i]=0; |
8b7e858c | 101 | } |
3d0c40f9 | 102 | |
103 | InitCalibrationArray(); | |
ebdd0606 | 104 | } |
105 | ||
106 | //____________________________________________________________________________ | |
107 | AliITSQASDDDataMakerRec::AliITSQASDDDataMakerRec(const AliITSQASDDDataMakerRec& qadm) : | |
108 | TObject(), | |
109 | fAliITSQADataMakerRec(qadm.fAliITSQADataMakerRec), | |
110 | fkOnline(qadm.fkOnline), | |
111 | fLDC(qadm.fLDC), | |
ad300de9 | 112 | fSDDhRawsTask(qadm.fSDDhRawsTask), |
44ed7a66 | 113 | fSDDhDigitsTask(qadm.fSDDhDigitsTask), |
ad300de9 | 114 | fSDDhRecPointsTask(qadm.fSDDhRecPointsTask), |
78fb0b3d | 115 | fOnlineOffsetRaws(qadm.fOnlineOffsetRaws), |
116 | fOnlineOffsetRecPoints(qadm.fOnlineOffsetRecPoints), | |
ad300de9 | 117 | fGenRawsOffset(qadm.fGenRawsOffset), |
44ed7a66 | 118 | fGenDigitsOffset(qadm.fGenDigitsOffset), |
ad300de9 | 119 | fGenRecPointsOffset(qadm.fGenRecPointsOffset), |
3f90b3dc | 120 | fTimeBinSize(qadm.fTimeBinSize), |
3f90b3dc | 121 | fDDLModuleMap(qadm.fDDLModuleMap), |
122 | fCalibration(qadm.fCalibration), | |
123 | fHistoCalibration(qadm.fHistoCalibration) | |
58ceb8ca | 124 | { |
ebdd0606 | 125 | //copy ctor |
126 | fAliITSQADataMakerRec->SetName((const char*)qadm.fAliITSQADataMakerRec->GetName()) ; | |
127 | fAliITSQADataMakerRec->SetTitle((const char*)qadm.fAliITSQADataMakerRec->GetTitle()); | |
3d0c40f9 | 128 | //fDDLModuleMap=NULL; |
ebdd0606 | 129 | } |
130 | ||
131 | //____________________________________________________________________________ | |
132 | AliITSQASDDDataMakerRec::~AliITSQASDDDataMakerRec(){ | |
133 | // destructor | |
58ceb8ca | 134 | //if(fDDLModuleMap) delete fDDLModuleMap; |
3f90b3dc | 135 | if(fHistoCalibration){delete fHistoCalibration; fHistoCalibration=NULL;} |
ebdd0606 | 136 | } |
137 | //__________________________________________________________________ | |
138 | AliITSQASDDDataMakerRec& AliITSQASDDDataMakerRec::operator = (const AliITSQASDDDataMakerRec& qac ) | |
139 | { | |
7a0e5776 | 140 | // Equal operator. |
ebdd0606 | 141 | this->~AliITSQASDDDataMakerRec(); |
142 | new(this) AliITSQASDDDataMakerRec(qac); | |
143 | return *this; | |
144 | } | |
145 | ||
146 | //____________________________________________________________________________ | |
147 | void AliITSQASDDDataMakerRec::StartOfDetectorCycle() | |
148 | { | |
cfb59c70 | 149 | |
150 | //Start of a QA cycle | |
92664bc8 | 151 | // |
1e7991d8 | 152 | AliDebug(AliQAv1::GetQADebugLevel(),Form("Start of SDD Cycle with event specie %s for task %s\n",AliRecoParam::GetEventSpecieName(fAliITSQADataMakerRec->GetEventSpecie()),AliQAv1::GetTaskName(fAliITSQADataMakerRec->GetTaskIndexSelected()).Data())); |
92664bc8 | 153 | if(!fCalibration) { |
154 | //fAliITSQADataMakerRec->GetRawsData(9+ fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Reset(); | |
155 | CreateTheCalibration(); | |
8a55554e | 156 | } |
3d0c40f9 | 157 | |
1e7991d8 | 158 | if(fAliITSQADataMakerRec->GetEventSpecie()==0) return;//not the kDefault EventSpecie |
92664bc8 | 159 | //Detector specific actions at start of cycle |
160 | if(fAliITSQADataMakerRec->GetTaskIndexSelected()==AliQAv1::kRAWS){ | |
161 | AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM::Start of SDD Cycle\n"); | |
162 | if(fAliITSQADataMakerRec->ListExists(AliQAv1::kRAWS)==kFALSE)return; | |
163 | // | |
164 | int offsRW = fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]; | |
165 | AliDebug(AliQAv1::GetQADebugLevel(),Form("Reset of Raw Data normalized histograms with eventspecie %s ",AliRecoParam::GetEventSpecieName(fAliITSQADataMakerRec->GetEventSpecie()))); | |
166 | fAliITSQADataMakerRec->ResetRawsData(10+offsRW ); | |
167 | fAliITSQADataMakerRec->ResetRawsData(3+ offsRW); | |
168 | fAliITSQADataMakerRec->ResetRawsData(4+ offsRW); | |
169 | fAliITSQADataMakerRec->ResetRawsData(5+ offsRW); | |
170 | // | |
171 | } | |
172 | if(fAliITSQADataMakerRec->GetTaskIndexSelected()==AliQAv1::kRECPOINTS){ | |
173 | if(fAliITSQADataMakerRec->ListExists(AliQAv1::kRECPOINTS)==kFALSE)return; | |
174 | ||
175 | AliDebug(AliQAv1::GetQADebugLevel(),Form("Reset of RecPoints normalized histograms with eventspecie %s ",AliRecoParam::GetEventSpecieName(fAliITSQADataMakerRec->GetEventSpecie()))); | |
176 | int offsRP = fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]; | |
177 | fAliITSQADataMakerRec->ResetRecPointsData(9+ offsRP); | |
178 | fAliITSQADataMakerRec->ResetRecPointsData(10+ offsRP); | |
179 | fAliITSQADataMakerRec->ResetRecPointsData(11+ offsRP); | |
180 | fAliITSQADataMakerRec->ResetRecPointsData(27+ offsRP); | |
181 | ||
182 | } | |
ebdd0606 | 183 | } |
184 | ||
185 | //____________________________________________________________________________ | |
92664bc8 | 186 | void AliITSQASDDDataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray** /*list*/) |
ebdd0606 | 187 | { |
cfb59c70 | 188 | //end of a QA cycle |
92664bc8 | 189 | |
6649909b | 190 | AliDebug(AliQAv1::GetQADebugLevel(),"AliITSDM instantiates checker with Run(AliQAv1::kITS, task, list)\n"); |
191 | ||
192 | Double_t entriescalibration1= 0.; | |
193 | Double_t entriescalibrationL3=0.; | |
194 | Double_t entriescalibrationL4=0.; | |
92664bc8 | 195 | int offsRW = fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]; |
196 | int offsRP = fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]; | |
197 | // | |
6649909b | 198 | if(fHistoCalibration){ |
92664bc8 | 199 | entriescalibration1= ((TH1F*)(fHistoCalibration->At(0)))->GetEntries(); |
200 | entriescalibrationL3=((TH2F*)(fHistoCalibration->At(1)))->GetEntries(); | |
201 | entriescalibrationL4=((TH2F*)(fHistoCalibration->At(2)))->GetEntries(); | |
6649909b | 202 | } |
203 | else{ AliWarning("Calibration TObjArray is NULL! No Normalization and calibtaion plot will be filled\n");} | |
92664bc8 | 204 | // |
205 | for (int trCl=-1;trCl<fAliITSQADataMakerRec->GetNTrigClasses();trCl++) { // RS Loop over all trigger classes (+ global counter, -1) | |
206 | // | |
207 | if(task==AliQAv1::kRAWS) { | |
208 | TObjArray &harr = *fAliITSQADataMakerRec->GetRawsDataOfTrigClass(trCl); | |
209 | int nEvent = GetNumberOfEvents(AliQAv1::kRAWS,trCl); | |
210 | // printf("fNevent %d \n",nEvent); | |
211 | TH1* h10 = (TH1*)harr[10+offsRW]; | |
212 | if (h10) h10->SetBinContent(1,nEvent); | |
213 | // | |
214 | if(nEvent!=0) { | |
215 | if (h10 && harr[0+offsRW] && harr[1+offsRW] && harr[2]) { // were they all cloned? | |
216 | // | |
217 | Double_t entriesmodpattern = ((TH1*)harr[0+offsRW])->GetEntries(); | |
218 | Double_t entriesL3 = ((TH1*)harr[1+offsRW])->GetEntries(); | |
219 | Double_t entriesL4 = ((TH1*)harr[2+offsRW])->GetEntries(); | |
220 | // | |
221 | Double_t normentriesmodpattern=0.; | |
222 | Double_t normentriesL3= 0.; | |
223 | Double_t normentriesL4= 0.; | |
224 | ||
225 | if(entriescalibration1!=0.)normentriesmodpattern=entriesmodpattern/(entriescalibration1*nEvent); | |
226 | if(entriesL3!=0.) normentriesL3= entriesL3/(entriescalibrationL3*nEvent); | |
227 | if(entriesL4!=0.) normentriesL4= entriesL4/(entriescalibrationL4*nEvent); | |
228 | // | |
229 | h10->SetBinContent(2,normentriesmodpattern); | |
230 | h10->SetBinContent(3,normentriesL3); | |
231 | h10->SetBinContent(4,normentriesL4); | |
232 | // | |
233 | if(fHistoCalibration){ | |
234 | if (harr[3+offsRW] && harr[0+offsRW]) ((TH1*)harr[3+offsRW])->Divide( (TH1*)harr[0+offsRW],((TH1F*)(fHistoCalibration->At(0))),1.,nEvent); | |
235 | if (harr[4+offsRW] && harr[1+offsRW]) ((TH1*)harr[4+offsRW])->Divide( (TH1*)harr[1+offsRW],((TH1F*)(fHistoCalibration->At(1))),1.,nEvent); | |
236 | if (harr[5+offsRW] && harr[2+offsRW]) ((TH1*)harr[5+offsRW])->Divide( (TH1*)harr[2+offsRW],((TH1F*)(fHistoCalibration->At(2))),1.,nEvent); | |
237 | } | |
238 | } | |
6649909b | 239 | } |
92664bc8 | 240 | // |
241 | TH1* htmp4 = (TH1*)harr[4+offsRW]; | |
242 | Int_t xbin3 = htmp4 ? ((TH1*)harr[4+offsRW])->GetNbinsX() : 0; | |
243 | Int_t ybin3 = htmp4 ? ((TH1*)harr[4+offsRW])->GetNbinsY() : 0; | |
244 | // | |
245 | TH1* htmp6 = ((TH1*)harr[6+offsRW]); | |
246 | if (htmp6 && htmp4) for(Int_t i=0; i<xbin3; i++) for(Int_t j=0; j<ybin3; j++) htmp6->Fill(htmp4->GetBinContent(i,j)); | |
247 | // | |
248 | TH1* htmp5 = (TH1*)harr[5+offsRW]; | |
249 | Int_t xbin4 = htmp5 ? htmp5->GetNbinsX() : 0; | |
250 | Int_t ybin4 = htmp5 ? htmp5->GetNbinsY() : 0; | |
251 | // | |
252 | TH1* htmp7 = (TH1*)harr[7+offsRW]; | |
253 | if (htmp7 && htmp5) for(Int_t i=0; i<xbin4; i++) for(Int_t j=0; j<ybin4; j++) htmp7->Fill(htmp5->GetBinContent(i,j)); | |
254 | // | |
255 | if(fHistoCalibration){ | |
256 | for(Int_t inumb=8;inumb<10;inumb++) { | |
257 | TH1* htmp = (TH1*)harr[inumb + offsRW]; | |
258 | if (!htmp) continue; | |
259 | TH1* hcal = (TH1*)fHistoCalibration->At(inumb-7); | |
260 | for(Int_t ii=1; ii<htmp->GetNbinsX()+1;ii++) { | |
261 | for(Int_t jj=1; jj<htmp->GetNbinsY()+1;jj++) { | |
262 | if( hcal->GetBinContent(ii,jj) != 0. ) htmp->SetBinContent(ii,jj,1); | |
263 | else if( hcal->GetBinContent(ii,jj) == 0. ) htmp->SetBinContent(ii,jj,0); | |
264 | }//end x axis | |
265 | }//end y axis | |
6649909b | 266 | }//end for inumb |
92664bc8 | 267 | } |
268 | // | |
269 | }//end raws | |
270 | // | |
271 | // | |
272 | if(task==AliQAv1::kRECPOINTS) { | |
273 | // | |
274 | TObjArray &harr = *fAliITSQADataMakerRec->GetRecPointsDataOfTrigClass(trCl); | |
275 | // | |
276 | TH1* htmp0 = (TH1*)harr[0+offsRP]; | |
277 | TH1* htmp1 = (TH1*)harr[1+offsRP]; | |
278 | TH1* htmp13 = (TH1*)harr[13+offsRP]; | |
279 | TH1* htmp14 = (TH1*)harr[14+offsRP]; | |
280 | // | |
281 | int nEventRP = GetNumberOfEvents(AliQAv1::kRECPOINTS,trCl); | |
282 | if (htmp0 && htmp1 && htmp13 && htmp14) { | |
283 | Double_t chargeL3 = htmp0->GetMean(); | |
284 | Double_t errchargeL3 = htmp0->GetMeanError(); | |
285 | // | |
286 | Double_t chargeL4 = htmp1->GetMean(); | |
287 | Double_t errchargeL4 = htmp1->GetMeanError(); | |
288 | // | |
289 | Double_t radiusL3 = htmp13->GetMean(); | |
290 | Double_t errradiusL3 = htmp13->GetMeanError(); | |
291 | ||
292 | Double_t radiusL4= htmp14->GetMean(); | |
293 | Double_t errradiusL4= htmp14->GetMeanError(); | |
294 | // | |
295 | // printf("fNeventRP %d \n",nEventRP); | |
296 | TH1* htmp27 = (TH1*)harr[27+offsRP]; | |
297 | if (htmp27) { | |
298 | htmp27->SetBinContent(1,nEventRP); | |
299 | ||
300 | htmp27->SetBinContent(31,chargeL3); | |
301 | htmp27->SetBinError(31,errchargeL3); | |
302 | ||
303 | htmp27->SetBinContent(47,chargeL4); | |
304 | htmp27->SetBinError(47,errchargeL4); | |
305 | ||
306 | htmp27->SetBinContent(32,radiusL3); | |
307 | htmp27->SetBinError(32,errradiusL3); | |
308 | ||
309 | htmp27->SetBinContent(48,radiusL4); | |
310 | htmp27->SetBinError(48,errradiusL4); | |
311 | } | |
312 | // | |
313 | TH1 *htmp6=(TH1*)harr[6+offsRP],*htmp7=(TH1*)harr[7+offsRP],*htmp8=(TH1*)harr[8+offsRP]; | |
314 | Double_t entriesmodpattern = htmp6 ? htmp6->GetEntries() : 0; | |
315 | Double_t entriesL3 = htmp7 ? htmp7->GetEntries() : 0; | |
316 | Double_t entriesL4 = htmp8 ? htmp8->GetEntries() : 0; | |
6649909b | 317 | |
92664bc8 | 318 | //printf("entries modpatternrp = %02f \t L3= %02f \t L4 =%02f \n",entriesmodpattern,entriesL3,entriesL4 ); |
6649909b | 319 | |
92664bc8 | 320 | if(nEventRP!=0) { |
321 | Double_t normentriesmodpattern=0.; | |
322 | Double_t normentriesL3= 0.; | |
323 | Double_t normentriesL4= 0.; | |
324 | ||
325 | if(entriescalibration1!=0.) normentriesmodpattern=entriesmodpattern/(entriescalibration1*nEventRP); | |
326 | if(entriesL3!=0.) normentriesL3= entriesL3/(entriescalibrationL3*nEventRP); | |
327 | if(entriesL4!=0.) normentriesL4= entriesL4/(entriescalibrationL4*nEventRP); | |
6649909b | 328 | |
92664bc8 | 329 | if (htmp27) { |
330 | htmp27->SetBinContent(2,normentriesmodpattern); | |
331 | htmp27->SetBinContent(3,normentriesL3); | |
332 | htmp27->SetBinContent(4,normentriesL4); | |
333 | } | |
334 | // printf("NORM entries modpatternrp = %02f \t L3= %02f \t L4 =%02f \n",normentriesmodpattern,normentriesL3,normentriesL4 ); | |
6649909b | 335 | |
92664bc8 | 336 | if(fHistoCalibration) { |
337 | if (harr[9 +offsRP] && htmp6) ((TH1*)harr[9 +offsRP])->Divide(htmp6, (TH1*)fHistoCalibration->At(0),nEventRP); | |
338 | if (harr[10+offsRP] && htmp7) ((TH1*)harr[10+offsRP])->Divide(htmp7, (TH1*)fHistoCalibration->At(1),nEventRP); | |
339 | if (harr[11+offsRP] && htmp8) ((TH1*)harr[11+offsRP])->Divide(htmp8, (TH1*)fHistoCalibration->At(2),nEventRP); | |
340 | //if (harr[21+offsRP] && htmp7) ((TH1*)harr[21+offsRP])->Divide(htmp7, (TH1*)fHistoCalibration->At(1),nEventRP); | |
341 | //if (harr[22+offsRP] && htmp8) ((TH1*)harr[22+offsRP])->Divide(htmp8, (TH1*)fHistoCalibration->At(2),nEventRP); | |
3f90b3dc | 342 | } |
92664bc8 | 343 | } |
344 | TH1* htmp10 = (TH1*)harr[10+offsRP]; | |
345 | Int_t xbin3 = htmp10 ? htmp10->GetNbinsX() : 0; | |
346 | Int_t ybin3 = htmp10 ? htmp10->GetNbinsY() : 0; | |
347 | // | |
348 | TH1* htmp19 = (TH1*)harr[19+offsRP]; | |
349 | if (htmp19&&htmp10) for(Int_t i=0; i<xbin3; i++) for(Int_t j=0; j<ybin3; j++) htmp19->Fill(htmp10->GetBinContent(i,j)); | |
350 | // | |
351 | TH1* htmp11 = (TH1*)harr[11+offsRP]; | |
352 | Int_t xbin4 = htmp11 ? htmp11->GetNbinsX() : 0; | |
353 | Int_t ybin4 = htmp11 ? htmp11->GetNbinsY() : 0; | |
354 | // | |
355 | TH1* htmp20 = (TH1*)harr[20+offsRP]; | |
356 | if (htmp11&&htmp20) for(Int_t i=0; i<xbin4; i++) for(Int_t j=0; j<ybin4; j++) htmp20->Fill(htmp11->GetBinContent(i,j)); | |
357 | } | |
358 | // | |
359 | ||
360 | // RecPoints 2 Raws Ratio | |
361 | if(fAliITSQADataMakerRec->ListExists(AliQAv1::kRAWS)==kTRUE) { | |
362 | // | |
363 | TH1* htmp21 = (TH1*)harr[21+offsRP]; | |
364 | TH1* htmp23 = (TH1*)harr[23+offsRP]; | |
365 | TH1* htmp10 = (TH1*)harr[10+offsRP]; | |
366 | TH1* htmp4rw = fAliITSQADataMakerRec->GetRawsData(4 + offsRW,trCl); | |
367 | if (htmp21 && htmp23 && htmp10 && htmp4rw) { | |
368 | Int_t xbin3RP = htmp21->GetNbinsX(); | |
369 | Int_t ybin3RP = htmp21->GetNbinsY(); | |
370 | Int_t xbin3R = htmp4rw->GetNbinsX(); | |
371 | Int_t ybin3R = htmp4rw->GetNbinsY(); | |
372 | if((xbin3RP == xbin3R) && (ybin3RP == ybin3R)) { | |
373 | htmp21->Divide(htmp10,htmp4rw); | |
374 | for(Int_t i=0; i<xbin3R; i++) for(Int_t j=0; j<ybin3R; j++) htmp23->Fill(htmp21->GetBinContent(i,j)); | |
6649909b | 375 | } |
92664bc8 | 376 | else AliWarning("Number of bins for Raws and RecPoints (Layer 3) do not match\n"); |
377 | } | |
378 | // | |
379 | TH1* htmp22 = (TH1*)harr[22+offsRP]; | |
380 | TH1* htmp24 = (TH1*)harr[24+offsRP]; | |
381 | TH1* htmp11 = (TH1*)harr[11+offsRP]; | |
382 | TH1* htmp5rw = fAliITSQADataMakerRec->GetRawsData(5 + offsRW,trCl); | |
383 | if (htmp22 && htmp24 && htmp11 && htmp5rw) { | |
384 | Int_t xbin4RP = htmp22->GetNbinsX(); | |
385 | Int_t ybin4RP = htmp22->GetNbinsY(); | |
386 | Int_t xbin4R = htmp5rw->GetNbinsX(); | |
387 | Int_t ybin4R = htmp5rw->GetNbinsY(); | |
388 | if((xbin4RP == xbin4R) && (ybin4RP == ybin4R)) { | |
389 | htmp22->Divide(htmp11,htmp5rw); | |
390 | for(Int_t i=0; i<xbin4R; i++) for(Int_t j=0; j<ybin4R; j++) htmp24->Fill(htmp22->GetBinContent(i,j)); | |
391 | } | |
392 | else AliWarning("Number of bins for Raws and RecPoints (Layer 4) do not match\n"); | |
393 | } | |
6649909b | 394 | } |
92664bc8 | 395 | else{AliWarning("Ratio between RecPoints and Raws not executed because the raw list has not been created\n");} |
396 | }//end recpoints | |
397 | // | |
398 | } // RS Loop over all trigger classes (+ global counter, -1) | |
399 | // | |
ebdd0606 | 400 | } |
401 | ||
402 | //____________________________________________________________________________ | |
eca4fa66 | 403 | Int_t AliITSQASDDDataMakerRec::InitRaws() |
ebdd0606 | 404 | { |
3d0c40f9 | 405 | |
ebdd0606 | 406 | // Initialization for RAW data - SDD - |
7d297381 | 407 | const Bool_t expert = kTRUE ; |
408 | const Bool_t saveCorr = kTRUE ; | |
409 | const Bool_t image = kTRUE ; | |
58ceb8ca | 410 | |
eca4fa66 | 411 | Int_t rv = 0 ; |
ebdd0606 | 412 | Int_t lay, lad, det; |
ebdd0606 | 413 | Int_t indexlast = 0; |
414 | Int_t index1 = 0; | |
92664bc8 | 415 | int offsRW = fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]; |
416 | fSDDhRawsTask = 0; | |
417 | if(fkOnline){AliInfo("Book Online Histograms for SDD\n");} | |
3f90b3dc | 418 | else {AliInfo("Book Offline Histograms for SDD\n ");} |
92664bc8 | 419 | TH1F *h0 = new TH1F("SDDModPattern","HW Modules pattern",fgknSDDmodules,239.5,499.5); //0 |
ebdd0606 | 420 | h0->GetXaxis()->SetTitle("Module Number"); |
421 | h0->GetYaxis()->SetTitle("Counts"); | |
8a55554e | 422 | h0->SetOption("bar1"); |
423 | h0->SetBarOffset(0.01); | |
424 | h0->SetBarWidth(0.95); | |
425 | h0->SetFillColor(45); | |
92664bc8 | 426 | rv = fAliITSQADataMakerRec->Add2RawsList(h0,0+offsRW, expert, !image, !saveCorr); |
ad300de9 | 427 | fSDDhRawsTask++; |
7a0e5776 | 428 | |
429 | //zPhi distribution using ladder and modules numbers | |
92664bc8 | 430 | TH2F *hphil3 = new TH2F("SDDphizL3","SDD #varphiz Layer3 ",12,0.5,6.5,14,0.5,14.5);//1 |
5af1d436 | 431 | hphil3->GetXaxis()->SetTitle("z[Module Number L3 ]"); |
432 | hphil3->GetYaxis()->SetTitle("#varphi[ Ladder Number L3]"); | |
8a55554e | 433 | hphil3->SetStats(0); |
92664bc8 | 434 | rv = fAliITSQADataMakerRec->Add2RawsList(hphil3,1+offsRW, !expert, image, !saveCorr); |
7a0e5776 | 435 | fSDDhRawsTask++; |
436 | ||
92664bc8 | 437 | TH2F *hphil4 = new TH2F("SDDphizL4","SDD #varphiz Layer4 ",16,0.5,8.5,22,0.5,22.5); //2 |
5af1d436 | 438 | hphil4->GetXaxis()->SetTitle("z[Module Number L4]"); |
439 | hphil4->GetYaxis()->SetTitle("#varphi[Ladder Number L4]"); | |
8a55554e | 440 | hphil4->SetStats(0); |
92664bc8 | 441 | rv = fAliITSQADataMakerRec->Add2RawsList(hphil4,2+offsRW, !expert, image, !saveCorr); |
7a0e5776 | 442 | fSDDhRawsTask++; |
443 | ||
3f90b3dc | 444 | //normalized histograms |
92664bc8 | 445 | TH1F *h0norm = new TH1F("SDDModPatternNORM","NORM HW Modules pattern",fgknSDDmodules,239.5,499.5); //3 |
3f90b3dc | 446 | h0norm->GetXaxis()->SetTitle("Module Number"); |
447 | h0norm->GetYaxis()->SetTitle("Counts"); | |
8a55554e | 448 | h0norm->SetOption("bar1"); |
449 | h0norm->SetBarOffset(0.01); | |
450 | h0norm->SetBarWidth(0.95); | |
451 | h0norm->SetFillColor(46); | |
452 | //h0norm->SetStats(0); | |
92664bc8 | 453 | rv = fAliITSQADataMakerRec->Add2RawsList(h0norm,3+offsRW, expert, !image, !saveCorr); |
3f90b3dc | 454 | fSDDhRawsTask++; |
455 | ||
456 | //zPhi distribution using ladder and modules numbers | |
92664bc8 | 457 | TH2F *hphil3norm = new TH2F("SDDphizL3NORM","NORM SDD #varphiz Layer3 ",12,0.5,6.5,14,0.5,14.5);//4 |
3f90b3dc | 458 | hphil3norm->GetXaxis()->SetTitle("z[Module Number L3 ]"); |
459 | hphil3norm->GetYaxis()->SetTitle("#varphi[ Ladder Number L3]"); | |
8a55554e | 460 | hphil3norm->SetStats(0); |
92664bc8 | 461 | rv = fAliITSQADataMakerRec->Add2RawsList(hphil3norm,4+offsRW, expert, !image, !saveCorr); |
3f90b3dc | 462 | fSDDhRawsTask++; |
463 | ||
92664bc8 | 464 | TH2F *hphil4norm = new TH2F("SDDphizL4NORM","NORM SDD #varphiz Layer4 ",16,0.5,8.5,22,0.5,22.5); //5 |
3f90b3dc | 465 | hphil4norm->GetXaxis()->SetTitle("z[Module Number L4]"); |
466 | hphil4norm->GetYaxis()->SetTitle("#varphi[Ladder Number L4]"); | |
8a55554e | 467 | hphil4norm->SetStats(0); |
92664bc8 | 468 | rv = fAliITSQADataMakerRec->Add2RawsList(hphil4norm,5+offsRW, expert, !image, !saveCorr); |
3f90b3dc | 469 | fSDDhRawsTask++; |
ebdd0606 | 470 | |
78fb0b3d | 471 | |
8a55554e | 472 | Float_t hMax = 0.2; |
7a0e5776 | 473 | |
8a55554e | 474 | TH1F *oL3 = new TH1F("SDDL3_RelativeOccupancy","Layer 3 Relative Occupancy",200,0.,hMax); |
92664bc8 | 475 | rv = fAliITSQADataMakerRec->Add2RawsList(oL3,6+offsRW, expert, !image, !saveCorr); //6 |
8a55554e | 476 | fSDDhRawsTask++; |
477 | ||
478 | TH1F *oL4 = new TH1F("SDDL4_RelativeOccupancy","Layer 4 Relative Occupancy",200,0.,hMax); | |
92664bc8 | 479 | rv = fAliITSQADataMakerRec->Add2RawsList(oL4,7+offsRW, expert, !image, !saveCorr); //7 |
8a55554e | 480 | fSDDhRawsTask++; |
481 | ||
482 | //zPhi distribution using ladder and modules numbers | |
92664bc8 | 483 | TH2F *hcalibl3 = new TH2F("SDDphizCalibL3","SDDCalibL3 ",12,0.5,6.5,14,0.5,14.5);//8 |
8a55554e | 484 | hcalibl3->GetXaxis()->SetTitle("z[Module Number L3]"); |
485 | hcalibl3->GetYaxis()->SetTitle("#varphi[ Ladder Number L3]"); | |
486 | hcalibl3->SetStats(0); | |
487 | hcalibl3->SetMaximum(2); | |
92664bc8 | 488 | rv = fAliITSQADataMakerRec->Add2RawsList(hcalibl3,8+offsRW, !expert, image, !saveCorr); |
8a55554e | 489 | fSDDhRawsTask++; |
490 | ||
92664bc8 | 491 | TH2F *hcalibl4 = new TH2F("SDDphizCalibL4","SDDCalibL4 ",16,0.5,8.5,22,0.5,22.5); //9 |
8a55554e | 492 | hcalibl4->GetXaxis()->SetTitle("z[Module Number L4]"); |
493 | hcalibl4->GetYaxis()->SetTitle("#varphi[Ladder Number L4]"); | |
494 | hcalibl4->SetStats(0); | |
495 | hcalibl4->SetMaximum(2); | |
92664bc8 | 496 | rv = fAliITSQADataMakerRec->Add2RawsList(hcalibl4,9+offsRW, !expert, image, !saveCorr); |
8a55554e | 497 | fSDDhRawsTask++; |
498 | ||
499 | TH1F *hsummarydata = new TH1F("SDDRawDataCheck","SDDRawDataCheck",46,-0.5,45.5);//10 summary of raw data checks | |
500 | hsummarydata->GetXaxis()->SetLabelSize(0.02); | |
501 | hsummarydata->GetXaxis()->SetTickLength(0.01); | |
502 | hsummarydata->GetXaxis()->SetNdivisions(110); | |
503 | hsummarydata->GetXaxis()->SetTicks("-"); | |
504 | hsummarydata->GetYaxis()->SetLabelSize(0.02); | |
505 | hsummarydata->GetYaxis()->SetTitleSize(0.02); | |
506 | hsummarydata->GetYaxis()->SetTitleOffset(1.5); | |
507 | hsummarydata->GetYaxis()->SetTitle("#events(norm) or #modules (m) or #drift regions (dr)"); | |
508 | hsummarydata->SetStats(0); | |
509 | hsummarydata->SetMaximum(272); | |
510 | hsummarydata->SetMinimum(0.); | |
511 | ||
512 | hsummarydata->SetOption("textbar1"); | |
513 | hsummarydata->SetBarOffset(0.01); | |
514 | hsummarydata->SetBarWidth(0.95); | |
515 | hsummarydata->SetFillColor(8); | |
516 | ||
517 | //information about the events | |
518 | hsummarydata->GetXaxis()->SetBinLabel(1,"Events"); | |
519 | hsummarydata->GetXaxis()->SetBinLabel(2,"Ent_NORM"); | |
520 | hsummarydata->GetXaxis()->SetBinLabel(3,"Ent_NORML3"); | |
521 | hsummarydata->GetXaxis()->SetBinLabel(4,"Ent_NORML4"); | |
522 | //all | |
523 | ||
524 | hsummarydata->GetXaxis()->SetBinLabel(5,"m_act"); | |
525 | hsummarydata->GetXaxis()->SetBinLabel(6,"m_fil"); | |
526 | hsummarydata->GetXaxis()->SetBinLabel(7,"dr_act"); | |
527 | hsummarydata->GetXaxis()->SetBinLabel(8,"dr_fil"); | |
528 | hsummarydata->GetXaxis()->SetBinLabel(9,"m_exc"); | |
529 | hsummarydata->GetXaxis()->SetBinLabel(10,"m_emp"); | |
530 | hsummarydata->GetXaxis()->SetBinLabel(11,"dr_exc"); | |
531 | hsummarydata->GetXaxis()->SetBinLabel(12,"dr_emp"); | |
532 | hsummarydata->GetXaxis()->SetBinLabel(13,"m_exc-act"); | |
533 | hsummarydata->GetXaxis()->SetBinLabel(14,"m_act-emp"); | |
534 | hsummarydata->GetXaxis()->SetBinLabel(15,"dr_exc-act"); | |
535 | hsummarydata->GetXaxis()->SetBinLabel(16,"dr_act-emp"); | |
536 | hsummarydata->GetXaxis()->SetBinLabel(17,"m_overth"); | |
537 | hsummarydata->GetXaxis()->SetBinLabel(18,"dr_overth"); | |
538 | ||
539 | //l3 | |
540 | ||
541 | hsummarydata->GetXaxis()->SetBinLabel(19,"m_actl3"); | |
542 | hsummarydata->GetXaxis()->SetBinLabel(20,"m_fill3"); | |
543 | hsummarydata->GetXaxis()->SetBinLabel(21,"dr_actl3"); | |
544 | hsummarydata->GetXaxis()->SetBinLabel(22,"dr_fill3"); | |
545 | hsummarydata->GetXaxis()->SetBinLabel(23,"m_excl3"); | |
546 | hsummarydata->GetXaxis()->SetBinLabel(24,"m_empl3"); | |
547 | hsummarydata->GetXaxis()->SetBinLabel(25,"dr_excl3"); | |
548 | hsummarydata->GetXaxis()->SetBinLabel(26,"dr_empl3"); | |
549 | hsummarydata->GetXaxis()->SetBinLabel(27,"m_exc-actl3"); | |
550 | hsummarydata->GetXaxis()->SetBinLabel(28,"m_act-empl3"); | |
551 | hsummarydata->GetXaxis()->SetBinLabel(29,"dr_exc-actl3"); | |
552 | hsummarydata->GetXaxis()->SetBinLabel(30,"dr_act-empl3"); | |
553 | hsummarydata->GetXaxis()->SetBinLabel(31,"m_overthl3"); | |
554 | hsummarydata->GetXaxis()->SetBinLabel(32,"dr_overthl3"); | |
555 | ||
556 | //l4 | |
557 | ||
558 | hsummarydata->GetXaxis()->SetBinLabel(33,"m_actl4"); | |
559 | hsummarydata->GetXaxis()->SetBinLabel(34,"m_fill4"); | |
560 | hsummarydata->GetXaxis()->SetBinLabel(35,"dr_actl4"); | |
561 | hsummarydata->GetXaxis()->SetBinLabel(36,"dr_fill4"); | |
562 | hsummarydata->GetXaxis()->SetBinLabel(37,"m_excl4"); | |
563 | hsummarydata->GetXaxis()->SetBinLabel(38,"m_empl4"); | |
564 | hsummarydata->GetXaxis()->SetBinLabel(39,"dr_excl4"); | |
565 | hsummarydata->GetXaxis()->SetBinLabel(40,"dr_empl4"); | |
566 | hsummarydata->GetXaxis()->SetBinLabel(41,"m_exc-actl4"); | |
567 | hsummarydata->GetXaxis()->SetBinLabel(42,"m_act-empl4"); | |
568 | hsummarydata->GetXaxis()->SetBinLabel(43,"dr_exc-actl4"); | |
569 | hsummarydata->GetXaxis()->SetBinLabel(44,"dr_act-empl4"); | |
570 | hsummarydata->GetXaxis()->SetBinLabel(45,"m_overthl4"); | |
571 | hsummarydata->GetXaxis()->SetBinLabel(46,"dr_overthl4"); | |
572 | hsummarydata->GetXaxis()->LabelsOption("v"); | |
573 | ||
92664bc8 | 574 | rv = fAliITSQADataMakerRec->Add2RawsList(hsummarydata,10+offsRW, expert, !image, !saveCorr); |
8a55554e | 575 | fSDDhRawsTask++; |
576 | fOnlineOffsetRaws = fSDDhRawsTask; | |
577 | ||
578 | //online part | |
579 | if(fkOnline){ | |
580 | //DDL Pattern | |
92664bc8 | 581 | TH2F *hddl = new TH2F("SDDDDLPattern","SDD DDL Pattern ",24,-0.5,11.5,24,-0.5,23.5); //11 |
8a55554e | 582 | hddl->GetXaxis()->SetTitle("Channel"); |
583 | hddl->GetYaxis()->SetTitle("DDL Number"); | |
92664bc8 | 584 | rv = fAliITSQADataMakerRec->Add2RawsList(hddl,fOnlineOffsetRaws+offsRW, expert, !image, !saveCorr); |
8a55554e | 585 | fSDDhRawsTask++; |
586 | Int_t indexlast1 = 0; | |
587 | ||
588 | fTimeBinSize = 4; | |
589 | indexlast = 0; | |
590 | index1 = 0; | |
591 | indexlast1 = fSDDhRawsTask; | |
592 | for(Int_t moduleSDD =0; moduleSDD<fgknSDDmodules; moduleSDD++){ | |
593 | for(Int_t iside=0;iside<fgknSide;iside++){ | |
594 | AliITSgeomTGeo::GetModuleId(moduleSDD+fgkmodoffset, lay, lad, det); | |
595 | TProfile2D *fModuleChargeMapFSE = new TProfile2D(Form("SDDchargeMapFSE_L%d_%d_%d_%d",lay,lad,det,iside),Form("SDDChargeMapForSingleEvent_L%d_%d_%d_%d",lay,lad,det,iside) ,256/fTimeBinSize,-0.5,255.5,256,-0.5,255.5); | |
596 | fModuleChargeMapFSE->GetXaxis()->SetTitle("Time Bin"); | |
597 | fModuleChargeMapFSE->GetYaxis()->SetTitle("Anode"); | |
92664bc8 | 598 | rv = fAliITSQADataMakerRec->Add2RawsList(fModuleChargeMapFSE,indexlast1 + index1 + offsRW, expert, !image, !saveCorr); |
8a55554e | 599 | fSDDhRawsTask++; |
600 | index1++; | |
7a0e5776 | 601 | } |
8a55554e | 602 | } |
7a0e5776 | 603 | |
8a55554e | 604 | for(Int_t moduleSDD =0; moduleSDD<fgknSDDmodules; moduleSDD++){ |
605 | for(Int_t iside=0;iside<fgknSide;iside++){ | |
606 | AliITSgeomTGeo::GetModuleId(moduleSDD+fgkmodoffset, lay, lad, det); | |
607 | TProfile2D *fModuleChargeMap = new TProfile2D(Form("SDDchargeMap_L%d_%d_%d_%d",lay,lad,det,iside),Form("SDDChargeMap_L%d_%d_%d_%d",lay,lad,det,iside),256/fTimeBinSize,-0.5,255.5,256,-0.5,255.5); | |
608 | fModuleChargeMap->GetXaxis()->SetTitle("Time Bin"); | |
609 | fModuleChargeMap->GetYaxis()->SetTitle("Anode Number"); | |
92664bc8 | 610 | rv = fAliITSQADataMakerRec->Add2RawsList(fModuleChargeMap,indexlast1 + index1 + offsRW, expert, !image, !saveCorr); |
8a55554e | 611 | fSDDhRawsTask++; |
612 | index1++; | |
7a0e5776 | 613 | } |
8a55554e | 614 | } |
615 | ||
616 | //Event Size | |
617 | TH1F *hsize = new TH1F("SDDEventSize","SDD Event Size ",500,-0.5,199.5); | |
618 | hsize->SetBit(TH1::kCanRebin); | |
619 | hsize->GetXaxis()->SetTitle("Event Size [kB]"); | |
620 | hsize->GetYaxis()->SetTitle("Entries"); | |
92664bc8 | 621 | rv = fAliITSQADataMakerRec->Add2RawsList(hsize,indexlast1 + index1 + offsRW, expert, !image, !saveCorr); |
8a55554e | 622 | fSDDhRawsTask++; |
623 | ||
624 | } // kONLINE | |
625 | ||
626 | cout << fSDDhRawsTask << " SDD Raws histograms booked" << endl; | |
627 | ||
628 | AliDebug(AliQAv1::GetQADebugLevel(),Form("%d SDD Raws histograms booked\n",fSDDhRawsTask)); | |
92664bc8 | 629 | // |
8a55554e | 630 | return rv ; |
ebdd0606 | 631 | } |
632 | ||
633 | ||
634 | //____________________________________________________________________________ | |
eca4fa66 | 635 | Int_t AliITSQASDDDataMakerRec::MakeRaws(AliRawReader* rawReader) |
ebdd0606 | 636 | { |
637 | // Fill QA for RAW - SDD - | |
3f90b3dc | 638 | Int_t rv = 0; |
92664bc8 | 639 | int offsRW = fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]; |
7555afef | 640 | // Check id histograms already created for this Event Specie |
3f90b3dc | 641 | if(!fDDLModuleMap){CreateTheMap();} |
eca4fa66 | 642 | if(rawReader->GetType() != 7) return rv; // skips non physical triggers |
5379c4a3 | 643 | AliDebug(AliQAv1::GetQADebugLevel(),"entering MakeRaws\n"); |
e41192d7 | 644 | rawReader->Reset(); |
58ceb8ca | 645 | rawReader->Select("ITSSDD"); |
8b7e858c | 646 | AliITSRawStream *stream=AliITSRawStreamSDD::CreateRawStreamSDD(rawReader); |
647 | stream->SetDDLModuleMap(fDDLModuleMap); | |
e41192d7 | 648 | |
ebdd0606 | 649 | Int_t lay, lad, det; |
7a0e5776 | 650 | |
ebdd0606 | 651 | Int_t index=0; |
652 | if(fkOnline) { | |
653 | for(Int_t moduleSDD =0; moduleSDD<fgknSDDmodules; moduleSDD++){ | |
7a0e5776 | 654 | for(Int_t iside=0;iside<fgknSide;iside++) { |
92664bc8 | 655 | if(fSDDhRawsTask > fOnlineOffsetRaws + 1 + index) fAliITSQADataMakerRec->ResetRawsData(fOnlineOffsetRaws + 1 + index +offsRW); |
7a0e5776 | 656 | // 4 because the 2D histos for single events start after the fourth position |
657 | index++; | |
658 | } | |
ebdd0606 | 659 | } |
660 | } | |
e41192d7 | 661 | |
ebdd0606 | 662 | Int_t cnt = 0; |
663 | Int_t ildcID = -1; | |
664 | Int_t iddl = -1; | |
665 | Int_t isddmod = -1; | |
7a0e5776 | 666 | Int_t coord1, coord2, signal, moduleSDD, activeModule, index1; |
58ceb8ca | 667 | //if(fkOnline) |
668 | //{ | |
669 | Int_t prevDDLID = -1; | |
670 | UInt_t size = 0; | |
671 | int totalddl=static_cast<int>(fDDLModuleMap->GetNDDLs()); | |
672 | Bool_t *ddldata=new Bool_t[totalddl]; | |
673 | for(Int_t jddl=0;jddl<totalddl;jddl++){ddldata[jddl]=kFALSE;} | |
674 | //} | |
e41192d7 | 675 | while(stream->Next()) { |
ebdd0606 | 676 | ildcID = rawReader->GetLDCId(); |
58ceb8ca | 677 | iddl = rawReader->GetDDLID();// - fgkDDLIDshift; |
d2f99642 | 678 | if(iddl<0)isddmod=-1; |
3f90b3dc | 679 | //printf("----------------------iddl %i\n",iddl); |
d2f99642 | 680 | else isddmod = fDDLModuleMap->GetModuleNumber(iddl,stream->GetCarlosId()); |
58ceb8ca | 681 | |
ebdd0606 | 682 | if(isddmod==-1){ |
5379c4a3 | 683 | AliDebug(AliQAv1::GetQADebugLevel(),Form("Found module with iddl: %d, stream->GetCarlosId: %d \n",iddl,stream->GetCarlosId())); |
ebdd0606 | 684 | continue; |
685 | } | |
e41192d7 | 686 | if(stream->IsCompletedModule()) { |
5379c4a3 | 687 | AliDebug(AliQAv1::GetQADebugLevel(),Form("IsCompletedModule == KTRUE\n")); |
ebdd0606 | 688 | continue; |
689 | } | |
de075dae | 690 | if(stream->IsCompletedDDL()) { |
58ceb8ca | 691 | if(fkOnline){ |
692 | if ((rawReader->GetDDLID() != prevDDLID)&&(ddldata[iddl])==kFALSE){ | |
693 | size += rawReader->GetDataSize();//in bytes | |
694 | prevDDLID = rawReader->GetDDLID(); | |
695 | ddldata[iddl]=kTRUE; | |
696 | } | |
697 | } | |
5379c4a3 | 698 | AliDebug(AliQAv1::GetQADebugLevel(),Form("IsCompletedDDL == KTRUE\n")); |
de075dae | 699 | continue; |
700 | } | |
ebdd0606 | 701 | |
e41192d7 | 702 | coord1 = stream->GetCoord1(); |
703 | coord2 = stream->GetCoord2(); | |
704 | signal = stream->GetSignal(); | |
ebdd0606 | 705 | |
7a0e5776 | 706 | moduleSDD = isddmod - fgkmodoffset; |
707 | ||
b62d7123 | 708 | if(isddmod <fgkmodoffset|| isddmod>fgknSDDmodules+fgkmodoffset-1) { |
5379c4a3 | 709 | AliDebug(AliQAv1::GetQADebugLevel(),Form( "Module SDD = %d, resetting it to 1 \n",isddmod)); |
b62d7123 | 710 | isddmod = 1; |
ebdd0606 | 711 | } |
7a0e5776 | 712 | |
ebdd0606 | 713 | AliITSgeomTGeo::GetModuleId(isddmod, lay, lad, det); |
e41192d7 | 714 | Short_t iside = stream->GetChannel(); |
ad300de9 | 715 | |
58ceb8ca | 716 | //printf(" \n%i %i %i %i \n ",lay, lad, det,iside ); |
92664bc8 | 717 | fAliITSQADataMakerRec->FillRawsData( 0 + offsRW,isddmod); |
718 | if(lay==3) fAliITSQADataMakerRec->FillRawsData(1+offsRW,det+0.5*iside-0.25,lad); //phiz l3 not norm | |
719 | if(lay==4) fAliITSQADataMakerRec->FillRawsData(2+offsRW,det+0.5*iside-0.25,lad); //phiz l4 not norm | |
58ceb8ca | 720 | |
ebdd0606 | 721 | if(fkOnline) { |
fc89f88c | 722 | |
92664bc8 | 723 | fAliITSQADataMakerRec->FillRawsData(fOnlineOffsetRaws+offsRW, (stream->GetCarlosId())+0.5*iside -0.5,iddl); |
724 | // printf("content ddlmap %d, %d = %f \n",(stream->GetCarlosId()+0.5*iside -0.5),iddl,fAliITSQADataMakerRec->GetRawsData(3+offsRW)->GetBinContent(1+(det-1)*2;lad)); | |
725 | //printf("content ddlmap %d, %d = %f \n",(stream->GetCarlosId())+0.5*iside -0.5,iddl,fAliITSQADataMakerRec->GetRawsData(3+offsRW)->GetBinContent(1+(stream->GetCarlosId()-1)*2,iddl)); | |
7a0e5776 | 726 | activeModule = moduleSDD; |
727 | index1 = activeModule * 2 + iside; | |
728 | ||
729 | if(index1<0){ | |
5379c4a3 | 730 | AliDebug(AliQAv1::GetQADebugLevel(),Form("Wrong index number %d - patched to 0\n",index1)); |
78fb0b3d | 731 | index1 = 0; |
7a0e5776 | 732 | } |
78f8430c | 733 | |
78fb0b3d | 734 | if(fSDDhRawsTask > fOnlineOffsetRaws +1 + index1) { |
92664bc8 | 735 | fAliITSQADataMakerRec->FillRawsData(fOnlineOffsetRaws +1 + index1 +offsRW , coord2, coord1, signal); |
736 | fAliITSQADataMakerRec->FillRawsData(fOnlineOffsetRaws +1 + index1 + 260*2 +offsRW, coord2, coord1, signal); | |
ebdd0606 | 737 | } |
58ceb8ca | 738 | }//online |
7a0e5776 | 739 | cnt++; |
5379c4a3 | 740 | if(!(cnt%10000)) AliDebug(AliQAv1::GetQADebugLevel(),Form(" %d raw digits read",cnt)); |
58ceb8ca | 741 | }//end next() |
92664bc8 | 742 | if(fkOnline){ |
743 | fAliITSQADataMakerRec->FillRawsData(fOnlineOffsetRaws +1 + 260*4 +offsRW,size/1024.);//KB | |
3f90b3dc | 744 | } |
78fb0b3d | 745 | |
5379c4a3 | 746 | AliDebug(AliQAv1::GetQADebugLevel(),Form("Event completed, %d raw digits read",cnt)); |
e41192d7 | 747 | delete stream; |
748 | stream = NULL; | |
8b7e858c | 749 | |
750 | // if(fkOnline) { | |
751 | // AnalyseBNG(); // Analyse Baseline, Noise, Gain | |
752 | // AnalyseINJ(); // Analyse Injectors | |
753 | // } | |
754 | ||
58ceb8ca | 755 | delete []ddldata; |
756 | ddldata=NULL; | |
92664bc8 | 757 | // |
eca4fa66 | 758 | return rv ; |
7a0e5776 | 759 | } |
ebdd0606 | 760 | |
44ed7a66 | 761 | //____________________________________________________________________________ |
eca4fa66 | 762 | Int_t AliITSQASDDDataMakerRec::InitDigits() |
44ed7a66 | 763 | { |
3d0c40f9 | 764 | // if(!fHistoCalibration)InitCalibrationArray(); |
44ed7a66 | 765 | // Initialization for DIGIT data - SDD - |
766 | const Bool_t expert = kTRUE ; | |
767 | const Bool_t image = kTRUE ; | |
eca4fa66 | 768 | Int_t rv = 0 ; |
92664bc8 | 769 | int offsD = fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()]; |
eca4fa66 | 770 | // fGenDigitsOffset = (fAliITSQADataMakerRec->fDigitsQAList[AliRecoParam::kDefault])->GetEntries(); |
44ed7a66 | 771 | //fSDDhTask must be incremented by one unit every time a histogram is ADDED to the QA List |
772 | TH1F* h0=new TH1F("SDD DIGITS Module Pattern","SDD DIGITS Module Pattern",260,239.5,499.5); //hmod | |
773 | h0->GetXaxis()->SetTitle("SDD Module Number"); | |
774 | h0->GetYaxis()->SetTitle("# DIGITS"); | |
92664bc8 | 775 | rv = fAliITSQADataMakerRec->Add2DigitsList(h0,offsD, !expert, image); |
44ed7a66 | 776 | fSDDhDigitsTask ++; |
92664bc8 | 777 | // printf("Add %s \t the task offset is %i\n",fAliITSQADataMakerRec->GetDigitsData(offsD)->GetName() , fSDDhDigitsTask ); |
44ed7a66 | 778 | TH1F* h1=new TH1F("SDD Anode Distribution","DIGITS Anode Distribution",512,-0.5,511.5); //hanocc |
779 | h1->GetXaxis()->SetTitle("Anode Number"); | |
780 | h1->GetYaxis()->SetTitle("# DIGITS"); | |
92664bc8 | 781 | rv = fAliITSQADataMakerRec->Add2DigitsList(h1,1+offsD, !expert, image); |
44ed7a66 | 782 | fSDDhDigitsTask ++; |
92664bc8 | 783 | //printf("Add %s \t the task offset is %i\n",fAliITSQADataMakerRec->GetDigitsData(1+offsD)->GetName() , fSDDhDigitsTask ); |
44ed7a66 | 784 | TH1F* h2=new TH1F("SDD Tbin Distribution","DIGITS Tbin Distribution",256,-0.5,255.5); //htbocc |
785 | h2->GetXaxis()->SetTitle("Tbin Number"); | |
786 | h2->GetYaxis()->SetTitle("# DIGITS"); | |
92664bc8 | 787 | rv = fAliITSQADataMakerRec->Add2DigitsList(h2,2+offsD, !expert, image); |
44ed7a66 | 788 | fSDDhDigitsTask ++; |
92664bc8 | 789 | //printf("Add %s \t the task offset is %i\n",fAliITSQADataMakerRec->GetDigitsData(2+offsD)->GetName() , fSDDhDigitsTask ); |
44ed7a66 | 790 | TH1F* h3=new TH1F("SDD ADC Counts Distribution","DIGITS ADC Counts Distribution",200,0.,1024.); //hsig |
791 | h3->GetXaxis()->SetTitle("ADC Value"); | |
792 | h3->GetYaxis()->SetTitle("# DIGITS"); | |
92664bc8 | 793 | rv = fAliITSQADataMakerRec->Add2DigitsList(h3,3+offsD, !expert, image); |
44ed7a66 | 794 | fSDDhDigitsTask ++; |
92664bc8 | 795 | //printf("Add %s \t the task offset is %i\n",fAliITSQADataMakerRec->GetDigitsData(3+offsD)->GetName() , fSDDhDigitsTask ); |
44ed7a66 | 796 | AliDebug(AliQAv1::GetQADebugLevel(),Form("%d SDD Digits histograms booked\n",fSDDhDigitsTask)); |
92664bc8 | 797 | // |
eca4fa66 | 798 | return rv ; |
44ed7a66 | 799 | } |
800 | ||
801 | //____________________________________________________________________________ | |
eca4fa66 | 802 | Int_t AliITSQASDDDataMakerRec::MakeDigits(TTree * digits) |
44ed7a66 | 803 | { |
7555afef | 804 | |
44ed7a66 | 805 | // Fill QA for DIGIT - SDD - |
fc89f88c | 806 | //AliITS *fITS = (AliITS*)gAlice->GetModule("ITS"); |
807 | //fITS->SetTreeAddress(); | |
808 | //TClonesArray *iITSdigits = fITS->DigitsAddress(1); | |
809 | ||
eca4fa66 | 810 | Int_t rv = 0 ; |
92664bc8 | 811 | int offsD = fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()]; |
fc89f88c | 812 | TBranch *branchD = digits->GetBranch("ITSDigitsSDD"); |
813 | ||
814 | if (!branchD) { | |
815 | AliError("can't get the branch with the ITS SDD digits !"); | |
eca4fa66 | 816 | return rv ; |
44ed7a66 | 817 | } |
eca4fa66 | 818 | // Check id histograms already created for this Event Specie |
8b7e858c | 819 | // if ( ! fAliITSQADataMakerRec->GetDigitsData(fGenDigitsOffset) ) |
820 | // rv = InitDigits() ; | |
eca4fa66 | 821 | |
fc89f88c | 822 | static TClonesArray statDigits("AliITSdigitSDD"); |
44ed7a66 | 823 | TClonesArray *iITSdigits = &statDigits; |
824 | branchD->SetAddress(&iITSdigits); | |
fc89f88c | 825 | |
44ed7a66 | 826 | for(Int_t i=0; i<260; i++){ |
827 | Int_t nmod=i+240; | |
828 | digits->GetEvent(nmod); | |
829 | Int_t ndigits = iITSdigits->GetEntries(); | |
92664bc8 | 830 | fAliITSQADataMakerRec->FillDigitsData(offsD,nmod,ndigits); |
7555afef | 831 | |
44ed7a66 | 832 | for (Int_t idig=0; idig<ndigits; idig++) { |
833 | AliITSdigit *dig=(AliITSdigit*)iITSdigits->UncheckedAt(idig); | |
834 | Int_t iz=dig->GetCoord1(); // cell number z | |
835 | Int_t ix=dig->GetCoord2(); // cell number x | |
836 | Int_t sig=dig->GetSignal(); | |
92664bc8 | 837 | fAliITSQADataMakerRec->FillDigitsData(1+offsD,iz); |
838 | fAliITSQADataMakerRec->FillDigitsData(2+offsD,ix); | |
839 | fAliITSQADataMakerRec->FillDigitsData(3+offsD,sig); | |
44ed7a66 | 840 | } |
841 | } | |
92664bc8 | 842 | // |
eca4fa66 | 843 | return rv ; |
44ed7a66 | 844 | } |
845 | ||
ebdd0606 | 846 | //____________________________________________________________________________ |
eca4fa66 | 847 | Int_t AliITSQASDDDataMakerRec::InitRecPoints() |
ebdd0606 | 848 | { |
3d0c40f9 | 849 | //if(!fHistoCalibration)InitCalibrationArray(); |
8b7e858c | 850 | //AliInfo("Initialize SDD recpoints histos\n"); |
ebdd0606 | 851 | // Initialization for RECPOINTS - SDD - |
7d297381 | 852 | const Bool_t expert = kTRUE ; |
853 | const Bool_t image = kTRUE ; | |
eca4fa66 | 854 | Int_t rv = 0 ; |
92664bc8 | 855 | int offsRP = fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]; |
eca4fa66 | 856 | // fGenRecPointsOffset = (fAliITSQADataMakerRec->fRecPointsQAList[AliRecoParam::kDefault])->GetEntries(); |
ad300de9 | 857 | |
8b7e858c | 858 | //AliInfo(Form("fAliITSQADataMakerRec->GetEventSpecie() %d\n",fAliITSQADataMakerRec->GetEventSpecie())); |
92664bc8 | 859 | //AliInfo(Form("offsRP %d\n",offsRP)); |
be2d913a | 860 | TH1F *h0 = new TH1F("SDDLay3TotCh","Layer 3 total charge",250,-0.5, 499.5); //position number 0 |
3f90b3dc | 861 | //h0->SetBit(TH1::kCanRebin); |
cfb59c70 | 862 | h0->GetXaxis()->SetTitle("KeV"); |
ebdd0606 | 863 | h0->GetYaxis()->SetTitle("Entries"); |
92664bc8 | 864 | rv = fAliITSQADataMakerRec->Add2RecPointsList(h0, 0 +offsRP, !expert, image);//NON expert image |
ad300de9 | 865 | fSDDhRecPointsTask++; |
ebdd0606 | 866 | |
be2d913a | 867 | TH1F *h1 = new TH1F("SDDLay4TotCh","Layer 4 total charge",250,-0.5, 499.5);//position number 1 |
3f90b3dc | 868 | //h1->SetBit(TH1::kCanRebin); |
cfb59c70 | 869 | h1->GetXaxis()->SetTitle("Kev"); |
ebdd0606 | 870 | h1->GetYaxis()->SetTitle("Entries"); |
92664bc8 | 871 | rv = fAliITSQADataMakerRec->Add2RecPointsList(h1, 1 +offsRP, !expert, image);//NON expert image |
ad300de9 | 872 | fSDDhRecPointsTask++; |
ebdd0606 | 873 | |
be2d913a | 874 | TH2F *h2 = new TH2F("SDDGlobalCoordDistribYX","YX Global Coord Distrib",56,-28,28,56,-28,28);//position number 2 |
ebdd0606 | 875 | h2->GetYaxis()->SetTitle("Y[cm]"); |
876 | h2->GetXaxis()->SetTitle("X[cm]"); | |
92664bc8 | 877 | rv = fAliITSQADataMakerRec->Add2RecPointsList(h2,2+offsRP, !expert, image);// NON expert image |
ad300de9 | 878 | fSDDhRecPointsTask++; |
ebdd0606 | 879 | |
be2d913a | 880 | TH2F *h3 = new TH2F("SDDGlobalCoordDistribRZ","RZ Global Coord Distrib",128,-32,32,56,12,26);//position number 3 |
ebdd0606 | 881 | h3->GetYaxis()->SetTitle("R[cm]"); |
882 | h3->GetXaxis()->SetTitle("Z[cm]"); | |
92664bc8 | 883 | rv = fAliITSQADataMakerRec->Add2RecPointsList(h3,3+offsRP, !expert, image);// NON expert image |
ad300de9 | 884 | fSDDhRecPointsTask++; |
ebdd0606 | 885 | |
78fb0b3d | 886 | TH2F *h4 = new TH2F("SDDGlobalCoordDistribL3PHIZ","#varphi Z Global Coord Distrib L3",96,-23,23,112,-TMath::Pi(),TMath::Pi());//position number 4 |
ebdd0606 | 887 | h4->GetYaxis()->SetTitle("#phi[rad]"); |
888 | h4->GetXaxis()->SetTitle("Z[cm]"); | |
92664bc8 | 889 | rv = fAliITSQADataMakerRec->Add2RecPointsList(h4,4+offsRP, !expert, image);//NON expert image |
ad300de9 | 890 | fSDDhRecPointsTask++; |
ebdd0606 | 891 | |
78fb0b3d | 892 | TH2F *h5 = new TH2F("SDDGlobalCoordDistribL4PHIZ","#varphi Z Global Coord Distrib L4",128,-31,31,176,-TMath::Pi(),TMath::Pi());//position number 5 |
ebdd0606 | 893 | h5->GetYaxis()->SetTitle("#phi[rad]"); |
894 | h5->GetXaxis()->SetTitle("Z[cm]"); | |
92664bc8 | 895 | rv = fAliITSQADataMakerRec->Add2RecPointsList(h5,5+offsRP, !expert, image);//NON expert image |
ad300de9 | 896 | fSDDhRecPointsTask++; |
ebdd0606 | 897 | |
92664bc8 | 898 | TH1F *h6 = new TH1F("SDDModPatternRP","Modules pattern RP",fgknSDDmodules,239.5,499.5); //position number 6 |
ebdd0606 | 899 | h6->GetXaxis()->SetTitle("Module number"); //spd offset = 240 |
900 | h6->GetYaxis()->SetTitle("Entries"); | |
8a55554e | 901 | h6->SetOption("bar1"); |
902 | h6->SetBarOffset(0.01); | |
903 | h6->SetBarWidth(0.95); | |
904 | h6->SetFillColor(39); | |
92664bc8 | 905 | rv = fAliITSQADataMakerRec->Add2RecPointsList(h6,6 +offsRP, expert, !image);// expert NO image |
ad300de9 | 906 | fSDDhRecPointsTask++; |
58ceb8ca | 907 | |
3f90b3dc | 908 | |
92664bc8 | 909 | TH2F *h7 = new TH2F("SDDModPatternL3RP","Modules pattern L3 RP",12,0.5,6.5,14,0.5,14.5); //position number 7 |
5af1d436 | 910 | h7->GetXaxis()->SetTitle("z[#Module L3 ]"); |
911 | h7->GetYaxis()->SetTitle("#varphi[#Ladder L3]"); | |
92664bc8 | 912 | rv = fAliITSQADataMakerRec->Add2RecPointsList(h7,7 +offsRP, expert, !image);// expert NO image |
ad300de9 | 913 | fSDDhRecPointsTask++; |
58ceb8ca | 914 | |
92664bc8 | 915 | TH2F *h8 = new TH2F("SDDModPatternL4RP","Modules pattern L4 RP",16,0.5,8.5,22,0.5,22.5); //position number 8 |
5af1d436 | 916 | h8->GetXaxis()->SetTitle("[#Module L3 ]"); |
917 | h8->GetYaxis()->SetTitle("#varphi[#Ladder L4]"); | |
92664bc8 | 918 | rv = fAliITSQADataMakerRec->Add2RecPointsList(h8,8 +offsRP, expert, !image);// expert NO image |
3f90b3dc | 919 | fSDDhRecPointsTask++; |
920 | ||
921 | //------------------------norm--------------------------// | |
922 | ||
923 | ||
92664bc8 | 924 | TH1F *h9 = new TH1F("SDDModPatternRPNORM","Modules pattern RP NORM",fgknSDDmodules,239.5,499.5); //position number 9 |
3f90b3dc | 925 | h9->GetXaxis()->SetTitle("Module number"); //spd offset = 240 |
926 | h9->GetYaxis()->SetTitle("Entries"); | |
8a55554e | 927 | h9->SetOption("bar1"); |
928 | h9->SetBarOffset(0.01); | |
929 | h9->SetBarWidth(0.95); | |
930 | h9->SetFillColor(49); | |
92664bc8 | 931 | rv = fAliITSQADataMakerRec->Add2RecPointsList(h9,9 +offsRP, expert, !image);// expert NO image |
ad300de9 | 932 | fSDDhRecPointsTask++; |
58ceb8ca | 933 | |
3f90b3dc | 934 | |
92664bc8 | 935 | TH2F *h10 = new TH2F("SDDModPatternL3RPNORM","Modules pattern L3 RP NORM",12,0.5,6.5,14,0.5,14.5); //position number 10 |
3f90b3dc | 936 | h10->GetXaxis()->SetTitle("z[#Module L3 ]"); |
937 | h10->GetYaxis()->SetTitle("#varphi[#Ladder L3]"); | |
92664bc8 | 938 | rv = fAliITSQADataMakerRec->Add2RecPointsList(h10,10 +offsRP, expert, !image);// expert NO image |
3f90b3dc | 939 | fSDDhRecPointsTask++; |
940 | ||
92664bc8 | 941 | TH2F *h11 = new TH2F("SDDModPatternL4RPNORM","Modules pattern L4 RP NORM",16,0.5,8.5,22,0.5,22.5); //position number 11 |
78fb0b3d | 942 | h11->GetXaxis()->SetTitle("[#Module L4 ]"); |
3f90b3dc | 943 | h10->GetYaxis()->SetTitle("#varphi[#Ladder L4]"); |
92664bc8 | 944 | rv = fAliITSQADataMakerRec->Add2RecPointsList(h11,11 +offsRP, expert, !image);// expert NO image |
3f90b3dc | 945 | fSDDhRecPointsTask++; |
946 | ||
947 | //--------------------------------------------------------// | |
948 | ||
be2d913a | 949 | TH2F *h12 = new TH2F("SDDLocalCoordDistrib","Local Coord Distrib",160,-4,4,160,-4,4);//position number 12 |
3f90b3dc | 950 | h12->GetXaxis()->SetTitle("X local coord, drift, cm"); |
951 | h12->GetYaxis()->SetTitle("Z local coord, anode, cm"); | |
92664bc8 | 952 | rv = fAliITSQADataMakerRec->Add2RecPointsList(h12,12 +offsRP, expert, !image);// expert NO image |
ad300de9 | 953 | fSDDhRecPointsTask++; |
58ceb8ca | 954 | |
955 | //AliInfo("Create SDD recpoints histos\n"); | |
956 | ||
3f90b3dc | 957 | TH1F *h13 = new TH1F("SDDrdistrib_Layer3" ,"SDD r distribution Layer3" ,100,14.,16.5);//position number 13 (L3) |
958 | h13->SetBit(TH1::kCanRebin); | |
959 | h13->GetXaxis()->SetTitle("r[cm]"); | |
960 | h13->GetXaxis()->CenterTitle(); | |
961 | h13->GetYaxis()->SetTitle("Entries"); | |
92664bc8 | 962 | rv = fAliITSQADataMakerRec->Add2RecPointsList(h13,13 +offsRP, expert, !image);// expert NO image |
58ceb8ca | 963 | fSDDhRecPointsTask++; |
964 | ||
3f90b3dc | 965 | TH1F *h14 = new TH1F("SDDrdistrib_Layer4" ,"SDD r distribution Layer4" ,100,23.,25.);// and position number 14 (L4) |
966 | h14->SetBit(TH1::kCanRebin); | |
967 | h14->GetXaxis()->SetTitle("r[cm]"); | |
968 | h14->GetXaxis()->CenterTitle(); | |
969 | h14->GetYaxis()->SetTitle("Entries"); | |
92664bc8 | 970 | rv = fAliITSQADataMakerRec->Add2RecPointsList(h14,14 +offsRP, expert, !image);// expert NO image |
58ceb8ca | 971 | fSDDhRecPointsTask++; |
972 | ||
ebdd0606 | 973 | for(Int_t iLay=0; iLay<=1; iLay++){ |
d2f99642 | 974 | TH1F *h15 = new TH1F(Form("SDDphidistrib_Layer%d",iLay+3),Form("SDDphidistrib_Layer%d",iLay+3) ,180,-TMath::Pi(),TMath::Pi());//position number 15 (L3) and position number 16 (L4) |
3f90b3dc | 975 | h15->GetXaxis()->SetTitle("#varphi[rad]"); |
976 | h15->GetXaxis()->CenterTitle(); | |
977 | h15->GetYaxis()->SetTitle("Entries"); | |
92664bc8 | 978 | rv = fAliITSQADataMakerRec->Add2RecPointsList(h15,iLay+15+offsRP, expert, !image);// expert NO image |
ad300de9 | 979 | fSDDhRecPointsTask++; |
ebdd0606 | 980 | } |
58ceb8ca | 981 | |
982 | for(Int_t iLay=0; iLay<=1; iLay++){ | |
d2f99642 | 983 | TH1F *h17 = new TH1F(Form("SDDdrifttime_Layer%d",iLay+3),Form("SDDdrifttime_Layer%d",iLay+3),45,-0.5,4499.5);//position number 17 (L3) and position number 18 (L4) |
3f90b3dc | 984 | h17->SetBit(TH1::kCanRebin); |
1e7991d8 | 985 | h17->GetXaxis()->SetTitle("drift time[ns]"); |
3f90b3dc | 986 | h17->GetXaxis()->CenterTitle(); |
987 | h17->GetYaxis()->SetTitle("Entries"); | |
92664bc8 | 988 | rv = fAliITSQADataMakerRec->Add2RecPointsList(h17,iLay+17+offsRP, !expert, image);// NON expert image |
58ceb8ca | 989 | fSDDhRecPointsTask++; |
990 | } | |
991 | ||
78fb0b3d | 992 | Float_t hMax = 0.2; |
993 | ||
994 | TH1F *oL3 = new TH1F("SDDL3_RelativeOccupancy","Layer 3 Relative Occupancy (RecPoints)",200,0.,hMax); | |
92664bc8 | 995 | rv = fAliITSQADataMakerRec->Add2RecPointsList(oL3,fSDDhRecPointsTask+offsRP, expert, !image); // 19 |
78fb0b3d | 996 | fSDDhRecPointsTask++; |
997 | ||
998 | TH1F *oL4 = new TH1F("SDDL4_RelativeOccupancy","Layer 4 Relative Occupancy (RecPoints)",200,0.,hMax); | |
92664bc8 | 999 | rv = fAliITSQADataMakerRec->Add2RecPointsList(oL4,fSDDhRecPointsTask+offsRP, expert, !image); // 20 |
78fb0b3d | 1000 | fSDDhRecPointsTask++; |
1001 | ||
1002 | ||
92664bc8 | 1003 | TH2F *h21 = new TH2F("SDDL3_Rec2Raw_2D","L3 RecPoints to Raws 2D",12,0.5,6.5,14,0.5,14.5); //position number 21 |
78fb0b3d | 1004 | h21->GetXaxis()->SetTitle("z[#Module L3 ]"); |
1005 | h21->GetYaxis()->SetTitle("#varphi[#Ladder L3]"); | |
92664bc8 | 1006 | rv = fAliITSQADataMakerRec->Add2RecPointsList(h21,21 +offsRP, expert, !image);// expert NO image |
78fb0b3d | 1007 | fSDDhRecPointsTask++; |
1008 | ||
92664bc8 | 1009 | TH2F *h22 = new TH2F("SDDL4_Rec2Raw_2D","L4 RecPoints to Raws 2D",16,0.5,8.5,22,0.5,22.5); //position number 22 |
78fb0b3d | 1010 | h22->GetXaxis()->SetTitle("[#Module L4 ]"); |
1011 | h22->GetYaxis()->SetTitle("#varphi[#Ladder L4]"); | |
92664bc8 | 1012 | rv = fAliITSQADataMakerRec->Add2RecPointsList(h22,22 +offsRP, expert, !image);// expert NO image |
78fb0b3d | 1013 | fSDDhRecPointsTask++; |
1014 | ||
1015 | hMax = 0.3; | |
1016 | TH1F *R2RL3 = new TH1F("SDDL3_Rec2Raw","L3 RecPoints to Raws ratio",150,0.,hMax); | |
92664bc8 | 1017 | rv = fAliITSQADataMakerRec->Add2RecPointsList(R2RL3,fSDDhRecPointsTask+offsRP, expert, !image); // 23 |
78fb0b3d | 1018 | fSDDhRecPointsTask++; |
1019 | ||
1020 | TH1F *R2RL4 = new TH1F("SDDL4_Rec2Raw","L4 RecPoints to Raws ratio",150,0.,hMax); | |
92664bc8 | 1021 | rv = fAliITSQADataMakerRec->Add2RecPointsList(R2RL4,fSDDhRecPointsTask+offsRP, expert, !image); // 24 |
78fb0b3d | 1022 | fSDDhRecPointsTask++; |
1023 | ||
1024 | TH1F *dedxL3 = new TH1F("SDDL3_dedx","L3 dE/dX",100,0.,1.); | |
92664bc8 | 1025 | rv = fAliITSQADataMakerRec->Add2RecPointsList(dedxL3,fSDDhRecPointsTask+offsRP, expert, !image); // 25 |
78fb0b3d | 1026 | fSDDhRecPointsTask++; |
1027 | ||
1028 | TH1F *dedxL4 = new TH1F("SDDL4_dedx","L4 dE/dX",100,0.,1.); | |
92664bc8 | 1029 | rv = fAliITSQADataMakerRec->Add2RecPointsList(dedxL4,fSDDhRecPointsTask+offsRP, expert, !image); // 26 |
78fb0b3d | 1030 | fSDDhRecPointsTask++; |
1031 | ||
8a55554e | 1032 | |
1033 | TH1F *hsummarydatarp = new TH1F("SDDRecPointCheck","SDDRecPointCheck",50,-0.5,49.5);//27 summary of recpoint checks | |
1034 | hsummarydatarp->GetXaxis()->SetLabelSize(0.02); | |
1035 | hsummarydatarp->GetXaxis()->SetTickLength(0.01); | |
1036 | hsummarydatarp->GetXaxis()->SetNdivisions(110); | |
1037 | hsummarydatarp->GetXaxis()->SetTicks("-"); | |
1038 | hsummarydatarp->GetYaxis()->SetLabelSize(0.02); | |
1039 | hsummarydatarp->GetYaxis()->SetTitleSize(0.02); | |
1040 | hsummarydatarp->GetYaxis()->SetTitleOffset(1.5); | |
1041 | hsummarydatarp->GetYaxis()->SetTitle("#events(norm) or #modules (m) or #drift regions (dr)"); | |
1042 | hsummarydatarp->SetStats(0); | |
1043 | hsummarydatarp->SetMaximum(272); | |
1044 | ||
1045 | hsummarydatarp->SetOption("text bar1 hist"); | |
1046 | hsummarydatarp->SetBarOffset(0.05); | |
1047 | hsummarydatarp->SetBarWidth(0.95); | |
1048 | hsummarydatarp->SetFillColor(32); | |
1049 | hsummarydatarp->SetMinimum(0.); | |
1050 | ||
1051 | //information about the events | |
1052 | hsummarydatarp->GetXaxis()->SetBinLabel(1,"Events"); | |
1053 | hsummarydatarp->GetXaxis()->SetBinLabel(2,"Ent_NORM"); | |
1054 | hsummarydatarp->GetXaxis()->SetBinLabel(3,"Ent_NORML3"); | |
1055 | hsummarydatarp->GetXaxis()->SetBinLabel(4,"Ent_NORML4"); | |
1056 | //all | |
1057 | ||
1058 | hsummarydatarp->GetXaxis()->SetBinLabel(5, "m_act"); | |
1059 | hsummarydatarp->GetXaxis()->SetBinLabel(6, "m_fil"); | |
1060 | hsummarydatarp->GetXaxis()->SetBinLabel(7, "dr_act"); | |
1061 | hsummarydatarp->GetXaxis()->SetBinLabel(8, "dr_fil"); | |
1062 | hsummarydatarp->GetXaxis()->SetBinLabel(9, "m_exc"); | |
1063 | hsummarydatarp->GetXaxis()->SetBinLabel(10,"m_emp"); | |
1064 | hsummarydatarp->GetXaxis()->SetBinLabel(11,"dr_exc"); | |
1065 | hsummarydatarp->GetXaxis()->SetBinLabel(12,"dr_emp"); | |
1066 | hsummarydatarp->GetXaxis()->SetBinLabel(13,"m_exc-act"); | |
1067 | hsummarydatarp->GetXaxis()->SetBinLabel(14,"m_act-emp"); | |
1068 | hsummarydatarp->GetXaxis()->SetBinLabel(15,"dr_exc-act"); | |
1069 | hsummarydatarp->GetXaxis()->SetBinLabel(16,"dr_act-emp"); | |
1070 | hsummarydatarp->GetXaxis()->SetBinLabel(17,"m_overth"); | |
1071 | hsummarydatarp->GetXaxis()->SetBinLabel(18,"dr_overth"); | |
1072 | ||
1073 | //l3 | |
1074 | ||
1075 | hsummarydatarp->GetXaxis()->SetBinLabel(19,"m_actl3"); | |
1076 | hsummarydatarp->GetXaxis()->SetBinLabel(20,"m_fill3"); | |
1077 | hsummarydatarp->GetXaxis()->SetBinLabel(21,"dr_actl3"); | |
1078 | hsummarydatarp->GetXaxis()->SetBinLabel(22,"dr_fill3"); | |
1079 | hsummarydatarp->GetXaxis()->SetBinLabel(23,"m_excl3"); | |
1080 | hsummarydatarp->GetXaxis()->SetBinLabel(24,"m_empl3"); | |
1081 | hsummarydatarp->GetXaxis()->SetBinLabel(25,"dr_excl3"); | |
1082 | hsummarydatarp->GetXaxis()->SetBinLabel(26,"dr_empl3"); | |
1083 | hsummarydatarp->GetXaxis()->SetBinLabel(27,"m_exc-actl3"); | |
1084 | hsummarydatarp->GetXaxis()->SetBinLabel(28,"m_act-empl3"); | |
1085 | hsummarydatarp->GetXaxis()->SetBinLabel(29,"dr_exc-actl3"); | |
1086 | hsummarydatarp->GetXaxis()->SetBinLabel(30,"dr_act-empl3"); | |
1087 | hsummarydatarp->GetXaxis()->SetBinLabel(31,"meanch_l3"); | |
1088 | hsummarydatarp->GetXaxis()->SetBinLabel(32,"meanrad_l3"); | |
1089 | hsummarydatarp->GetXaxis()->SetBinLabel(33,"m_overthl3"); | |
1090 | hsummarydatarp->GetXaxis()->SetBinLabel(34,"dr_overthl3"); | |
1091 | ||
1092 | //l4 | |
1093 | ||
1094 | hsummarydatarp->GetXaxis()->SetBinLabel(35,"m_actl4"); | |
1095 | hsummarydatarp->GetXaxis()->SetBinLabel(36,"m_fill4"); | |
1096 | hsummarydatarp->GetXaxis()->SetBinLabel(37,"dr_actl4"); | |
1097 | hsummarydatarp->GetXaxis()->SetBinLabel(38,"dr_fill4"); | |
1098 | hsummarydatarp->GetXaxis()->SetBinLabel(39,"m_excl4"); | |
1099 | hsummarydatarp->GetXaxis()->SetBinLabel(40,"m_empl4"); | |
1100 | hsummarydatarp->GetXaxis()->SetBinLabel(41,"dr_excl4"); | |
1101 | hsummarydatarp->GetXaxis()->SetBinLabel(42,"dr_empl4"); | |
1102 | hsummarydatarp->GetXaxis()->SetBinLabel(43,"m_exc-actl4"); | |
1103 | hsummarydatarp->GetXaxis()->SetBinLabel(44,"m_act-empl4"); | |
1104 | hsummarydatarp->GetXaxis()->SetBinLabel(45,"dr_exc-actl4"); | |
1105 | hsummarydatarp->GetXaxis()->SetBinLabel(46,"dr_act-empl4"); | |
1106 | hsummarydatarp->GetXaxis()->SetBinLabel(47,"meanch_l4"); | |
1107 | hsummarydatarp->GetXaxis()->SetBinLabel(48,"meanrad_l4"); | |
1108 | hsummarydatarp->GetXaxis()->SetBinLabel(49,"m_overthl4"); | |
1109 | hsummarydatarp->GetXaxis()->SetBinLabel(50,"dr_overthl4"); | |
1110 | ||
1111 | hsummarydatarp->GetXaxis()->LabelsOption("v"); | |
1112 | ||
92664bc8 | 1113 | rv = fAliITSQADataMakerRec->Add2RecPointsList(hsummarydatarp,fSDDhRecPointsTask+offsRP, expert, !image);// expert NO image |
8a55554e | 1114 | |
1115 | ||
1116 | ||
1117 | fSDDhRecPointsTask++; | |
1118 | ||
92664bc8 | 1119 | fOnlineOffsetRecPoints = fSDDhRecPointsTask; |
1120 | if(fkOnline){ | |
1121 | TH2F *h19 = new TH2F("SDDGlobalCoordDistribYXFSE","YX Global Coord Distrib FSE",112,-28,28,112,-28,28);//position number 27 | |
1122 | h19->GetYaxis()->SetTitle("Y[cm]"); | |
1123 | h19->GetXaxis()->SetTitle("X[cm]"); | |
1124 | rv = fAliITSQADataMakerRec->Add2RecPointsList(h19,fSDDhRecPointsTask+offsRP, expert, !image);// expert NO image | |
1125 | fSDDhRecPointsTask++; | |
1126 | ||
1127 | TH2F *h20 = new TH2F("SDDGlobalCoordDistribRZFSE","RZ Global Coord Distrib FSE",128,-32,32,56,12,26);//position number 28 | |
1128 | h20->GetYaxis()->SetTitle("R[cm]"); | |
1129 | h20->GetXaxis()->SetTitle("Z[cm]"); | |
1130 | rv = fAliITSQADataMakerRec->Add2RecPointsList(h20,fSDDhRecPointsTask+offsRP, expert, !image);// expert NO image | |
1131 | fSDDhRecPointsTask++; | |
1132 | }//online | |
58ceb8ca | 1133 | |
5379c4a3 | 1134 | AliDebug(AliQAv1::GetQADebugLevel(),Form("%d SDD Recs histograms booked\n",fSDDhRecPointsTask)); |
92664bc8 | 1135 | // |
eca4fa66 | 1136 | return rv ; |
ebdd0606 | 1137 | } |
1138 | ||
1139 | //____________________________________________________________________________ | |
eca4fa66 | 1140 | Int_t AliITSQASDDDataMakerRec::MakeRecPoints(TTree * clustersTree) |
7a0e5776 | 1141 | { |
ebdd0606 | 1142 | // Fill QA for RecPoints - SDD - |
3f90b3dc | 1143 | Int_t rv = 0 ; |
ebdd0606 | 1144 | Int_t lay, lad, det; |
8b7e858c | 1145 | //AliInfo("get the branch with the ITS clusters !\n"); |
e62fe478 | 1146 | AliITSRecPointContainer* rpcont=AliITSRecPointContainer::Instance(); |
aa444532 | 1147 | TClonesArray *recpoints=NULL; |
3f90b3dc | 1148 | if(fkOnline){recpoints = rpcont->FetchClusters(0,clustersTree,fAliITSQADataMakerRec->GetEventNumber());} |
1149 | else{recpoints = rpcont->FetchClusters(0,clustersTree);} | |
7fa9b948 | 1150 | AliDebug(10,Form("Fetched RecPoints for %d SDD modules",recpoints->GetEntriesFast())); |
e62fe478 | 1151 | if(!rpcont->GetStatusOK() || !rpcont->IsSDDActive()){ |
1152 | AliError("can't get SDD clusters !"); | |
1153 | return rv; | |
ebdd0606 | 1154 | } |
92664bc8 | 1155 | int offsRP = fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]; |
ebdd0606 | 1156 | Int_t npoints = 0; |
1157 | Float_t cluglo[3]={0.,0.,0.}; | |
3f90b3dc | 1158 | if(fkOnline){ |
92664bc8 | 1159 | for(Int_t i=28;i<30;i++) fAliITSQADataMakerRec->ResetRecPointsData(i+offsRP); |
1160 | } | |
e917bef4 | 1161 | // AliITSgeomTGeo::GetModuleIndex() issues an error in case the arguments |
1162 | // are illegal and returns -1 | |
1163 | Int_t firMod=TMath::Max(0,AliITSgeomTGeo::GetModuleIndex(3,1,1)); | |
e62fe478 | 1164 | Int_t lasMod=AliITSgeomTGeo::GetModuleIndex(5,1,1); |
1165 | for(Int_t module=firMod; module<lasMod;module++){ | |
58ceb8ca | 1166 | //AliInfo(Form("Module %d\n",module)); |
e62fe478 | 1167 | recpoints = rpcont->UncheckedGetClusters(module); |
58ceb8ca | 1168 | npoints += recpoints->GetEntries(); |
58ceb8ca | 1169 | for(Int_t j=0;j<recpoints->GetEntries();j++){ |
80b9610c | 1170 | AliITSRecPoint *recp = (AliITSRecPoint*)recpoints->At(j); |
1171 | Int_t index = recp->GetDetectorIndex(); | |
1172 | lay=recp->GetLayer(); | |
92664bc8 | 1173 | if(lay < 2 || lay > 3) continue; |
1174 | Int_t modnumb=index+AliITSgeomTGeo::GetModuleIndex(lay+1,1,1); | |
1175 | AliITSgeomTGeo::GetModuleId(modnumb, lay, lad, det); | |
1176 | // AliInfo(Form("modnumb %d, lay %d, lad %d, det %d \n",module, lay, lad, det)); | |
1177 | fAliITSQADataMakerRec->FillRecPointsData(6 +offsRP,modnumb);//modpatternrp | |
58ceb8ca | 1178 | recp->GetGlobalXYZ(cluglo); |
1179 | Float_t rad=TMath::Sqrt(cluglo[0]*cluglo[0]+cluglo[1]*cluglo[1]); | |
1180 | Float_t phi=TMath::ATan2(cluglo[1],cluglo[0]); | |
1181 | Float_t drifttime=recp->GetDriftTime(); | |
92664bc8 | 1182 | fAliITSQADataMakerRec->FillRecPointsData(12 +offsRP,recp->GetDetLocalX(),recp->GetDetLocalZ());//local distribution |
1183 | fAliITSQADataMakerRec->FillRecPointsData(2 +offsRP,cluglo[0],cluglo[1]);//global distribution YX | |
1184 | fAliITSQADataMakerRec->FillRecPointsData(3 +offsRP,cluglo[2],rad);//global distribution rz | |
1185 | if(fkOnline) { | |
1186 | fAliITSQADataMakerRec->FillRecPointsData(28 +offsRP,cluglo[0],cluglo[1]);//global distribution YX FSE | |
1187 | fAliITSQADataMakerRec->FillRecPointsData(29 +offsRP,cluglo[2],rad);//global distribution rz FSE | |
1188 | } | |
1189 | Int_t iside=recp->GetDriftSide(); | |
1190 | lay=recp->GetLayer(); | |
1191 | if(lay == 2) { | |
1192 | fAliITSQADataMakerRec->FillRecPointsData(0 +offsRP, recp->GetQ()) ;//total charge of layer 3 | |
1193 | fAliITSQADataMakerRec->FillRecPointsData(7 +offsRP, det+0.5*iside-0.5,lad);//mod pattern layer 3 | |
1194 | fAliITSQADataMakerRec->FillRecPointsData(13 +offsRP, rad);//r distribution layer 3 | |
1195 | fAliITSQADataMakerRec->FillRecPointsData(15 +offsRP, phi);// phi distribution layer 3 | |
1196 | fAliITSQADataMakerRec->FillRecPointsData(4 +offsRP, cluglo[2],phi);// zphi distribution layer | |
1197 | fAliITSQADataMakerRec->FillRecPointsData(17 +offsRP, drifttime);// time distribution layer 3 | |
1198 | fAliITSQADataMakerRec->FillRecPointsData(25 +offsRP, recp->GetdEdX());// charge distribution layer 3 | |
1199 | } else if(lay == 3) { | |
1200 | fAliITSQADataMakerRec->FillRecPointsData(1 +offsRP, recp->GetQ()) ;//total charge layer 4 | |
1201 | fAliITSQADataMakerRec->FillRecPointsData(8 +offsRP, det+0.5*iside-0.5,lad);//mod pattern layer 4 | |
1202 | fAliITSQADataMakerRec->FillRecPointsData(14 +offsRP, rad);//r distribution | |
1203 | fAliITSQADataMakerRec->FillRecPointsData(16 +offsRP, phi);//phi distribution | |
1204 | fAliITSQADataMakerRec->FillRecPointsData(5 +offsRP, cluglo[2],phi);// zphi distribution layer 4 | |
1205 | fAliITSQADataMakerRec->FillRecPointsData(18 +offsRP, drifttime);// time distribution layer 4 | |
1206 | fAliITSQADataMakerRec->FillRecPointsData(26 +offsRP, recp->GetdEdX());// charge distribution layer 4 | |
58ceb8ca | 1207 | } |
1208 | } | |
1209 | } | |
92664bc8 | 1210 | // |
58ceb8ca | 1211 | return rv ; |
ebdd0606 | 1212 | } |
1213 | ||
ad300de9 | 1214 | //_______________________________________________________________ |
92664bc8 | 1215 | Int_t AliITSQASDDDataMakerRec::GetOffset(AliQAv1::TASKINDEX_t task, Int_t specie) const |
7a0e5776 | 1216 | { |
cfb59c70 | 1217 | // Returns offset number according to the specified task |
ad300de9 | 1218 | Int_t offset=0; |
3f90b3dc | 1219 | if( task == AliQAv1::kRAWS ){offset=fGenRawsOffset[specie];} |
1220 | else if(task == AliQAv1::kDIGITSR ){offset=fGenDigitsOffset[specie];} | |
1221 | else if( task == AliQAv1::kRECPOINTS ){offset=fGenRecPointsOffset[specie];} | |
ad300de9 | 1222 | return offset; |
1223 | } | |
1224 | ||
1225 | //_______________________________________________________________ | |
8b7e858c | 1226 | void AliITSQASDDDataMakerRec::SetOffset(AliQAv1::TASKINDEX_t task, Int_t offset, Int_t specie) { |
cfb59c70 | 1227 | // Set offset number according to the specified task |
3f90b3dc | 1228 | if( task == AliQAv1::kRAWS ) {fGenRawsOffset[specie]=offset;} |
1229 | else if( task == AliQAv1::kDIGITSR ) {fGenDigitsOffset[specie]=offset;} | |
1230 | else if( task == AliQAv1::kRECPOINTS ) {fGenRecPointsOffset[specie]=offset;} | |
eca4fa66 | 1231 | } |
1232 | ||
1233 | //_______________________________________________________________ | |
4e25ac79 | 1234 | Int_t AliITSQASDDDataMakerRec::GetTaskHisto(AliQAv1::TASKINDEX_t task) |
7a0e5776 | 1235 | { |
cfb59c70 | 1236 | //return the number of histo booked for a given Task |
7a0e5776 | 1237 | Int_t histotot=0; |
3f90b3dc | 1238 | if( task == AliQAv1::kRAWS ){ histotot=fSDDhRawsTask ;} |
1239 | else if(task == AliQAv1::kDIGITSR) { histotot=fSDDhDigitsTask;} | |
1240 | else if( task == AliQAv1::kRECPOINTS ){ histotot=fSDDhRecPointsTask;} | |
1241 | else {AliInfo("No task has been selected. TaskHisto set to zero.\n");} | |
ad300de9 | 1242 | return histotot; |
e41192d7 | 1243 | } |
8b7e858c | 1244 | |
58ceb8ca | 1245 | |
1246 | //_______________________________________________________________ | |
58ceb8ca | 1247 | void AliITSQASDDDataMakerRec::CreateTheMap() |
1248 | { | |
cfb59c70 | 1249 | //Create the SDD DDL Module Map |
58ceb8ca | 1250 | AliCDBEntry *ddlMapSDD = AliCDBManager::Instance()->Get("ITS/Calib/DDLMapSDD"); |
1251 | Bool_t cacheStatus = AliCDBManager::Instance()->GetCacheFlag(); | |
3f90b3dc | 1252 | if(!ddlMapSDD){ |
58ceb8ca | 1253 | AliError("Calibration object retrieval failed! SDD will not be processed"); |
1254 | fDDLModuleMap = NULL; | |
1255 | //return rv; | |
1256 | } | |
d2f99642 | 1257 | else{ |
1258 | fDDLModuleMap = (AliITSDDLModuleMapSDD*)ddlMapSDD->GetObject(); | |
1259 | if(!cacheStatus)ddlMapSDD->SetObject(NULL); | |
1260 | ddlMapSDD->SetOwner(kTRUE); | |
1261 | if(!cacheStatus){ delete ddlMapSDD;} | |
1262 | AliInfo("DDL Map Created\n "); | |
1263 | } | |
58ceb8ca | 1264 | } |
5af1d436 | 1265 | |
3f90b3dc | 1266 | //_______________________________________________________________ |
3f90b3dc | 1267 | void AliITSQASDDDataMakerRec::CreateTheCalibration() |
1268 | { | |
cfb59c70 | 1269 | //Take from the OCDB the calibration information for the SDD |
3f90b3dc | 1270 | AliCDBEntry *calibSDD = AliCDBManager::Instance()->Get("ITS/Calib/CalibSDD"); |
1271 | Bool_t cacheStatus = AliCDBManager::Instance()->GetCacheFlag(); | |
1272 | if(!calibSDD) | |
1273 | { | |
1274 | AliError("Calibration object retrieval failed! SDD will not be processed"); | |
d2f99642 | 1275 | fCalibration = NULL; |
3f90b3dc | 1276 | } |
d2f99642 | 1277 | else{ |
1278 | fCalibration = (TObjArray *)calibSDD->GetObject(); | |
1279 | ||
1280 | if(!cacheStatus)calibSDD->SetObject(NULL); | |
1281 | calibSDD->SetOwner(kTRUE); | |
1282 | if(!cacheStatus){delete calibSDD;} | |
1283 | ||
1284 | AliITSCalibrationSDD * cal=NULL; | |
1285 | for(Int_t imod=0;imod<fgknSDDmodules;imod++) | |
1286 | { | |
1287 | //cal=NULL; | |
1288 | Int_t fillmodhisto1=fgkTotalNumberSDDAnodes; | |
1289 | Int_t fillmodhisto2side0=fgkNumberOfSDDAnodesperSide; | |
1290 | Int_t fillmodhisto2side1=fgkNumberOfSDDAnodesperSide; | |
1291 | Int_t fillmodhisto3side0=fgkNumberOfSDDAnodesperSide; | |
1292 | Int_t fillmodhisto3side1=fgkNumberOfSDDAnodesperSide; | |
1293 | ||
1294 | Int_t badmodhisto1=0; | |
1295 | Int_t badmodhisto2side0=0; | |
1296 | Int_t badmodhisto2side1=0; | |
1297 | Int_t badmodhisto3side0=0; | |
1298 | Int_t badmodhisto3side1=0; | |
1299 | //printf("imod %i\t ==== \t",imod); | |
1300 | Int_t module=imod + 240; | |
1301 | //printf("module %i\t ==== \t",module); | |
1302 | cal=(AliITSCalibrationSDD*)fCalibration->At(imod); | |
1303 | Int_t lay,lad,det; | |
1304 | AliITSgeomTGeo::GetModuleId(module,lay,lad,det); | |
1305 | Int_t index=1+(det-1)*2; | |
1306 | if(cal==0){continue;} | |
1307 | if (cal->IsBad()){continue;}//bad module check | |
1308 | else{ | |
1309 | for(Int_t i=0;i<8;i++) //check on bad chips in good modules | |
1310 | { | |
1311 | if(lay==3){ | |
1312 | if(cal->IsChipBad(i)){ | |
1313 | if(i<4){badmodhisto2side0+=64;} | |
1314 | if(i>=4){badmodhisto2side1+=64;} | |
1315 | }//end if chip | |
1316 | }//end if layer3 | |
1317 | else if(lay==4){ | |
1318 | if(cal->IsChipBad(i)){ | |
1319 | if(i<4){badmodhisto3side0+=64;} | |
1320 | if(i>=4){badmodhisto3side1+=64;} | |
1321 | }//end if chip | |
1322 | }//ens if layer4 | |
1323 | }//end for chip | |
1324 | for(Int_t iAn=0; iAn<512; iAn++){//anodes loop | |
1325 | Int_t ic=cal->GetChip(iAn);//chip with this anode number | |
1326 | if(!cal->IsChipBad(ic) && !cal->IsBad() && cal->IsBadChannel(iAn)){// good chip good module bad channel | |
1327 | if(lay==3){ | |
3f90b3dc | 1328 | if(ic<4) badmodhisto2side0++; |
1329 | else if(ic>=4)badmodhisto2side1++; | |
1330 | }//end if layer 3 | |
d2f99642 | 1331 | else if(lay==4){ |
3f90b3dc | 1332 | if(ic<4) badmodhisto3side0++; |
1333 | else if(ic>=4)badmodhisto3side1++; | |
1334 | }//end if layer 4 | |
d2f99642 | 1335 | }//end if chip module channel |
1336 | }//end for anodes | |
1337 | if(lay==3){ | |
1338 | badmodhisto1=badmodhisto2side0+badmodhisto2side1; | |
1339 | fillmodhisto1-=badmodhisto1; | |
1340 | fillmodhisto2side0-=badmodhisto2side0; | |
1341 | fillmodhisto2side1-=badmodhisto2side1; | |
92664bc8 | 1342 | ((TH1F*)(fHistoCalibration->At(0)))->SetBinContent(imod+1,fillmodhisto1); |
1343 | ((TH2F*)(fHistoCalibration->At(1)))->SetBinContent(index,lad,fillmodhisto2side0); | |
1344 | ((TH2F*)(fHistoCalibration->At(1)))->SetBinContent(index+1,lad,fillmodhisto2side1); | |
d2f99642 | 1345 | }//end layer 3 |
1346 | else if(lay==4){ | |
1347 | badmodhisto1=badmodhisto3side0+badmodhisto3side1; | |
1348 | fillmodhisto1-=badmodhisto1; | |
1349 | fillmodhisto3side0-=badmodhisto3side0; | |
1350 | fillmodhisto3side1-=badmodhisto3side1; | |
92664bc8 | 1351 | ((TH1F*)(fHistoCalibration->At(0)))->SetBinContent(imod+1,fillmodhisto1); |
1352 | ((TH2F*)(fHistoCalibration->At(2)))->SetBinContent(index,lad,fillmodhisto3side0); | |
1353 | ((TH2F*)(fHistoCalibration->At(2)))->SetBinContent(index+1,lad,fillmodhisto3side1); | |
d2f99642 | 1354 | }//end layer 4 |
1355 | }//end else bad module | |
1356 | }//end module for | |
1357 | } | |
8a55554e | 1358 | |
3f90b3dc | 1359 | } |
1360 | ||
1361 | //____________________________________________________________________ | |
3f90b3dc | 1362 | void AliITSQASDDDataMakerRec::InitCalibrationArray() |
1363 | { | |
cfb59c70 | 1364 | //create the histograms with the calibration informations. The histograms are stored in a TObjArray |
92664bc8 | 1365 | TH1F *pattern1 = new TH1F("CALSDDModPattern","Calibration HW Modules pattern",fgknSDDmodules,239.5,499.5); |
f2fafc64 | 1366 | pattern1->SetDirectory(0) ; |
92664bc8 | 1367 | TH2F *patternl3 = new TH2F("CALSDDphizL3","Calibration SDD #varphiz Layer3 ",12,0.5,6.5,14,0.5,14.5); |
f2fafc64 | 1368 | patternl3->SetDirectory(0) ; |
92664bc8 | 1369 | TH2F *patternl4 = new TH2F("CALSDDphizL4"," Calibration SDD #varphiz Layer4 ",16,0.5,8.5,22,0.5,22.5); |
f2fafc64 | 1370 | patternl4->SetDirectory(0) ; |
3f90b3dc | 1371 | |
f2fafc64 | 1372 | if(!fHistoCalibration)fHistoCalibration = new TObjArray(3); |
3f90b3dc | 1373 | fHistoCalibration->AddAtAndExpand(pattern1,0); |
1374 | fHistoCalibration->AddAtAndExpand(patternl3,1); | |
1375 | fHistoCalibration->AddAtAndExpand(patternl4,2); | |
f2fafc64 | 1376 | fHistoCalibration->SetOwner(kTRUE); |
fad6e2fc | 1377 | // printf("Calibration Histograms created!\n"); |
3f90b3dc | 1378 | } |
5af1d436 | 1379 | |
1380 | //____________________________________________________________________ | |
5af1d436 | 1381 | void AliITSQASDDDataMakerRec::ResetDetector(AliQAv1::TASKINDEX_t task) |
1382 | { | |
cfb59c70 | 1383 | //reset the SDD calibration histograms |
5af1d436 | 1384 | AliInfo(Form("Reset detector in SDD called for task index %i", task)); |
1385 | if(task== AliQAv1::kRAWS ){ | |
d2f99642 | 1386 | fDDLModuleMap=NULL; |
3d0c40f9 | 1387 | } |
d2f99642 | 1388 | |
3f90b3dc | 1389 | fCalibration=NULL; |
3d0c40f9 | 1390 | |
92664bc8 | 1391 | ((TH1F*)(fHistoCalibration->At(0)))->Reset(); |
1392 | ((TH2F*)(fHistoCalibration->At(1)))->Reset(); | |
1393 | ((TH2F*)(fHistoCalibration->At(2)))->Reset(); | |
f2fafc64 | 1394 | //delete fHistoCalibration; |
1395 | //fHistoCalibration=NULL; | |
3d0c40f9 | 1396 | |
5af1d436 | 1397 | } |
be2d913a | 1398 | |
8a55554e | 1399 | //____________________________________________________________________ |
1400 | ||
92664bc8 | 1401 | Int_t AliITSQASDDDataMakerRec::GetNumberOfEvents(AliQAv1::TASKINDEX_t task, Int_t trigCl) |
8a55554e | 1402 | { |
92664bc8 | 1403 | //return the number of the processed events for a given task and trigger class (-1 for all) |
a6a921e0 | 1404 | return fAliITSQADataMakerRec->GetEvCountTotal(task, trigCl); |
8a55554e | 1405 | } |