1 /**************************************************************************
2 * Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 // *************************************************************
19 // Checks the quality assurance
20 // by comparing with reference data
22 // -------------------------------------------------------------
23 // W. Ferrarese + P. Cerello Feb 2008
24 // M.Siciliano Aug 2008 QA RecPoints and HLT mode
27 // --- ROOT system ---
29 #include <TProfile2D.h>
35 #include <TDirectory.h>
37 // --- Standard library ---
39 // --- AliRoot header files ---
40 #include "AliITSQASDDDataMakerRec.h"
43 #include "AliQAChecker.h"
44 #include "AliRawReader.h"
45 #include "AliITSRawStream.h"
46 #include "AliITSRawStreamSDD.h"
47 #include "AliITSRawStreamSDDCompressed.h"
48 #include "AliITSDetTypeRec.h"
49 #include "AliITSDigit.h"
50 #include "AliITSRecPoint.h"
51 #include "AliITSgeomTGeo.h"
52 #include "AliITSHLTforSDD.h"
53 #include "AliCDBManager.h"
54 #include "AliCDBStorage.h"
55 #include "AliCDBEntry.h"
56 #include "Riostream.h"
58 ClassImp(AliITSQASDDDataMakerRec)
60 //____________________________________________________________________________
61 AliITSQASDDDataMakerRec::AliITSQASDDDataMakerRec(AliITSQADataMakerRec *aliITSQADataMakerRec, Bool_t kMode, Short_t ldc) :
63 fAliITSQADataMakerRec(aliITSQADataMakerRec),
68 fSDDhRecPointsTask(0),
71 fGenRecPointsOffset(0),
77 //ctor used to discriminate OnLine-Offline analysis
78 if(fLDC < 0 || fLDC > 4) {
79 AliError("Error: LDC number out of range; return\n");
81 if(!fkOnline){AliInfo("Offline mode: HLT set from AliITSDetTypeRec for SDD\n");}
84 AliInfo("Online mode: HLT set from environment for SDD\n");
85 SetHLTModeFromEnvironment();
90 //____________________________________________________________________________
91 AliITSQASDDDataMakerRec::AliITSQASDDDataMakerRec(const AliITSQASDDDataMakerRec& qadm) :
93 fAliITSQADataMakerRec(qadm.fAliITSQADataMakerRec),
94 fkOnline(qadm.fkOnline),
96 fSDDhRawsTask(qadm.fSDDhRawsTask),
97 fSDDhDigitsTask(qadm.fSDDhDigitsTask),
98 fSDDhRecPointsTask(qadm.fSDDhRecPointsTask),
99 fGenRawsOffset(qadm.fGenRawsOffset),
100 fGenDigitsOffset(qadm.fGenDigitsOffset),
101 fGenRecPointsOffset(qadm.fGenRecPointsOffset),
104 fHLTMode(qadm.fHLTMode),
105 fHLTSDD( qadm.fHLTSDD)
108 fAliITSQADataMakerRec->SetName((const char*)qadm.fAliITSQADataMakerRec->GetName()) ;
109 fAliITSQADataMakerRec->SetTitle((const char*)qadm.fAliITSQADataMakerRec->GetTitle());
113 //____________________________________________________________________________
114 AliITSQASDDDataMakerRec::~AliITSQASDDDataMakerRec(){
116 // if(fDDLModuleMap) delete fDDLModuleMap;
118 //__________________________________________________________________
119 AliITSQASDDDataMakerRec& AliITSQASDDDataMakerRec::operator = (const AliITSQASDDDataMakerRec& qac )
122 this->~AliITSQASDDDataMakerRec();
123 new(this) AliITSQASDDDataMakerRec(qac);
127 //____________________________________________________________________________
128 void AliITSQASDDDataMakerRec::StartOfDetectorCycle()
130 //Detector specific actions at start of cycle
131 AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM::Start of SDD Cycle\n");
134 //____________________________________________________________________________
135 void AliITSQASDDDataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t /*task*/, TObjArray* /*list*/)
137 // launch the QA checking
138 AliDebug(AliQAv1::GetQADebugLevel(),"AliITSDM instantiates checker with Run(AliQAv1::kITS, task, list)\n");
141 //____________________________________________________________________________
142 void AliITSQASDDDataMakerRec::InitRaws()
144 // Initialization for RAW data - SDD -
145 const Bool_t expert = kTRUE ;
146 const Bool_t saveCorr = kTRUE ;
147 const Bool_t image = kTRUE ;
149 fGenRawsOffset = (fAliITSQADataMakerRec->fRawsQAList[AliRecoParam::kDefault])->GetEntries();
150 AliCDBEntry *ddlMapSDD = AliCDBManager::Instance()->Get("ITS/Calib/DDLMapSDD");
151 Bool_t cacheStatus = AliCDBManager::Instance()->GetCacheFlag();
154 AliError("Calibration object retrieval failed! SDD will not be processed");
155 fDDLModuleMap = NULL;
158 fDDLModuleMap = (AliITSDDLModuleMapSDD*)ddlMapSDD->GetObject();
159 if(!cacheStatus)ddlMapSDD->SetObject(NULL);
160 ddlMapSDD->SetOwner(kTRUE);
166 if(fkOnline==kFALSE){
167 AliInfo("Offline mode: HLTforSDDobject used \n");
168 AliCDBEntry *hltforSDD = AliCDBManager::Instance()->Get("ITS/Calib/HLTforSDD");
170 AliError("Calibration object retrieval failed! SDD will not be processed");
174 fHLTSDD = (AliITSHLTforSDD*)hltforSDD->GetObject();
175 if(!cacheStatus)hltforSDD->SetObject(NULL);
176 hltforSDD->SetOwner(kTRUE);
188 AliInfo("Book Online Histograms for SDD\n");
192 AliInfo("Book Offline Histograms for SDD\n ");
194 TH1D *h0 = new TH1D("SDDModPattern","HW Modules pattern",fgknSDDmodules,239.5,499.5); //0
195 h0->GetXaxis()->SetTitle("Module Number");
196 h0->GetYaxis()->SetTitle("Counts");
197 fAliITSQADataMakerRec->Add2RawsList((new TH1D(*h0)),0+fGenRawsOffset, expert, !image, !saveCorr);
201 //zPhi distribution using ladder and modules numbers
202 TH2D *hphil3 = new TH2D("SDDphizL3","SDD #varphiz Layer3 ",6,0.5,6.5,14,0.5,14.5);
203 hphil3->GetXaxis()->SetTitle("z[#Module L3 ]");
204 hphil3->GetYaxis()->SetTitle("#varphi[#Ladder L3]");
205 fAliITSQADataMakerRec->Add2RawsList((new TH2D(*hphil3)),1+fGenRawsOffset, !expert, image, saveCorr);
209 TH2D *hphil4 = new TH2D("SDDphizL4","SDD #varphiz Layer4 ",8,0.5,8.5,22,0.5,22.5);
210 hphil4->GetXaxis()->SetTitle("z[#Module L4]");
211 hphil4->GetYaxis()->SetTitle("#varphi[#Ladder L4]");
212 fAliITSQADataMakerRec->Add2RawsList((new TH2D(*hphil4)),2+fGenRawsOffset, !expert, image, saveCorr);
221 TH2D *hddl = new TH2D("SDDDDLPattern","SDD DDL Pattern ",24,-0.5,23.5,24,-0.5,23.5);
222 hddl->GetXaxis()->SetTitle("Channel");
223 hddl->GetYaxis()->SetTitle("#DDL");
224 fAliITSQADataMakerRec->Add2RawsList((new TH2D(*hddl)),3+fGenRawsOffset, expert, !image, !saveCorr);
227 Int_t indexlast1 = 0;
232 indexlast1 = fSDDhRawsTask;
234 for(Int_t i=0; i<3; i++) hname[i]= new char[50];
235 for(Int_t moduleSDD =0; moduleSDD<fgknSDDmodules; moduleSDD++){
236 for(Int_t iside=0;iside<fgknSide;iside++){
237 AliITSgeomTGeo::GetModuleId(moduleSDD+fgkmodoffset, lay, lad, det);
238 sprintf(hname[0],"SDDchargeMapFSE_L%d_%d_%d_%d",lay,lad,det,iside);
239 sprintf(hname[1],"SDDChargeMapForSingleEvent_L%d_%d_%d_%d",lay,lad,det,iside);
240 sprintf(hname[2],"SDDhmonoDMap_L%d_%d_%d_%d",lay,lad,det,iside);
241 TProfile2D *fModuleChargeMapFSE = new TProfile2D(hname[0],hname[1],256/fTimeBinSize,-0.5,255.5,256,-0.5,255.5);
242 fModuleChargeMapFSE->GetXaxis()->SetTitle("Time Bin");
243 fModuleChargeMapFSE->GetYaxis()->SetTitle("Anode");
244 fAliITSQADataMakerRec->Add2RawsList((new TProfile2D(*fModuleChargeMapFSE)),indexlast1 + index1 + fGenRawsOffset, expert, !image, !saveCorr);
245 delete fModuleChargeMapFSE;
252 for(Int_t moduleSDD =0; moduleSDD<fgknSDDmodules; moduleSDD++){
253 for(Int_t iside=0;iside<fgknSide;iside++){
254 AliITSgeomTGeo::GetModuleId(moduleSDD+fgkmodoffset, lay, lad, det);
255 sprintf(hname[0],"SDDchargeMap_L%d_%d_%d_%d",lay,lad,det,iside);
256 sprintf(hname[1],"SDDChargeMap_L%d_%d_%d_%d",lay,lad,det,iside);
257 TProfile2D *fModuleChargeMap = new TProfile2D(hname[0],hname[1],256/fTimeBinSize,-0.5,255.5,256,-0.5,255.5);
258 fModuleChargeMap->GetXaxis()->SetTitle("Time Bin");
259 fModuleChargeMap->GetYaxis()->SetTitle("Anode");
260 fAliITSQADataMakerRec->Add2RawsList((new TProfile2D(*fModuleChargeMap)),indexlast1 + index1 + fGenRawsOffset, expert, !image, !saveCorr);
261 delete fModuleChargeMap;
270 AliDebug(AliQAv1::GetQADebugLevel(),Form("%d SDD Raws histograms booked\n",fSDDhRawsTask));
274 //____________________________________________________________________________
275 void AliITSQASDDDataMakerRec::MakeRaws(AliRawReader* rawReader)
277 // Fill QA for RAW - SDD -
280 AliError("SDD DDL module map not available - skipping SDD QA");
283 if(rawReader->GetType() != 7) return; // skips non physical triggers
284 AliDebug(AliQAv1::GetQADebugLevel(),"entering MakeRaws\n");
287 AliITSRawStream *stream;
291 if(GetHLTMode()==kTRUE)
293 //AliInfo("Online mode: HLT C compressed mode used for SDD\n");
294 stream = new AliITSRawStreamSDDCompressed(rawReader); }
296 //AliInfo("Online mode: HLT A mode used for SDD\n");
297 stream = new AliITSRawStreamSDD(rawReader);}
301 if(fHLTSDD->IsHLTmodeC()==kTRUE){
302 //AliInfo("Offline mode: HLT C compressed mode used for SDD\n");
303 stream = new AliITSRawStreamSDDCompressed(rawReader);
306 //AliInfo("Offline mode: HLT A mode used for SDD\n");
307 stream = new AliITSRawStreamSDD(rawReader);
313 // AliITSRawStreamSDD s(rawReader);
314 stream->SetDDLModuleMap(fDDLModuleMap);
320 for(Int_t moduleSDD =0; moduleSDD<fgknSDDmodules; moduleSDD++){
321 for(Int_t iside=0;iside<fgknSide;iside++) {
322 if(fSDDhRawsTask > 4 + index) fAliITSQADataMakerRec->GetRawsData(4 + index +fGenRawsOffset)->Reset();
323 // 4 because the 2D histos for single events start after the fourth position
333 Int_t coord1, coord2, signal, moduleSDD, activeModule, index1;
335 while(stream->Next()) {
336 ildcID = rawReader->GetLDCId();
337 iddl = rawReader->GetDDLID() - fgkDDLIDshift;
339 isddmod = fDDLModuleMap->GetModuleNumber(iddl,stream->GetCarlosId());
341 AliDebug(AliQAv1::GetQADebugLevel(),Form("Found module with iddl: %d, stream->GetCarlosId: %d \n",iddl,stream->GetCarlosId()));
344 if(stream->IsCompletedModule()) {
345 AliDebug(AliQAv1::GetQADebugLevel(),Form("IsCompletedModule == KTRUE\n"));
348 if(stream->IsCompletedDDL()) {
349 AliDebug(AliQAv1::GetQADebugLevel(),Form("IsCompletedDDL == KTRUE\n"));
353 coord1 = stream->GetCoord1();
354 coord2 = stream->GetCoord2();
355 signal = stream->GetSignal();
357 moduleSDD = isddmod - fgkmodoffset;
359 if(isddmod <fgkmodoffset|| isddmod>fgknSDDmodules+fgkmodoffset-1) {
360 AliDebug(AliQAv1::GetQADebugLevel(),Form( "Module SDD = %d, resetting it to 1 \n",isddmod));
364 AliITSgeomTGeo::GetModuleId(isddmod, lay, lad, det);
367 fAliITSQADataMakerRec->GetRawsData( 0 + fGenRawsOffset )->Fill(isddmod);
369 if(lay==3) fAliITSQADataMakerRec->GetRawsData(1+fGenRawsOffset)->Fill(det,lad);
371 fAliITSQADataMakerRec->GetRawsData(2+fGenRawsOffset)->Fill(det,lad);}
373 Short_t iside = stream->GetChannel();
375 fAliITSQADataMakerRec->GetRawsData(3+fGenRawsOffset)->Fill(2*(stream->GetCarlosId())+iside,iddl);
380 activeModule = moduleSDD;
381 index1 = activeModule * 2 + iside;
384 AliDebug(AliQAv1::GetQADebugLevel(),Form("Wrong index number %d - patched to 0\n",index1));
387 fAliITSQADataMakerRec->GetRawsData(3+fGenRawsOffset)->Fill(2*(stream->GetCarlosId())+iside,iddl);
388 if(fSDDhRawsTask > 4 + index1) {
389 ((TProfile2D *)(fAliITSQADataMakerRec->GetRawsData(4 + index1 +fGenRawsOffset)))->Fill(coord2, coord1, signal);
390 ((TProfile2D *)(fAliITSQADataMakerRec->GetRawsData(4 + index1 + 260*2 +fGenRawsOffset)))->Fill(coord2, coord1, signal);
394 if(!(cnt%10000)) AliDebug(AliQAv1::GetQADebugLevel(),Form(" %d raw digits read",cnt));
396 AliDebug(AliQAv1::GetQADebugLevel(),Form("Event completed, %d raw digits read",cnt));
401 //____________________________________________________________________________
402 void AliITSQASDDDataMakerRec::InitDigits()
404 // Initialization for DIGIT data - SDD -
405 const Bool_t expert = kTRUE ;
406 const Bool_t image = kTRUE ;
408 fGenDigitsOffset = (fAliITSQADataMakerRec->fDigitsQAList[AliRecoParam::kDefault])->GetEntries();
409 //fSDDhTask must be incremented by one unit every time a histogram is ADDED to the QA List
410 TH1F* h0=new TH1F("SDD DIGITS Module Pattern","SDD DIGITS Module Pattern",260,239.5,499.5); //hmod
411 h0->GetXaxis()->SetTitle("SDD Module Number");
412 h0->GetYaxis()->SetTitle("# DIGITS");
413 fAliITSQADataMakerRec->Add2DigitsList(h0,fGenDigitsOffset, !expert, image);
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");
418 fAliITSQADataMakerRec->Add2DigitsList(h1,1+fGenDigitsOffset, !expert, image);
420 TH1F* h2=new TH1F("SDD Tbin Distribution","DIGITS Tbin Distribution",256,-0.5,255.5); //htbocc
421 h2->GetXaxis()->SetTitle("Tbin Number");
422 h2->GetYaxis()->SetTitle("# DIGITS");
423 fAliITSQADataMakerRec->Add2DigitsList(h2,2+fGenDigitsOffset, !expert, image);
425 TH1F* h3=new TH1F("SDD ADC Counts Distribution","DIGITS ADC Counts Distribution",200,0.,1024.); //hsig
426 h3->GetXaxis()->SetTitle("ADC Value");
427 h3->GetYaxis()->SetTitle("# DIGITS");
428 fAliITSQADataMakerRec->Add2DigitsList(h3,3+fGenDigitsOffset, !expert, image);
430 AliDebug(AliQAv1::GetQADebugLevel(),Form("%d SDD Digits histograms booked\n",fSDDhDigitsTask));
433 //____________________________________________________________________________
434 void AliITSQASDDDataMakerRec::MakeDigits(TTree * digits)
437 // Fill QA for DIGIT - SDD -
438 // AliITS *fITS = (AliITS*)gAlice->GetModule("ITS");
439 // fITS->SetTreeAddress();
440 // TClonesArray *iITSdigits = fITS->DigitsAddress(1);
441 TBranch *branchD = digits->GetBranch("ITS");
443 AliError("can't get the branch with the ITS digits !");
446 static TClonesArray statDigits("AliITSDigit");
447 TClonesArray *iITSdigits = &statDigits;
448 branchD->SetAddress(&iITSdigits);
449 for(Int_t i=0; i<260; i++){
451 digits->GetEvent(nmod);
452 Int_t ndigits = iITSdigits->GetEntries();
453 fAliITSQADataMakerRec->GetDigitsData(fGenDigitsOffset)->Fill(nmod,ndigits);
454 for (Int_t idig=0; idig<ndigits; idig++) {
455 AliITSdigit *dig=(AliITSdigit*)iITSdigits->UncheckedAt(idig);
456 Int_t iz=dig->GetCoord1(); // cell number z
457 Int_t ix=dig->GetCoord2(); // cell number x
458 Int_t sig=dig->GetSignal();
459 fAliITSQADataMakerRec->GetDigitsData(1+fGenDigitsOffset)->Fill(iz);
460 fAliITSQADataMakerRec->GetDigitsData(2+fGenDigitsOffset)->Fill(ix);
461 fAliITSQADataMakerRec->GetDigitsData(3+fGenDigitsOffset)->Fill(sig);
466 //____________________________________________________________________________
467 void AliITSQASDDDataMakerRec::InitRecPoints()
469 // Initialization for RECPOINTS - SDD -
470 const Bool_t expert = kTRUE ;
471 const Bool_t image = kTRUE ;
473 fGenRecPointsOffset = (fAliITSQADataMakerRec->fRecPointsQAList[AliRecoParam::kDefault])->GetEntries();
488 TH1F *h0 = new TH1F("SDDLay3TotCh","Layer 3 total charge",1000/nOnline,-0.5, 499.5); //position number 0
489 h0->GetXaxis()->SetTitle("ADC value");
490 h0->GetYaxis()->SetTitle("Entries");
491 fAliITSQADataMakerRec->Add2RecPointsList((new TH1F(*h0)), 0 +fGenRecPointsOffset, !expert, image);
493 fSDDhRecPointsTask++;
495 TH1F *h1 = new TH1F("SDDLay4TotCh","Layer 4 total charge",1000/nOnline,-0.5, 499.5);//position number 1
496 h1->GetXaxis()->SetTitle("ADC value");
497 h1->GetYaxis()->SetTitle("Entries");
498 fAliITSQADataMakerRec->Add2RecPointsList((new TH1F(*h1)), 1 +fGenRecPointsOffset, !expert, image);
500 fSDDhRecPointsTask++;
503 TH2F *h2 = new TH2F("SDDGlobalCoordDistribYX","YX Global Coord Distrib",5600/nOnline2,-28,28,5600/nOnline2,-28,28);//position number 2
504 h2->GetYaxis()->SetTitle("Y[cm]");
505 h2->GetXaxis()->SetTitle("X[cm]");
506 fAliITSQADataMakerRec->Add2RecPointsList((new TH2F(*h2)),2+fGenRecPointsOffset, expert, !image);
508 fSDDhRecPointsTask++;
510 TH2F *h3 = new TH2F("SDDGlobalCoordDistribRZ","RZ Global Coord Distrib",6400/nOnline3,-32,32,1400/nOnline4,12,26);//position number 3
511 h3->GetYaxis()->SetTitle("R[cm]");
512 h3->GetXaxis()->SetTitle("Z[cm]");
513 fAliITSQADataMakerRec->Add2RecPointsList((new TH2F(*h3)),3+fGenRecPointsOffset, expert, !image);
515 fSDDhRecPointsTask++;
517 TH2F *h4 = new TH2F("SDDGlobalCoordDistribL3PHIZ","#varphi Z Global Coord Distrib L3",6400/nOnline3,-32,32,360/nOnline,-TMath::Pi(),TMath::Pi());//position number 4
518 h4->GetYaxis()->SetTitle("#phi[rad]");
519 h4->GetXaxis()->SetTitle("Z[cm]");
520 fAliITSQADataMakerRec->Add2RecPointsList((new TH2F(*h4)),4+fGenRecPointsOffset, !expert, image);
522 fSDDhRecPointsTask++;
524 TH2F *h5 = new TH2F("SDDGlobalCoordDistribL4PHIZ","#varphi Z Global Coord Distrib L4",6400/nOnline3,-32,32,360/nOnline,-TMath::Pi(),TMath::Pi());//position number 5
525 h5->GetYaxis()->SetTitle("#phi[rad]");
526 h5->GetXaxis()->SetTitle("Z[cm]");
527 fAliITSQADataMakerRec->Add2RecPointsList((new TH2F(*h5)),5+fGenRecPointsOffset, !expert, image);
529 fSDDhRecPointsTask++;
531 TH1F *h6 = new TH1F("SDDModPatternRP","Modules pattern RP",fgknSDDmodules,239.5,499.5); //position number 6
532 h6->GetXaxis()->SetTitle("Module number"); //spd offset = 240
533 h6->GetYaxis()->SetTitle("Entries");
534 fAliITSQADataMakerRec->Add2RecPointsList((new TH1F(*h6)),6 +fGenRecPointsOffset, expert, !image);
536 fSDDhRecPointsTask++;
537 TH1F *h7 = new TH1F("SDDLadPatternL3RP","Ladder pattern L3 RP",14,0.5,14.5); //position number 7
538 h7->GetXaxis()->SetTitle("Ladder #, Layer 3");
539 h7->GetYaxis()->SetTitle("Entries");
540 fAliITSQADataMakerRec->Add2RecPointsList((new TH1F(*h7)),7 +fGenRecPointsOffset, expert, !image);
542 fSDDhRecPointsTask++;
543 TH1F *h8 = new TH1F("SDDLadPatternL4RP","Ladder pattern L4 RP",22,0.5,22.5); //position number 8
544 h8->GetXaxis()->SetTitle("Ladder #, Layer 4");
545 h8->GetYaxis()->SetTitle("Entries");
546 fAliITSQADataMakerRec->Add2RecPointsList((new TH1F(*h8)),8 +fGenRecPointsOffset, expert, !image);
548 fSDDhRecPointsTask++;
549 TH2F *h9 = new TH2F("SDDLocalCoordDistrib","Local Coord Distrib",1000/nOnline,-4,4,1000/nOnline,-4,4);//position number 9
550 h9->GetXaxis()->SetTitle("X local coord, drift, cm");
551 h9->GetYaxis()->SetTitle("Z local coord, anode, cm");
552 fAliITSQADataMakerRec->Add2RecPointsList((new TH2F(*h9)),9 +fGenRecPointsOffset, expert, !image);
554 fSDDhRecPointsTask++;
557 TH1F *h10 = new TH1F("SDDrdistrib_Layer3" ,"SDD r distribution Layer3" ,100,14.,18.);//position number 10 (L3)
558 h10->GetXaxis()->SetTitle("r[cm]");
559 h10->GetXaxis()->CenterTitle();
560 h10->GetYaxis()->SetTitle("Entries");
561 fAliITSQADataMakerRec->Add2RecPointsList((new TH1F(*h10)),10 +fGenRecPointsOffset, expert, !image);
563 fSDDhRecPointsTask++;
565 TH1F *h11 = new TH1F("SDDrdistrib_Layer4" ,"SDD r distribution Layer4" ,100,22.,26.);// and position number 11 (L4)
566 h11->GetXaxis()->SetTitle("r[cm]");
567 h11->GetXaxis()->CenterTitle();
568 h11->GetYaxis()->SetTitle("Entries");
569 fAliITSQADataMakerRec->Add2RecPointsList((new TH1F(*h11)),11 +fGenRecPointsOffset, expert, !image);
571 fSDDhRecPointsTask++;
573 for(Int_t iLay=0; iLay<=1; iLay++){
574 sprintf(hisnam,"SDDphidistrib_Layer%d",iLay+3);
575 TH1F *h12 = new TH1F(hisnam,hisnam,180,-TMath::Pi(),TMath::Pi());//position number 12 (L3) and position number 13 (L4)
576 h12->GetXaxis()->SetTitle("#varphi[rad]");
577 h12->GetXaxis()->CenterTitle();
578 h12->GetYaxis()->SetTitle("Entries");
579 fAliITSQADataMakerRec->Add2RecPointsList((new TH1F(*h12)),iLay+12+fGenRecPointsOffset, expert, !image);
581 fSDDhRecPointsTask++;
586 TH2F *h14 = new TH2F("SDDGlobalCoordDistribYXFSE","YX Global Coord Distrib FSE",5600/nOnline2,-28,28,5600/nOnline2,-28,28);//position number 14
587 h14->GetYaxis()->SetTitle("Y[cm]");
588 h14->GetXaxis()->SetTitle("X[cm]");
589 fAliITSQADataMakerRec->Add2RecPointsList((new TH2F(*h14)),14+fGenRecPointsOffset, expert, !image);
591 fSDDhRecPointsTask++;
593 TH2F *h15 = new TH2F("SDDGlobalCoordDistribRZFSE","RZ Global Coord Distrib FSE",Int_t(6400/nOnline3),-32,32,1400/nOnline4,12,26);//position number 15
594 h15->GetYaxis()->SetTitle("R[cm]");
595 h15->GetXaxis()->SetTitle("Z[cm]");
596 fAliITSQADataMakerRec->Add2RecPointsList((new TH2F(*h15)),15+fGenRecPointsOffset, expert, !image);
598 fSDDhRecPointsTask++;
602 //printf("%d SDD Recs histograms booked\n",fSDDhRecPointsTask);
605 AliDebug(AliQAv1::GetQADebugLevel(),Form("%d SDD Recs histograms booked\n",fSDDhRecPointsTask));
610 //____________________________________________________________________________
611 void AliITSQASDDDataMakerRec::MakeRecPoints(TTree * clustersTree)
615 // Fill QA for RecPoints - SDD -
617 TBranch *branchRecP = clustersTree->GetBranch("ITSRecPoints");
619 AliError("can't get the branch with the ITS clusters !");
623 static TClonesArray statRecpoints("AliITSRecPoint") ;
624 TClonesArray *recpoints = &statRecpoints;
625 branchRecP->SetAddress(&recpoints);
627 Float_t cluglo[3]={0.,0.,0.};
630 for(Int_t i=14;i<16;i++)
632 fAliITSQADataMakerRec->GetRecPointsData(i+fGenRecPointsOffset)->Reset();
635 for(Int_t module=0; module<clustersTree->GetEntries();module++){
636 branchRecP->GetEvent(module);
637 npoints += recpoints->GetEntries();
638 AliITSgeomTGeo::GetModuleId(module, lay, lad, det);
639 //printf("modnumb %d, lay %d, lad %d, det %d \n",module, lay, lad, det);
640 for(Int_t j=0;j<recpoints->GetEntries();j++){
641 AliITSRecPoint *recp = (AliITSRecPoint*)recpoints->At(j);
642 fAliITSQADataMakerRec->GetRecPointsData(6 +fGenRecPointsOffset)->Fill(module);//modpatternrp
643 recp->GetGlobalXYZ(cluglo);
644 Float_t rad=TMath::Sqrt(cluglo[0]*cluglo[0]+cluglo[1]*cluglo[1]);
645 Float_t phi=TMath::ATan2(cluglo[1],cluglo[0]);
646 fAliITSQADataMakerRec->GetRecPointsData(9 +fGenRecPointsOffset)->Fill(recp->GetDetLocalX(),recp->GetDetLocalZ());//local distribution
647 fAliITSQADataMakerRec->GetRecPointsData(2 +fGenRecPointsOffset)->Fill(cluglo[0],cluglo[1]);//global distribution YX
648 fAliITSQADataMakerRec->GetRecPointsData(3 +fGenRecPointsOffset)->Fill(cluglo[2],rad);//global distribution rz
651 fAliITSQADataMakerRec->GetRecPointsData(14 +fGenRecPointsOffset)->Fill(cluglo[0],cluglo[1]);//global distribution YX FSE
652 fAliITSQADataMakerRec->GetRecPointsData(15 +fGenRecPointsOffset)->Fill(cluglo[2],rad);//global distribution rz FSE
654 if(recp->GetLayer() ==2) {
655 fAliITSQADataMakerRec->GetRecPointsData(0 +fGenRecPointsOffset)->Fill(recp->GetQ()) ;//total charge of layer 3
656 fAliITSQADataMakerRec->GetRecPointsData(7 +fGenRecPointsOffset)->Fill(lad);//lad pattern layer 3
657 fAliITSQADataMakerRec->GetRecPointsData(10 +fGenRecPointsOffset)->Fill(rad);//r distribution layer 3
658 fAliITSQADataMakerRec->GetRecPointsData(12 +fGenRecPointsOffset)->Fill(phi);// phi distribution layer 3
659 fAliITSQADataMakerRec->GetRecPointsData(4 +fGenRecPointsOffset)->Fill(cluglo[2],phi);// phi distribution layer 3
661 else if(recp->GetLayer() ==3) {
662 fAliITSQADataMakerRec->GetRecPointsData(1 +fGenRecPointsOffset)->Fill(recp->GetQ()) ;//total charge layer 4
663 fAliITSQADataMakerRec->GetRecPointsData(8 +fGenRecPointsOffset)->Fill(lad);//ladpatternlayer4
664 fAliITSQADataMakerRec->GetRecPointsData(11 +fGenRecPointsOffset)->Fill(rad);//r distribution
665 fAliITSQADataMakerRec->GetRecPointsData(13 +fGenRecPointsOffset)->Fill(phi);//phi distribution
666 fAliITSQADataMakerRec->GetRecPointsData(5 +fGenRecPointsOffset)->Fill(cluglo[2],phi);// phi distribution layer 4
670 statRecpoints.Clear();
674 //_______________________________________________________________
676 void AliITSQASDDDataMakerRec::SetHLTModeFromEnvironment()
679 Int_t hltmode= ::atoi(gSystem->Getenv("HLT_MODE"));
683 AliInfo("Online mode: HLT mode A selected from environment for SDD\n");
689 AliInfo("Online mode: HLT mode C compressed selected from environment for SDD\n");
695 //_______________________________________________________________
697 Int_t AliITSQASDDDataMakerRec::GetOffset(AliQAv1::TASKINDEX_t task)
700 if( task == AliQAv1::kRAWS )
702 offset=fGenRawsOffset;
705 if( task == AliQAv1::kRECPOINTS )
707 offset=fGenRecPointsOffset;
709 else AliInfo("No task has been selected. Offset set to zero.\n");
713 //_______________________________________________________________
715 Int_t AliITSQASDDDataMakerRec::GetTaskHisto(AliQAv1::TASKINDEX_t task)
720 if( task == AliQAv1::kRAWS )
722 histotot=fSDDhRawsTask ;
725 if( task == AliQAv1::kRECPOINTS )
727 histotot=fSDDhRecPointsTask;
729 else AliInfo("No task has been selected. TaskHisto set to zero.\n");