]>
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> |
30 | #include <TH2D.h> | |
58ceb8ca | 31 | #include <TH1F.h> |
ebdd0606 | 32 | #include <TBranch.h> |
33 | #include <TTree.h> | |
34 | #include <TGaxis.h> | |
35 | #include <TMath.h> | |
8b7e858c | 36 | #include <TF1.h> |
ebdd0606 | 37 | #include <TDirectory.h> |
e41192d7 | 38 | #include <TSystem.h> |
ebdd0606 | 39 | // --- Standard library --- |
40 | ||
41 | // --- AliRoot header files --- | |
42 | #include "AliITSQASDDDataMakerRec.h" | |
43 | #include "AliLog.h" | |
4e25ac79 | 44 | #include "AliQAv1.h" |
ebdd0606 | 45 | #include "AliQAChecker.h" |
46 | #include "AliRawReader.h" | |
e41192d7 | 47 | #include "AliITSRawStream.h" |
ebdd0606 | 48 | #include "AliITSRawStreamSDD.h" |
e41192d7 | 49 | #include "AliITSRawStreamSDDCompressed.h" |
50 | #include "AliITSDetTypeRec.h" | |
5192f264 | 51 | #include "AliITSdigit.h" |
ebdd0606 | 52 | #include "AliITSRecPoint.h" |
e62fe478 | 53 | #include "AliITSRecPointContainer.h" |
ebdd0606 | 54 | #include "AliITSgeomTGeo.h" |
ebdd0606 | 55 | #include "AliCDBManager.h" |
56 | #include "AliCDBStorage.h" | |
57 | #include "AliCDBEntry.h" | |
ad300de9 | 58 | #include "Riostream.h" |
fc89f88c | 59 | #include "AliITSdigitSDD.h" |
60 | #include "AliITS.h" | |
61 | #include "AliRunLoader.h" | |
62 | #include "AliITSLoader.h" | |
63 | #include "AliITSDetTypeRec.h" | |
64 | ||
65 | ||
ebdd0606 | 66 | |
67 | ClassImp(AliITSQASDDDataMakerRec) | |
68 | ||
69 | //____________________________________________________________________________ | |
70 | AliITSQASDDDataMakerRec::AliITSQASDDDataMakerRec(AliITSQADataMakerRec *aliITSQADataMakerRec, Bool_t kMode, Short_t ldc) : | |
71 | TObject(), | |
72 | fAliITSQADataMakerRec(aliITSQADataMakerRec), | |
73 | fkOnline(kMode), | |
74 | fLDC(ldc), | |
ad300de9 | 75 | fSDDhRawsTask(0), |
44ed7a66 | 76 | fSDDhDigitsTask(0), |
ad300de9 | 77 | fSDDhRecPointsTask(0), |
ad300de9 | 78 | fGenRawsOffset(0), |
44ed7a66 | 79 | fGenDigitsOffset(0), |
ad300de9 | 80 | fGenRecPointsOffset(0), |
ebdd0606 | 81 | fTimeBinSize(1), |
5af1d436 | 82 | fDDLModuleMap(0) |
ebdd0606 | 83 | { |
84 | //ctor used to discriminate OnLine-Offline analysis | |
8b7e858c | 85 | if(fLDC < 0 || fLDC > 6) { |
ebdd0606 | 86 | AliError("Error: LDC number out of range; return\n"); |
87 | } | |
8b7e858c | 88 | fGenRawsOffset = new Int_t[AliRecoParam::kNSpecies]; |
89 | fGenRecPointsOffset = new Int_t[AliRecoParam::kNSpecies]; | |
4a903927 | 90 | fGenDigitsOffset = new Int_t[AliRecoParam::kNSpecies]; |
8b7e858c | 91 | for(Int_t i=0; i<AliRecoParam::kNSpecies; i++) { |
92 | fGenRawsOffset[i] = 0; | |
93 | fGenRecPointsOffset[i] = 0; | |
4a903927 | 94 | fGenDigitsOffset[i]=0; |
8b7e858c | 95 | } |
ebdd0606 | 96 | } |
97 | ||
98 | //____________________________________________________________________________ | |
99 | AliITSQASDDDataMakerRec::AliITSQASDDDataMakerRec(const AliITSQASDDDataMakerRec& qadm) : | |
100 | TObject(), | |
101 | fAliITSQADataMakerRec(qadm.fAliITSQADataMakerRec), | |
102 | fkOnline(qadm.fkOnline), | |
103 | fLDC(qadm.fLDC), | |
ad300de9 | 104 | fSDDhRawsTask(qadm.fSDDhRawsTask), |
44ed7a66 | 105 | fSDDhDigitsTask(qadm.fSDDhDigitsTask), |
ad300de9 | 106 | fSDDhRecPointsTask(qadm.fSDDhRecPointsTask), |
ad300de9 | 107 | fGenRawsOffset(qadm.fGenRawsOffset), |
44ed7a66 | 108 | fGenDigitsOffset(qadm.fGenDigitsOffset), |
ad300de9 | 109 | fGenRecPointsOffset(qadm.fGenRecPointsOffset), |
ebdd0606 | 110 | fTimeBinSize(1), |
5af1d436 | 111 | fDDLModuleMap(0) |
58ceb8ca | 112 | { |
ebdd0606 | 113 | //copy ctor |
114 | fAliITSQADataMakerRec->SetName((const char*)qadm.fAliITSQADataMakerRec->GetName()) ; | |
115 | fAliITSQADataMakerRec->SetTitle((const char*)qadm.fAliITSQADataMakerRec->GetTitle()); | |
116 | fDDLModuleMap=NULL; | |
117 | } | |
118 | ||
119 | //____________________________________________________________________________ | |
120 | AliITSQASDDDataMakerRec::~AliITSQASDDDataMakerRec(){ | |
121 | // destructor | |
58ceb8ca | 122 | //if(fDDLModuleMap) delete fDDLModuleMap; |
ebdd0606 | 123 | } |
124 | //__________________________________________________________________ | |
125 | AliITSQASDDDataMakerRec& AliITSQASDDDataMakerRec::operator = (const AliITSQASDDDataMakerRec& qac ) | |
126 | { | |
7a0e5776 | 127 | // Equal operator. |
ebdd0606 | 128 | this->~AliITSQASDDDataMakerRec(); |
129 | new(this) AliITSQASDDDataMakerRec(qac); | |
130 | return *this; | |
131 | } | |
132 | ||
133 | //____________________________________________________________________________ | |
134 | void AliITSQASDDDataMakerRec::StartOfDetectorCycle() | |
135 | { | |
136 | //Detector specific actions at start of cycle | |
5379c4a3 | 137 | AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM::Start of SDD Cycle\n"); |
ebdd0606 | 138 | } |
139 | ||
140 | //____________________________________________________________________________ | |
4e25ac79 | 141 | void AliITSQASDDDataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t /*task*/, TObjArray* /*list*/) |
ebdd0606 | 142 | { |
8b7e858c | 143 | AliDebug(AliQAv1::GetQADebugLevel(),"AliITSDM instantiates checker with Run(AliQAv1::kITS, task, list)\n"); |
ebdd0606 | 144 | } |
145 | ||
146 | //____________________________________________________________________________ | |
eca4fa66 | 147 | Int_t AliITSQASDDDataMakerRec::InitRaws() |
ebdd0606 | 148 | { |
149 | // Initialization for RAW data - SDD - | |
7d297381 | 150 | const Bool_t expert = kTRUE ; |
151 | const Bool_t saveCorr = kTRUE ; | |
152 | const Bool_t image = kTRUE ; | |
58ceb8ca | 153 | |
154 | ||
155 | ||
eca4fa66 | 156 | Int_t rv = 0 ; |
58ceb8ca | 157 | /* |
ebdd0606 | 158 | AliCDBEntry *ddlMapSDD = AliCDBManager::Instance()->Get("ITS/Calib/DDLMapSDD"); |
159 | Bool_t cacheStatus = AliCDBManager::Instance()->GetCacheFlag(); | |
e41192d7 | 160 | if(!ddlMapSDD) |
161 | { | |
162 | AliError("Calibration object retrieval failed! SDD will not be processed"); | |
163 | fDDLModuleMap = NULL; | |
eca4fa66 | 164 | return rv; |
e41192d7 | 165 | } |
ebdd0606 | 166 | fDDLModuleMap = (AliITSDDLModuleMapSDD*)ddlMapSDD->GetObject(); |
167 | if(!cacheStatus)ddlMapSDD->SetObject(NULL); | |
168 | ddlMapSDD->SetOwner(kTRUE); | |
e41192d7 | 169 | if(!cacheStatus) |
170 | { | |
171 | delete ddlMapSDD; | |
172 | } | |
58ceb8ca | 173 | */ |
ebdd0606 | 174 | Int_t lay, lad, det; |
ebdd0606 | 175 | Int_t indexlast = 0; |
176 | Int_t index1 = 0; | |
177 | ||
7a0e5776 | 178 | if(fkOnline) |
179 | { | |
180 | AliInfo("Book Online Histograms for SDD\n"); | |
181 | } | |
182 | else | |
183 | { | |
184 | AliInfo("Book Offline Histograms for SDD\n "); | |
185 | } | |
186 | TH1D *h0 = new TH1D("SDDModPattern","HW Modules pattern",fgknSDDmodules,239.5,499.5); //0 | |
ebdd0606 | 187 | h0->GetXaxis()->SetTitle("Module Number"); |
188 | h0->GetYaxis()->SetTitle("Counts"); | |
ce8c37f2 | 189 | rv = fAliITSQADataMakerRec->Add2RawsList(h0,0+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr); |
ad300de9 | 190 | fSDDhRawsTask++; |
7a0e5776 | 191 | |
192 | //zPhi distribution using ladder and modules numbers | |
58ceb8ca | 193 | TH2D *hphil3 = new TH2D("SDDphizL3","SDD #varphiz Layer3 ",12,0.5,6.5,14,0.5,14.5); |
5af1d436 | 194 | hphil3->GetXaxis()->SetTitle("z[Module Number L3 ]"); |
195 | hphil3->GetYaxis()->SetTitle("#varphi[ Ladder Number L3]"); | |
ce8c37f2 | 196 | rv = fAliITSQADataMakerRec->Add2RawsList(hphil3,1+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image, saveCorr); |
7a0e5776 | 197 | fSDDhRawsTask++; |
198 | ||
58ceb8ca | 199 | TH2D *hphil4 = new TH2D("SDDphizL4","SDD #varphiz Layer4 ",16,0.5,8.5,22,0.5,22.5); |
5af1d436 | 200 | hphil4->GetXaxis()->SetTitle("z[Module Number L4]"); |
201 | hphil4->GetYaxis()->SetTitle("#varphi[Ladder Number L4]"); | |
ce8c37f2 | 202 | rv = fAliITSQADataMakerRec->Add2RawsList(hphil4,2+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image, saveCorr); |
7a0e5776 | 203 | fSDDhRawsTask++; |
204 | ||
ebdd0606 | 205 | |
7a0e5776 | 206 | if(fkOnline) |
207 | { | |
208 | ||
209 | //DDL Pattern | |
58ceb8ca | 210 | TH2D *hddl = new TH2D("SDDDDLPattern","SDD DDL Pattern ",24,-0.5,11.5,24,-0.5,23.5); |
ad300de9 | 211 | hddl->GetXaxis()->SetTitle("Channel"); |
5af1d436 | 212 | hddl->GetYaxis()->SetTitle("DDL Number"); |
ce8c37f2 | 213 | rv = fAliITSQADataMakerRec->Add2RawsList(hddl,3+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr); |
ad300de9 | 214 | fSDDhRawsTask++; |
7a0e5776 | 215 | Int_t indexlast1 = 0; |
216 | ||
217 | fTimeBinSize = 4; | |
218 | indexlast = 0; | |
219 | index1 = 0; | |
220 | indexlast1 = fSDDhRawsTask; | |
221 | char *hname[3]; | |
222 | for(Int_t i=0; i<3; i++) hname[i]= new char[50]; | |
223 | for(Int_t moduleSDD =0; moduleSDD<fgknSDDmodules; moduleSDD++){ | |
224 | for(Int_t iside=0;iside<fgknSide;iside++){ | |
225 | AliITSgeomTGeo::GetModuleId(moduleSDD+fgkmodoffset, lay, lad, det); | |
226 | sprintf(hname[0],"SDDchargeMapFSE_L%d_%d_%d_%d",lay,lad,det,iside); | |
227 | sprintf(hname[1],"SDDChargeMapForSingleEvent_L%d_%d_%d_%d",lay,lad,det,iside); | |
fc89f88c | 228 | // sprintf(hname[2],"SDDhmonoDMap_L%d_%d_%d_%d",lay,lad,det,iside); |
7a0e5776 | 229 | TProfile2D *fModuleChargeMapFSE = new TProfile2D(hname[0],hname[1],256/fTimeBinSize,-0.5,255.5,256,-0.5,255.5); |
230 | fModuleChargeMapFSE->GetXaxis()->SetTitle("Time Bin"); | |
231 | fModuleChargeMapFSE->GetYaxis()->SetTitle("Anode"); | |
80b9610c | 232 | rv = fAliITSQADataMakerRec->Add2RawsList(fModuleChargeMapFSE,indexlast1 + index1 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr); |
7a0e5776 | 233 | fSDDhRawsTask++; |
234 | index1++; | |
ebdd0606 | 235 | } |
7a0e5776 | 236 | } |
237 | ||
238 | for(Int_t moduleSDD =0; moduleSDD<fgknSDDmodules; moduleSDD++){ | |
239 | for(Int_t iside=0;iside<fgknSide;iside++){ | |
240 | AliITSgeomTGeo::GetModuleId(moduleSDD+fgkmodoffset, lay, lad, det); | |
241 | sprintf(hname[0],"SDDchargeMap_L%d_%d_%d_%d",lay,lad,det,iside); | |
242 | sprintf(hname[1],"SDDChargeMap_L%d_%d_%d_%d",lay,lad,det,iside); | |
243 | TProfile2D *fModuleChargeMap = new TProfile2D(hname[0],hname[1],256/fTimeBinSize,-0.5,255.5,256,-0.5,255.5); | |
244 | fModuleChargeMap->GetXaxis()->SetTitle("Time Bin"); | |
5af1d436 | 245 | fModuleChargeMap->GetYaxis()->SetTitle("Anode Number"); |
80b9610c | 246 | rv = fAliITSQADataMakerRec->Add2RawsList(fModuleChargeMap,indexlast1 + index1 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr); |
247 | ||
7a0e5776 | 248 | fSDDhRawsTask++; |
249 | index1++; | |
ebdd0606 | 250 | } |
7a0e5776 | 251 | } |
252 | ||
58ceb8ca | 253 | //Event Size |
254 | TH1F *hsize = new TH1F("SDDEventSize","SDD Event Size ",1000,-0.5,999.5); | |
255 | hsize->GetXaxis()->SetTitle("Event Size [kB]"); | |
256 | hsize->GetYaxis()->SetTitle("Entries"); | |
ce8c37f2 | 257 | rv = fAliITSQADataMakerRec->Add2RawsList(hsize,indexlast1 + index1 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr); |
58ceb8ca | 258 | fSDDhRawsTask++; |
8b7e858c | 259 | |
7a0e5776 | 260 | } // kONLINE |
ebdd0606 | 261 | |
5379c4a3 | 262 | AliDebug(AliQAv1::GetQADebugLevel(),Form("%d SDD Raws histograms booked\n",fSDDhRawsTask)); |
eca4fa66 | 263 | return rv ; |
ebdd0606 | 264 | } |
265 | ||
266 | ||
267 | //____________________________________________________________________________ | |
eca4fa66 | 268 | Int_t AliITSQASDDDataMakerRec::MakeRaws(AliRawReader* rawReader) |
ebdd0606 | 269 | { |
270 | // Fill QA for RAW - SDD - | |
8b7e858c | 271 | Int_t rv = 0; |
7555afef | 272 | // Check id histograms already created for this Event Specie |
7555afef | 273 | |
ebdd0606 | 274 | if(!fDDLModuleMap){ |
58ceb8ca | 275 | CreateTheMap(); |
276 | //AliError("SDD DDL module map not available - skipping SDD QA"); | |
277 | //return rv; | |
278 | ||
ebdd0606 | 279 | } |
eca4fa66 | 280 | if(rawReader->GetType() != 7) return rv; // skips non physical triggers |
5379c4a3 | 281 | AliDebug(AliQAv1::GetQADebugLevel(),"entering MakeRaws\n"); |
e41192d7 | 282 | rawReader->Reset(); |
58ceb8ca | 283 | rawReader->Select("ITSSDD"); |
8b7e858c | 284 | AliITSRawStream *stream=AliITSRawStreamSDD::CreateRawStreamSDD(rawReader); |
285 | stream->SetDDLModuleMap(fDDLModuleMap); | |
e41192d7 | 286 | |
ebdd0606 | 287 | Int_t lay, lad, det; |
7a0e5776 | 288 | |
ebdd0606 | 289 | Int_t index=0; |
290 | if(fkOnline) { | |
291 | for(Int_t moduleSDD =0; moduleSDD<fgknSDDmodules; moduleSDD++){ | |
7a0e5776 | 292 | for(Int_t iside=0;iside<fgknSide;iside++) { |
8b7e858c | 293 | if(fSDDhRawsTask > 4 + index) fAliITSQADataMakerRec->GetRawsData(4 + index +fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Reset(); |
7a0e5776 | 294 | // 4 because the 2D histos for single events start after the fourth position |
295 | index++; | |
296 | } | |
ebdd0606 | 297 | } |
298 | } | |
e41192d7 | 299 | |
ebdd0606 | 300 | Int_t cnt = 0; |
301 | Int_t ildcID = -1; | |
302 | Int_t iddl = -1; | |
303 | Int_t isddmod = -1; | |
7a0e5776 | 304 | Int_t coord1, coord2, signal, moduleSDD, activeModule, index1; |
58ceb8ca | 305 | //if(fkOnline) |
306 | //{ | |
307 | Int_t prevDDLID = -1; | |
308 | UInt_t size = 0; | |
309 | int totalddl=static_cast<int>(fDDLModuleMap->GetNDDLs()); | |
310 | Bool_t *ddldata=new Bool_t[totalddl]; | |
311 | for(Int_t jddl=0;jddl<totalddl;jddl++){ddldata[jddl]=kFALSE;} | |
312 | //} | |
e41192d7 | 313 | while(stream->Next()) { |
ebdd0606 | 314 | ildcID = rawReader->GetLDCId(); |
58ceb8ca | 315 | iddl = rawReader->GetDDLID();// - fgkDDLIDshift; |
316 | ||
317 | ||
e41192d7 | 318 | isddmod = fDDLModuleMap->GetModuleNumber(iddl,stream->GetCarlosId()); |
ebdd0606 | 319 | if(isddmod==-1){ |
5379c4a3 | 320 | AliDebug(AliQAv1::GetQADebugLevel(),Form("Found module with iddl: %d, stream->GetCarlosId: %d \n",iddl,stream->GetCarlosId())); |
ebdd0606 | 321 | continue; |
322 | } | |
e41192d7 | 323 | if(stream->IsCompletedModule()) { |
5379c4a3 | 324 | AliDebug(AliQAv1::GetQADebugLevel(),Form("IsCompletedModule == KTRUE\n")); |
ebdd0606 | 325 | continue; |
326 | } | |
de075dae | 327 | if(stream->IsCompletedDDL()) { |
58ceb8ca | 328 | |
329 | if(fkOnline){ | |
330 | if ((rawReader->GetDDLID() != prevDDLID)&&(ddldata[iddl])==kFALSE){ | |
331 | size += rawReader->GetDataSize();//in bytes | |
332 | prevDDLID = rawReader->GetDDLID(); | |
333 | ddldata[iddl]=kTRUE; | |
334 | } | |
335 | } | |
5379c4a3 | 336 | AliDebug(AliQAv1::GetQADebugLevel(),Form("IsCompletedDDL == KTRUE\n")); |
de075dae | 337 | continue; |
338 | } | |
ebdd0606 | 339 | |
e41192d7 | 340 | coord1 = stream->GetCoord1(); |
341 | coord2 = stream->GetCoord2(); | |
342 | signal = stream->GetSignal(); | |
ebdd0606 | 343 | |
7a0e5776 | 344 | moduleSDD = isddmod - fgkmodoffset; |
345 | ||
b62d7123 | 346 | if(isddmod <fgkmodoffset|| isddmod>fgknSDDmodules+fgkmodoffset-1) { |
5379c4a3 | 347 | AliDebug(AliQAv1::GetQADebugLevel(),Form( "Module SDD = %d, resetting it to 1 \n",isddmod)); |
b62d7123 | 348 | isddmod = 1; |
ebdd0606 | 349 | } |
7a0e5776 | 350 | |
ebdd0606 | 351 | AliITSgeomTGeo::GetModuleId(isddmod, lay, lad, det); |
e41192d7 | 352 | Short_t iside = stream->GetChannel(); |
ad300de9 | 353 | |
58ceb8ca | 354 | //printf(" \n%i %i %i %i \n ",lay, lad, det,iside ); |
355 | fAliITSQADataMakerRec->GetRawsData( 0 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()] )->Fill(isddmod); | |
356 | if(lay==3) fAliITSQADataMakerRec->GetRawsData(1+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(det+0.5*iside-0.5,lad); | |
357 | if(lay==4) { | |
358 | fAliITSQADataMakerRec->GetRawsData(2+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(det+0.5*iside-0.5,lad);} | |
359 | ||
ebdd0606 | 360 | if(fkOnline) { |
58ceb8ca | 361 | fAliITSQADataMakerRec->GetRawsData(3+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill((stream->GetCarlosId())+0.5*iside -0.5,iddl); |
fc89f88c | 362 | |
7a0e5776 | 363 | activeModule = moduleSDD; |
364 | index1 = activeModule * 2 + iside; | |
365 | ||
366 | if(index1<0){ | |
5379c4a3 | 367 | AliDebug(AliQAv1::GetQADebugLevel(),Form("Wrong index number %d - patched to 0\n",index1)); |
7a0e5776 | 368 | index1 = 0; |
369 | } | |
78f8430c | 370 | |
7a0e5776 | 371 | if(fSDDhRawsTask > 4 + index1) { |
8b7e858c | 372 | ((TProfile2D *)(fAliITSQADataMakerRec->GetRawsData(4 + index1 +fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])))->Fill(coord2, coord1, signal); |
373 | ((TProfile2D *)(fAliITSQADataMakerRec->GetRawsData(4 + index1 + 260*2 +fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])))->Fill(coord2, coord1, signal); | |
ebdd0606 | 374 | } |
58ceb8ca | 375 | |
376 | }//online | |
7a0e5776 | 377 | cnt++; |
5379c4a3 | 378 | if(!(cnt%10000)) AliDebug(AliQAv1::GetQADebugLevel(),Form(" %d raw digits read",cnt)); |
58ceb8ca | 379 | }//end next() |
380 | if(fkOnline) | |
381 | { | |
382 | ((TH1F*)(fAliITSQADataMakerRec->GetRawsData(4 + 260*4 +fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])))->Fill(size/1024.);//KB | |
383 | } | |
5379c4a3 | 384 | AliDebug(AliQAv1::GetQADebugLevel(),Form("Event completed, %d raw digits read",cnt)); |
e41192d7 | 385 | delete stream; |
386 | stream = NULL; | |
8b7e858c | 387 | |
388 | // if(fkOnline) { | |
389 | // AnalyseBNG(); // Analyse Baseline, Noise, Gain | |
390 | // AnalyseINJ(); // Analyse Injectors | |
391 | // } | |
392 | ||
58ceb8ca | 393 | delete []ddldata; |
394 | ddldata=NULL; | |
eca4fa66 | 395 | return rv ; |
7a0e5776 | 396 | } |
ebdd0606 | 397 | |
44ed7a66 | 398 | //____________________________________________________________________________ |
eca4fa66 | 399 | Int_t AliITSQASDDDataMakerRec::InitDigits() |
44ed7a66 | 400 | { |
fc89f88c | 401 | |
7555afef | 402 | |
44ed7a66 | 403 | // Initialization for DIGIT data - SDD - |
404 | const Bool_t expert = kTRUE ; | |
405 | const Bool_t image = kTRUE ; | |
eca4fa66 | 406 | Int_t rv = 0 ; |
407 | // fGenDigitsOffset = (fAliITSQADataMakerRec->fDigitsQAList[AliRecoParam::kDefault])->GetEntries(); | |
44ed7a66 | 408 | //fSDDhTask must be incremented by one unit every time a histogram is ADDED to the QA List |
409 | TH1F* h0=new TH1F("SDD DIGITS Module Pattern","SDD DIGITS Module Pattern",260,239.5,499.5); //hmod | |
410 | h0->GetXaxis()->SetTitle("SDD Module Number"); | |
411 | h0->GetYaxis()->SetTitle("# DIGITS"); | |
4a903927 | 412 | rv = fAliITSQADataMakerRec->Add2DigitsList(h0,fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image); |
44ed7a66 | 413 | fSDDhDigitsTask ++; |
4a903927 | 414 | // printf("Add %s \t the task offset is %i\n",fAliITSQADataMakerRec->GetDigitsData(fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->GetName() , fSDDhDigitsTask ); |
44ed7a66 | 415 | TH1F* h1=new TH1F("SDD Anode Distribution","DIGITS Anode Distribution",512,-0.5,511.5); //hanocc |
416 | h1->GetXaxis()->SetTitle("Anode Number"); | |
417 | h1->GetYaxis()->SetTitle("# DIGITS"); | |
4a903927 | 418 | rv = fAliITSQADataMakerRec->Add2DigitsList(h1,1+fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image); |
44ed7a66 | 419 | fSDDhDigitsTask ++; |
4a903927 | 420 | //printf("Add %s \t the task offset is %i\n",fAliITSQADataMakerRec->GetDigitsData(1+fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->GetName() , fSDDhDigitsTask ); |
44ed7a66 | 421 | TH1F* h2=new TH1F("SDD Tbin Distribution","DIGITS Tbin Distribution",256,-0.5,255.5); //htbocc |
422 | h2->GetXaxis()->SetTitle("Tbin Number"); | |
423 | h2->GetYaxis()->SetTitle("# DIGITS"); | |
4a903927 | 424 | rv = fAliITSQADataMakerRec->Add2DigitsList(h2,2+fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image); |
44ed7a66 | 425 | fSDDhDigitsTask ++; |
4a903927 | 426 | //printf("Add %s \t the task offset is %i\n",fAliITSQADataMakerRec->GetDigitsData(2+fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->GetName() , fSDDhDigitsTask ); |
44ed7a66 | 427 | TH1F* h3=new TH1F("SDD ADC Counts Distribution","DIGITS ADC Counts Distribution",200,0.,1024.); //hsig |
428 | h3->GetXaxis()->SetTitle("ADC Value"); | |
429 | h3->GetYaxis()->SetTitle("# DIGITS"); | |
4a903927 | 430 | rv = fAliITSQADataMakerRec->Add2DigitsList(h3,3+fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image); |
44ed7a66 | 431 | fSDDhDigitsTask ++; |
4a903927 | 432 | //printf("Add %s \t the task offset is %i\n",fAliITSQADataMakerRec->GetDigitsData(3+fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->GetName() , fSDDhDigitsTask ); |
44ed7a66 | 433 | AliDebug(AliQAv1::GetQADebugLevel(),Form("%d SDD Digits histograms booked\n",fSDDhDigitsTask)); |
eca4fa66 | 434 | return rv ; |
44ed7a66 | 435 | } |
436 | ||
437 | //____________________________________________________________________________ | |
eca4fa66 | 438 | Int_t AliITSQASDDDataMakerRec::MakeDigits(TTree * digits) |
44ed7a66 | 439 | { |
7555afef | 440 | |
44ed7a66 | 441 | // Fill QA for DIGIT - SDD - |
fc89f88c | 442 | //AliITS *fITS = (AliITS*)gAlice->GetModule("ITS"); |
443 | //fITS->SetTreeAddress(); | |
444 | //TClonesArray *iITSdigits = fITS->DigitsAddress(1); | |
445 | ||
446 | ||
eca4fa66 | 447 | Int_t rv = 0 ; |
448 | ||
fc89f88c | 449 | TBranch *branchD = digits->GetBranch("ITSDigitsSDD"); |
450 | ||
451 | if (!branchD) { | |
452 | AliError("can't get the branch with the ITS SDD digits !"); | |
eca4fa66 | 453 | return rv ; |
44ed7a66 | 454 | } |
eca4fa66 | 455 | // Check id histograms already created for this Event Specie |
8b7e858c | 456 | // if ( ! fAliITSQADataMakerRec->GetDigitsData(fGenDigitsOffset) ) |
457 | // rv = InitDigits() ; | |
eca4fa66 | 458 | |
fc89f88c | 459 | static TClonesArray statDigits("AliITSdigitSDD"); |
44ed7a66 | 460 | TClonesArray *iITSdigits = &statDigits; |
461 | branchD->SetAddress(&iITSdigits); | |
fc89f88c | 462 | |
44ed7a66 | 463 | for(Int_t i=0; i<260; i++){ |
464 | Int_t nmod=i+240; | |
465 | digits->GetEvent(nmod); | |
466 | Int_t ndigits = iITSdigits->GetEntries(); | |
4a903927 | 467 | fAliITSQADataMakerRec->GetDigitsData(fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(nmod,ndigits); |
7555afef | 468 | |
44ed7a66 | 469 | for (Int_t idig=0; idig<ndigits; idig++) { |
470 | AliITSdigit *dig=(AliITSdigit*)iITSdigits->UncheckedAt(idig); | |
471 | Int_t iz=dig->GetCoord1(); // cell number z | |
472 | Int_t ix=dig->GetCoord2(); // cell number x | |
473 | Int_t sig=dig->GetSignal(); | |
4a903927 | 474 | fAliITSQADataMakerRec->GetDigitsData(1+fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(iz); |
475 | fAliITSQADataMakerRec->GetDigitsData(2+fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(ix); | |
476 | fAliITSQADataMakerRec->GetDigitsData(3+fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(sig); | |
44ed7a66 | 477 | } |
478 | } | |
eca4fa66 | 479 | return rv ; |
44ed7a66 | 480 | } |
481 | ||
ebdd0606 | 482 | //____________________________________________________________________________ |
eca4fa66 | 483 | Int_t AliITSQASDDDataMakerRec::InitRecPoints() |
ebdd0606 | 484 | { |
7555afef | 485 | |
8b7e858c | 486 | //AliInfo("Initialize SDD recpoints histos\n"); |
ebdd0606 | 487 | // Initialization for RECPOINTS - SDD - |
7d297381 | 488 | const Bool_t expert = kTRUE ; |
489 | const Bool_t image = kTRUE ; | |
eca4fa66 | 490 | Int_t rv = 0 ; |
491 | // fGenRecPointsOffset = (fAliITSQADataMakerRec->fRecPointsQAList[AliRecoParam::kDefault])->GetEntries(); | |
ad300de9 | 492 | |
80b9610c | 493 | Int_t nOnline=1; |
ebdd0606 | 494 | Int_t nOnline2=1; |
495 | Int_t nOnline3=1; | |
496 | Int_t nOnline4=1; | |
80b9610c | 497 | Int_t nOnline5=1; |
ebdd0606 | 498 | if(fkOnline) |
499 | { | |
ebdd0606 | 500 | nOnline=4; |
501 | nOnline2=28; | |
502 | nOnline3=64; | |
503 | nOnline4=14; | |
504 | } | |
505 | ||
8b7e858c | 506 | //AliInfo(Form("fAliITSQADataMakerRec->GetEventSpecie() %d\n",fAliITSQADataMakerRec->GetEventSpecie())); |
507 | //AliInfo(Form("fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] %d\n",fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])); | |
ebdd0606 | 508 | TH1F *h0 = new TH1F("SDDLay3TotCh","Layer 3 total charge",1000/nOnline,-0.5, 499.5); //position number 0 |
509 | h0->GetXaxis()->SetTitle("ADC value"); | |
510 | h0->GetYaxis()->SetTitle("Entries"); | |
80b9610c | 511 | rv = fAliITSQADataMakerRec->Add2RecPointsList(h0, 0 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);//NON expert image |
ad300de9 | 512 | fSDDhRecPointsTask++; |
ebdd0606 | 513 | |
514 | TH1F *h1 = new TH1F("SDDLay4TotCh","Layer 4 total charge",1000/nOnline,-0.5, 499.5);//position number 1 | |
515 | h1->GetXaxis()->SetTitle("ADC value"); | |
516 | h1->GetYaxis()->SetTitle("Entries"); | |
80b9610c | 517 | rv = fAliITSQADataMakerRec->Add2RecPointsList(h1, 1 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);//NON expert image |
ad300de9 | 518 | fSDDhRecPointsTask++; |
ebdd0606 | 519 | |
520 | char hisnam[50]; | |
521 | TH2F *h2 = new TH2F("SDDGlobalCoordDistribYX","YX Global Coord Distrib",5600/nOnline2,-28,28,5600/nOnline2,-28,28);//position number 2 | |
522 | h2->GetYaxis()->SetTitle("Y[cm]"); | |
523 | h2->GetXaxis()->SetTitle("X[cm]"); | |
80b9610c | 524 | rv = fAliITSQADataMakerRec->Add2RecPointsList(h2,2+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);// NON expert image |
ad300de9 | 525 | fSDDhRecPointsTask++; |
ebdd0606 | 526 | |
527 | TH2F *h3 = new TH2F("SDDGlobalCoordDistribRZ","RZ Global Coord Distrib",6400/nOnline3,-32,32,1400/nOnline4,12,26);//position number 3 | |
528 | h3->GetYaxis()->SetTitle("R[cm]"); | |
529 | h3->GetXaxis()->SetTitle("Z[cm]"); | |
80b9610c | 530 | rv = fAliITSQADataMakerRec->Add2RecPointsList(h3,3+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);// NON expert image |
ad300de9 | 531 | fSDDhRecPointsTask++; |
ebdd0606 | 532 | |
533 | TH2F *h4 = new TH2F("SDDGlobalCoordDistribL3PHIZ","#varphi Z Global Coord Distrib L3",6400/nOnline3,-32,32,360/nOnline,-TMath::Pi(),TMath::Pi());//position number 4 | |
534 | h4->GetYaxis()->SetTitle("#phi[rad]"); | |
535 | h4->GetXaxis()->SetTitle("Z[cm]"); | |
80b9610c | 536 | rv = fAliITSQADataMakerRec->Add2RecPointsList(h4,4+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);//NON expert image |
ad300de9 | 537 | fSDDhRecPointsTask++; |
ebdd0606 | 538 | |
539 | TH2F *h5 = new TH2F("SDDGlobalCoordDistribL4PHIZ","#varphi Z Global Coord Distrib L4",6400/nOnline3,-32,32,360/nOnline,-TMath::Pi(),TMath::Pi());//position number 5 | |
540 | h5->GetYaxis()->SetTitle("#phi[rad]"); | |
541 | h5->GetXaxis()->SetTitle("Z[cm]"); | |
80b9610c | 542 | rv = fAliITSQADataMakerRec->Add2RecPointsList(h5,5+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);//NON expert image |
ad300de9 | 543 | fSDDhRecPointsTask++; |
ebdd0606 | 544 | |
545 | TH1F *h6 = new TH1F("SDDModPatternRP","Modules pattern RP",fgknSDDmodules,239.5,499.5); //position number 6 | |
546 | h6->GetXaxis()->SetTitle("Module number"); //spd offset = 240 | |
547 | h6->GetYaxis()->SetTitle("Entries"); | |
80b9610c | 548 | rv = fAliITSQADataMakerRec->Add2RecPointsList(h6,6 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);// expert NO image |
ad300de9 | 549 | fSDDhRecPointsTask++; |
58ceb8ca | 550 | |
5af1d436 | 551 | |
552 | TH2F *h7 = new TH2F("SDDModPatternL3RP","Modules pattern L3 RP",6,0.5,6.5,14,0.5,14.5); //position number 7 | |
553 | h7->GetXaxis()->SetTitle("z[#Module L3 ]"); | |
554 | h7->GetYaxis()->SetTitle("#varphi[#Ladder L3]"); | |
555 | rv = fAliITSQADataMakerRec->Add2RecPointsList(h7,7 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);// NO expert image | |
ad300de9 | 556 | fSDDhRecPointsTask++; |
58ceb8ca | 557 | |
5af1d436 | 558 | TH2F *h8 = new TH2F("SDDModPatternL4RP","Modules pattern L4 RP",8,0.5,8.5,22,0.5,22.5); //position number 8 |
559 | h8->GetXaxis()->SetTitle("[#Module L3 ]"); | |
560 | h8->GetYaxis()->SetTitle("#varphi[#Ladder L4]"); | |
561 | rv = fAliITSQADataMakerRec->Add2RecPointsList(h8,8 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);// NO expert image | |
ad300de9 | 562 | fSDDhRecPointsTask++; |
58ceb8ca | 563 | |
5af1d436 | 564 | // TH1F *h7 = new TH1F("SDDLadPatternL3RP","Ladder pattern L3 RP",14,0.5,14.5); //position number 7 |
565 | // h7->GetXaxis()->SetTitle("Ladder #, Layer 3"); | |
566 | // h7->GetYaxis()->SetTitle("Entries"); | |
567 | // rv = fAliITSQADataMakerRec->Add2RecPointsList(h7,7 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);// expert NO image | |
568 | // fSDDhRecPointsTask++; | |
569 | ||
570 | // TH1F *h8 = new TH1F("SDDLadPatternL4RP","Ladder pattern L4 RP",22,0.5,22.5); //position number 8 | |
571 | // h8->GetXaxis()->SetTitle("Ladder #, Layer 4"); | |
572 | // h8->GetYaxis()->SetTitle("Entries"); | |
573 | // rv = fAliITSQADataMakerRec->Add2RecPointsList(h8,8 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);// expert NO image | |
574 | // fSDDhRecPointsTask++; | |
575 | ||
ebdd0606 | 576 | TH2F *h9 = new TH2F("SDDLocalCoordDistrib","Local Coord Distrib",1000/nOnline,-4,4,1000/nOnline,-4,4);//position number 9 |
577 | h9->GetXaxis()->SetTitle("X local coord, drift, cm"); | |
578 | h9->GetYaxis()->SetTitle("Z local coord, anode, cm"); | |
80b9610c | 579 | rv = fAliITSQADataMakerRec->Add2RecPointsList(h9,9 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);// expert NO image |
ad300de9 | 580 | fSDDhRecPointsTask++; |
58ceb8ca | 581 | |
582 | //AliInfo("Create SDD recpoints histos\n"); | |
583 | ||
584 | TH1F *h10 = new TH1F("SDDrdistrib_Layer3" ,"SDD r distribution Layer3" ,100,14.,18.);//position number 10 (L3) | |
585 | h10->GetXaxis()->SetTitle("r[cm]"); | |
586 | h10->GetXaxis()->CenterTitle(); | |
587 | h10->GetYaxis()->SetTitle("Entries"); | |
80b9610c | 588 | rv = fAliITSQADataMakerRec->Add2RecPointsList(h10,10 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);// expert NO image |
58ceb8ca | 589 | fSDDhRecPointsTask++; |
590 | ||
591 | TH1F *h11 = new TH1F("SDDrdistrib_Layer4" ,"SDD r distribution Layer4" ,100,22.,26.);// and position number 11 (L4) | |
592 | h11->GetXaxis()->SetTitle("r[cm]"); | |
593 | h11->GetXaxis()->CenterTitle(); | |
594 | h11->GetYaxis()->SetTitle("Entries"); | |
80b9610c | 595 | rv = fAliITSQADataMakerRec->Add2RecPointsList(h11,11 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);// expert NO image |
58ceb8ca | 596 | fSDDhRecPointsTask++; |
597 | ||
ebdd0606 | 598 | for(Int_t iLay=0; iLay<=1; iLay++){ |
599 | sprintf(hisnam,"SDDphidistrib_Layer%d",iLay+3); | |
600 | TH1F *h12 = new TH1F(hisnam,hisnam,180,-TMath::Pi(),TMath::Pi());//position number 12 (L3) and position number 13 (L4) | |
601 | h12->GetXaxis()->SetTitle("#varphi[rad]"); | |
602 | h12->GetXaxis()->CenterTitle(); | |
603 | h12->GetYaxis()->SetTitle("Entries"); | |
80b9610c | 604 | rv = fAliITSQADataMakerRec->Add2RecPointsList(h12,iLay+12+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);// expert NO image |
ad300de9 | 605 | fSDDhRecPointsTask++; |
ebdd0606 | 606 | } |
58ceb8ca | 607 | |
608 | for(Int_t iLay=0; iLay<=1; iLay++){ | |
609 | sprintf(hisnam,"SDDdrifttime_Layer%d",iLay+3); | |
80b9610c | 610 | TH1F *h14 = new TH1F(hisnam,hisnam,200/nOnline5,-0.5,9999.5);//position number 14 (L3) and position number 15 (L4) |
611 | h14->GetXaxis()->SetTitle("drift time[#mus]"); | |
58ceb8ca | 612 | h14->GetXaxis()->CenterTitle(); |
613 | h14->GetYaxis()->SetTitle("Entries"); | |
80b9610c | 614 | rv = fAliITSQADataMakerRec->Add2RecPointsList(h14,iLay+14+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);// NON expert image |
58ceb8ca | 615 | fSDDhRecPointsTask++; |
616 | } | |
617 | ||
ebdd0606 | 618 | if(fkOnline) |
619 | { | |
58ceb8ca | 620 | TH2F *h16 = new TH2F("SDDGlobalCoordDistribYXFSE","YX Global Coord Distrib FSE",5600/nOnline2,-28,28,5600/nOnline2,-28,28);//position number 16 |
621 | h16->GetYaxis()->SetTitle("Y[cm]"); | |
622 | h16->GetXaxis()->SetTitle("X[cm]"); | |
80b9610c | 623 | rv = fAliITSQADataMakerRec->Add2RecPointsList(h16,16+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);// expert NO image |
ad300de9 | 624 | fSDDhRecPointsTask++; |
ebdd0606 | 625 | |
58ceb8ca | 626 | TH2F *h17 = new TH2F("SDDGlobalCoordDistribRZFSE","RZ Global Coord Distrib FSE",Int_t(6400/nOnline3),-32,32,1400/nOnline4,12,26);//position number 17 |
627 | h17->GetYaxis()->SetTitle("R[cm]"); | |
628 | h17->GetXaxis()->SetTitle("Z[cm]"); | |
80b9610c | 629 | rv = fAliITSQADataMakerRec->Add2RecPointsList(h17,17+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);// expert NO image |
ad300de9 | 630 | fSDDhRecPointsTask++; |
ebdd0606 | 631 | |
ebdd0606 | 632 | }//online |
58ceb8ca | 633 | |
5379c4a3 | 634 | AliDebug(AliQAv1::GetQADebugLevel(),Form("%d SDD Recs histograms booked\n",fSDDhRecPointsTask)); |
58ceb8ca | 635 | |
eca4fa66 | 636 | return rv ; |
ebdd0606 | 637 | } |
638 | ||
639 | //____________________________________________________________________________ | |
eca4fa66 | 640 | Int_t AliITSQASDDDataMakerRec::MakeRecPoints(TTree * clustersTree) |
7a0e5776 | 641 | { |
ebdd0606 | 642 | // Fill QA for RecPoints - SDD - |
eca4fa66 | 643 | Int_t rv = 0 ; |
7555afef | 644 | |
ebdd0606 | 645 | Int_t lay, lad, det; |
8b7e858c | 646 | //AliInfo("get the branch with the ITS clusters !\n"); |
e62fe478 | 647 | AliITSRecPointContainer* rpcont=AliITSRecPointContainer::Instance(); |
aa444532 | 648 | TClonesArray *recpoints=NULL; |
649 | if(fkOnline){ | |
650 | recpoints = rpcont->FetchClusters(0,clustersTree,fAliITSQADataMakerRec->GetEventNumber()); | |
651 | } | |
652 | else{ | |
653 | recpoints = rpcont->FetchClusters(0,clustersTree); | |
654 | } | |
e62fe478 | 655 | if(!rpcont->GetStatusOK() || !rpcont->IsSDDActive()){ |
656 | AliError("can't get SDD clusters !"); | |
657 | return rv; | |
ebdd0606 | 658 | } |
659 | ||
ebdd0606 | 660 | Int_t npoints = 0; |
661 | Float_t cluglo[3]={0.,0.,0.}; | |
662 | if(fkOnline) | |
663 | { | |
58ceb8ca | 664 | for(Int_t i=16;i<18;i++) |
ebdd0606 | 665 | { |
8b7e858c | 666 | fAliITSQADataMakerRec->GetRecPointsData(i+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Reset(); |
ebdd0606 | 667 | } |
668 | } | |
e62fe478 | 669 | Int_t firMod=AliITSgeomTGeo::GetModuleIndex(3,1,1); |
670 | Int_t lasMod=AliITSgeomTGeo::GetModuleIndex(5,1,1); | |
671 | for(Int_t module=firMod; module<lasMod;module++){ | |
58ceb8ca | 672 | //AliInfo(Form("Module %d\n",module)); |
e62fe478 | 673 | recpoints = rpcont->UncheckedGetClusters(module); |
58ceb8ca | 674 | npoints += recpoints->GetEntries(); |
675 | //AliInfo(Form("modnumb %d, npoints %d, total points %d\n",module, recpoints->GetEntries(),npoints)); | |
80b9610c | 676 | //AliITSgeomTGeo::GetModuleId(module, lay, lad, det); |
58ceb8ca | 677 | //AliInfo(Form("modnumb %d, lay %d, lad %d, det %d \n",module, lay, lad, det)); |
678 | ||
679 | //AliInfo(Form("modnumb %d, entries %d\n",module, recpoints->GetEntries())); | |
680 | for(Int_t j=0;j<recpoints->GetEntries();j++){ | |
681 | //AliInfo(Form("modnumb %d, entry %d \n",module, j)); | |
80b9610c | 682 | AliITSRecPoint *recp = (AliITSRecPoint*)recpoints->At(j); |
683 | Int_t index = recp->GetDetectorIndex(); | |
684 | lay=recp->GetLayer(); | |
685 | Int_t modnumb=index+AliITSgeomTGeo::GetModuleIndex(lay+1,1,1); | |
686 | //printf("modnumb %i\n",modnumb); | |
687 | AliITSgeomTGeo::GetModuleId(modnumb, lay, lad, det); | |
688 | fAliITSQADataMakerRec->GetRecPointsData(6 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(modnumb);//modpatternrp | |
58ceb8ca | 689 | recp->GetGlobalXYZ(cluglo); |
690 | Float_t rad=TMath::Sqrt(cluglo[0]*cluglo[0]+cluglo[1]*cluglo[1]); | |
691 | Float_t phi=TMath::ATan2(cluglo[1],cluglo[0]); | |
692 | Float_t drifttime=recp->GetDriftTime(); | |
693 | fAliITSQADataMakerRec->GetRecPointsData(9 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(recp->GetDetLocalX(),recp->GetDetLocalZ());//local distribution | |
80b9610c | 694 | if(lay==3||lay==4)fAliITSQADataMakerRec->GetRecPointsData(2 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluglo[0],cluglo[1]);//global distribution YX |
58ceb8ca | 695 | fAliITSQADataMakerRec->GetRecPointsData(3 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluglo[2],rad);//global distribution rz |
696 | if(fkOnline) { | |
697 | fAliITSQADataMakerRec->GetRecPointsData(16 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluglo[0],cluglo[1]);//global distribution YX FSE | |
698 | fAliITSQADataMakerRec->GetRecPointsData(17 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluglo[2],rad);//global distribution rz FSE | |
699 | } | |
700 | if(recp->GetLayer() == 2) { | |
701 | fAliITSQADataMakerRec->GetRecPointsData(0 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(recp->GetQ()) ;//total charge of layer 3 | |
5af1d436 | 702 | //fAliITSQADataMakerRec->GetRecPointsData(7 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(lad);//lad pattern layer 3 |
703 | fAliITSQADataMakerRec->GetRecPointsData(7 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(det,lad);//mod pattern layer 3 | |
58ceb8ca | 704 | fAliITSQADataMakerRec->GetRecPointsData(10 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(rad);//r distribution layer 3 |
705 | fAliITSQADataMakerRec->GetRecPointsData(12 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(phi);// phi distribution layer 3 | |
706 | fAliITSQADataMakerRec->GetRecPointsData(4 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluglo[2],phi);// zphi distribution layer | |
707 | fAliITSQADataMakerRec->GetRecPointsData(14 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(drifttime);// time distribution layer 3 | |
708 | } else if(recp->GetLayer() == 3) { | |
709 | fAliITSQADataMakerRec->GetRecPointsData(1 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(recp->GetQ()) ;//total charge layer 4 | |
5af1d436 | 710 | //fAliITSQADataMakerRec->GetRecPointsData(8 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(lad);//ladpatternlayer4 |
711 | fAliITSQADataMakerRec->GetRecPointsData(8 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(det,lad);//mod pattern layer 4 | |
58ceb8ca | 712 | fAliITSQADataMakerRec->GetRecPointsData(11 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(rad);//r distribution |
713 | fAliITSQADataMakerRec->GetRecPointsData(13 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(phi);//phi distribution | |
714 | fAliITSQADataMakerRec->GetRecPointsData(5 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluglo[2],phi);// zphi distribution layer 4 | |
715 | fAliITSQADataMakerRec->GetRecPointsData(15 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(drifttime);// time distribution layer 4 | |
716 | } | |
717 | } | |
718 | } | |
58ceb8ca | 719 | return rv ; |
ebdd0606 | 720 | } |
721 | ||
ad300de9 | 722 | //_______________________________________________________________ |
723 | ||
80b9610c | 724 | Int_t AliITSQASDDDataMakerRec::GetOffset(AliQAv1::TASKINDEX_t task, Int_t specie) |
7a0e5776 | 725 | { |
ad300de9 | 726 | Int_t offset=0; |
4e25ac79 | 727 | if( task == AliQAv1::kRAWS ) |
7a0e5776 | 728 | { |
80b9610c | 729 | offset=fGenRawsOffset[specie]; |
7a0e5776 | 730 | } |
eca4fa66 | 731 | else if(task == AliQAv1::kDIGITSR ) |
732 | { | |
80b9610c | 733 | offset=fGenDigitsOffset[specie]; |
eca4fa66 | 734 | } |
735 | else if( task == AliQAv1::kRECPOINTS ) | |
736 | { | |
80b9610c | 737 | offset=fGenRecPointsOffset[specie]; |
eca4fa66 | 738 | } |
ad300de9 | 739 | return offset; |
740 | } | |
741 | ||
742 | //_______________________________________________________________ | |
743 | ||
8b7e858c | 744 | void AliITSQASDDDataMakerRec::SetOffset(AliQAv1::TASKINDEX_t task, Int_t offset, Int_t specie) { |
eca4fa66 | 745 | // Returns offset number according to the specified task |
746 | if( task == AliQAv1::kRAWS ) { | |
8b7e858c | 747 | fGenRawsOffset[specie]=offset; |
eca4fa66 | 748 | } |
749 | else if( task == AliQAv1::kDIGITSR ) { | |
4a903927 | 750 | fGenDigitsOffset[specie]=offset; |
eca4fa66 | 751 | } |
752 | else if( task == AliQAv1::kRECPOINTS ) { | |
8b7e858c | 753 | fGenRecPointsOffset[specie]=offset; |
eca4fa66 | 754 | } |
755 | } | |
756 | ||
757 | //_______________________________________________________________ | |
758 | ||
4e25ac79 | 759 | Int_t AliITSQASDDDataMakerRec::GetTaskHisto(AliQAv1::TASKINDEX_t task) |
7a0e5776 | 760 | { |
ad300de9 | 761 | |
7a0e5776 | 762 | Int_t histotot=0; |
ad300de9 | 763 | |
4e25ac79 | 764 | if( task == AliQAv1::kRAWS ) |
7a0e5776 | 765 | { |
766 | histotot=fSDDhRawsTask ; | |
767 | } | |
eca4fa66 | 768 | else if(task == AliQAv1::kDIGITSR) |
769 | { | |
770 | histotot=fSDDhDigitsTask; | |
771 | } | |
772 | else if( task == AliQAv1::kRECPOINTS ) | |
773 | { | |
774 | histotot=fSDDhRecPointsTask; | |
775 | } | |
8b7e858c | 776 | else { |
777 | AliInfo("No task has been selected. TaskHisto set to zero.\n"); | |
778 | } | |
ad300de9 | 779 | return histotot; |
e41192d7 | 780 | } |
8b7e858c | 781 | |
58ceb8ca | 782 | |
783 | //_______________________________________________________________ | |
784 | ||
785 | ||
786 | void AliITSQASDDDataMakerRec::CreateTheMap() | |
787 | { | |
8b7e858c | 788 | |
58ceb8ca | 789 | AliCDBEntry *ddlMapSDD = AliCDBManager::Instance()->Get("ITS/Calib/DDLMapSDD"); |
790 | Bool_t cacheStatus = AliCDBManager::Instance()->GetCacheFlag(); | |
791 | if(!ddlMapSDD) | |
792 | { | |
793 | AliError("Calibration object retrieval failed! SDD will not be processed"); | |
794 | fDDLModuleMap = NULL; | |
795 | //return rv; | |
796 | } | |
797 | fDDLModuleMap = (AliITSDDLModuleMapSDD*)ddlMapSDD->GetObject(); | |
798 | if(!cacheStatus)ddlMapSDD->SetObject(NULL); | |
799 | ddlMapSDD->SetOwner(kTRUE); | |
800 | if(!cacheStatus) | |
801 | { | |
802 | delete ddlMapSDD; | |
803 | } | |
804 | AliInfo("DDL Map Created\n "); | |
805 | } | |
5af1d436 | 806 | |
807 | ||
808 | //____________________________________________________________________ | |
809 | ||
810 | void AliITSQASDDDataMakerRec::ResetDetector(AliQAv1::TASKINDEX_t task) | |
811 | { | |
812 | ||
813 | AliInfo(Form("Reset detector in SDD called for task index %i", task)); | |
814 | if(task== AliQAv1::kRAWS ){ | |
815 | ||
816 | fDDLModuleMap=NULL; | |
817 | } | |
818 | ||
819 | } |