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"
57 #include "AliITSdigitSDD.h"
59 #include "AliRunLoader.h"
60 #include "AliITSLoader.h"
61 #include "AliITSDetTypeRec.h"
65 ClassImp(AliITSQASDDDataMakerRec)
67 //____________________________________________________________________________
68 AliITSQASDDDataMakerRec::AliITSQASDDDataMakerRec(AliITSQADataMakerRec *aliITSQADataMakerRec, Bool_t kMode, Short_t ldc) :
70 fAliITSQADataMakerRec(aliITSQADataMakerRec),
75 fSDDhRecPointsTask(0),
78 fGenRecPointsOffset(0),
84 //ctor used to discriminate OnLine-Offline analysis
85 if(fLDC < 0 || fLDC > 4) {
86 AliError("Error: LDC number out of range; return\n");
88 if(!fkOnline){AliInfo("Offline mode: HLT set from AliITSDetTypeRec for SDD\n");}
91 AliInfo("Online mode: HLT set from environment for SDD\n");
92 SetHLTModeFromEnvironment();
97 //____________________________________________________________________________
98 AliITSQASDDDataMakerRec::AliITSQASDDDataMakerRec(const AliITSQASDDDataMakerRec& qadm) :
100 fAliITSQADataMakerRec(qadm.fAliITSQADataMakerRec),
101 fkOnline(qadm.fkOnline),
103 fSDDhRawsTask(qadm.fSDDhRawsTask),
104 fSDDhDigitsTask(qadm.fSDDhDigitsTask),
105 fSDDhRecPointsTask(qadm.fSDDhRecPointsTask),
106 fGenRawsOffset(qadm.fGenRawsOffset),
107 fGenDigitsOffset(qadm.fGenDigitsOffset),
108 fGenRecPointsOffset(qadm.fGenRecPointsOffset),
111 fHLTMode(qadm.fHLTMode),
112 fHLTSDD( qadm.fHLTSDD)
115 fAliITSQADataMakerRec->SetName((const char*)qadm.fAliITSQADataMakerRec->GetName()) ;
116 fAliITSQADataMakerRec->SetTitle((const char*)qadm.fAliITSQADataMakerRec->GetTitle());
120 //____________________________________________________________________________
121 AliITSQASDDDataMakerRec::~AliITSQASDDDataMakerRec(){
123 // if(fDDLModuleMap) delete fDDLModuleMap;
125 //__________________________________________________________________
126 AliITSQASDDDataMakerRec& AliITSQASDDDataMakerRec::operator = (const AliITSQASDDDataMakerRec& qac )
129 this->~AliITSQASDDDataMakerRec();
130 new(this) AliITSQASDDDataMakerRec(qac);
134 //____________________________________________________________________________
135 void AliITSQASDDDataMakerRec::StartOfDetectorCycle()
137 //Detector specific actions at start of cycle
138 AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM::Start of SDD Cycle\n");
141 //____________________________________________________________________________
142 void AliITSQASDDDataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t /*task*/, TObjArray* /*list*/)
144 // launch the QA checking
145 AliDebug(AliQAv1::GetQADebugLevel(),"AliITSDM instantiates checker with Run(AliQAv1::kITS, task, list)\n");
148 //____________________________________________________________________________
149 Int_t AliITSQASDDDataMakerRec::InitRaws()
151 // Initialization for RAW data - SDD -
152 const Bool_t expert = kTRUE ;
153 const Bool_t saveCorr = kTRUE ;
154 const Bool_t image = kTRUE ;
156 //fGenRawsOffset = (fAliITSQADataMakerRec->fRawsQAList[AliRecoParam::kDefault])->GetEntries();
157 AliCDBEntry *ddlMapSDD = AliCDBManager::Instance()->Get("ITS/Calib/DDLMapSDD");
158 Bool_t cacheStatus = AliCDBManager::Instance()->GetCacheFlag();
161 AliError("Calibration object retrieval failed! SDD will not be processed");
162 fDDLModuleMap = NULL;
165 fDDLModuleMap = (AliITSDDLModuleMapSDD*)ddlMapSDD->GetObject();
166 if(!cacheStatus)ddlMapSDD->SetObject(NULL);
167 ddlMapSDD->SetOwner(kTRUE);
173 if(fkOnline==kFALSE){
174 AliInfo("Offline mode: HLTforSDDobject used \n");
175 AliCDBEntry *hltforSDD = AliCDBManager::Instance()->Get("ITS/Calib/HLTforSDD");
177 AliError("Calibration object retrieval failed! SDD will not be processed");
181 fHLTSDD = (AliITSHLTforSDD*)hltforSDD->GetObject();
182 if(!cacheStatus)hltforSDD->SetObject(NULL);
183 hltforSDD->SetOwner(kTRUE);
195 AliInfo("Book Online Histograms for SDD\n");
199 AliInfo("Book Offline Histograms for SDD\n ");
201 TH1D *h0 = new TH1D("SDDModPattern","HW Modules pattern",fgknSDDmodules,239.5,499.5); //0
202 h0->GetXaxis()->SetTitle("Module Number");
203 h0->GetYaxis()->SetTitle("Counts");
204 rv = fAliITSQADataMakerRec->Add2RawsList((new TH1D(*h0)),0+fGenRawsOffset, expert, !image, !saveCorr);
208 //zPhi distribution using ladder and modules numbers
209 TH2D *hphil3 = new TH2D("SDDphizL3","SDD #varphiz Layer3 ",6,0.5,6.5,14,0.5,14.5);
210 hphil3->GetXaxis()->SetTitle("z[#Module L3 ]");
211 hphil3->GetYaxis()->SetTitle("#varphi[#Ladder L3]");
212 rv = fAliITSQADataMakerRec->Add2RawsList((new TH2D(*hphil3)),1+fGenRawsOffset, !expert, image, saveCorr);
216 TH2D *hphil4 = new TH2D("SDDphizL4","SDD #varphiz Layer4 ",8,0.5,8.5,22,0.5,22.5);
217 hphil4->GetXaxis()->SetTitle("z[#Module L4]");
218 hphil4->GetYaxis()->SetTitle("#varphi[#Ladder L4]");
219 rv = fAliITSQADataMakerRec->Add2RawsList((new TH2D(*hphil4)),2+fGenRawsOffset, !expert, image, saveCorr);
228 TH2D *hddl = new TH2D("SDDDDLPattern","SDD DDL Pattern ",24,-0.5,23.5,24,-0.5,23.5);
229 hddl->GetXaxis()->SetTitle("Channel");
230 hddl->GetYaxis()->SetTitle("#DDL");
231 rv = fAliITSQADataMakerRec->Add2RawsList((new TH2D(*hddl)),3+fGenRawsOffset, expert, !image, !saveCorr);
234 Int_t indexlast1 = 0;
239 indexlast1 = fSDDhRawsTask;
241 for(Int_t i=0; i<3; i++) hname[i]= new char[50];
242 for(Int_t moduleSDD =0; moduleSDD<fgknSDDmodules; moduleSDD++){
243 for(Int_t iside=0;iside<fgknSide;iside++){
244 AliITSgeomTGeo::GetModuleId(moduleSDD+fgkmodoffset, lay, lad, det);
245 sprintf(hname[0],"SDDchargeMapFSE_L%d_%d_%d_%d",lay,lad,det,iside);
246 sprintf(hname[1],"SDDChargeMapForSingleEvent_L%d_%d_%d_%d",lay,lad,det,iside);
247 // sprintf(hname[2],"SDDhmonoDMap_L%d_%d_%d_%d",lay,lad,det,iside);
248 TProfile2D *fModuleChargeMapFSE = new TProfile2D(hname[0],hname[1],256/fTimeBinSize,-0.5,255.5,256,-0.5,255.5);
249 fModuleChargeMapFSE->GetXaxis()->SetTitle("Time Bin");
250 fModuleChargeMapFSE->GetYaxis()->SetTitle("Anode");
251 rv = fAliITSQADataMakerRec->Add2RawsList((new TProfile2D(*fModuleChargeMapFSE)),indexlast1 + index1 + fGenRawsOffset, expert, !image, !saveCorr);
252 delete fModuleChargeMapFSE;
259 for(Int_t moduleSDD =0; moduleSDD<fgknSDDmodules; moduleSDD++){
260 for(Int_t iside=0;iside<fgknSide;iside++){
261 AliITSgeomTGeo::GetModuleId(moduleSDD+fgkmodoffset, lay, lad, det);
262 sprintf(hname[0],"SDDchargeMap_L%d_%d_%d_%d",lay,lad,det,iside);
263 sprintf(hname[1],"SDDChargeMap_L%d_%d_%d_%d",lay,lad,det,iside);
264 TProfile2D *fModuleChargeMap = new TProfile2D(hname[0],hname[1],256/fTimeBinSize,-0.5,255.5,256,-0.5,255.5);
265 fModuleChargeMap->GetXaxis()->SetTitle("Time Bin");
266 fModuleChargeMap->GetYaxis()->SetTitle("Anode");
267 rv = fAliITSQADataMakerRec->Add2RawsList((new TProfile2D(*fModuleChargeMap)),indexlast1 + index1 + fGenRawsOffset, expert, !image, !saveCorr);
268 delete fModuleChargeMap;
277 AliDebug(AliQAv1::GetQADebugLevel(),Form("%d SDD Raws histograms booked\n",fSDDhRawsTask));
282 //____________________________________________________________________________
283 Int_t AliITSQASDDDataMakerRec::MakeRaws(AliRawReader* rawReader)
285 // Fill QA for RAW - SDD -
289 // Check id histograms already created for this Event Specie
290 if ( ! fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset) )
294 AliError("SDD DDL module map not available - skipping SDD QA");
297 if(rawReader->GetType() != 7) return rv; // skips non physical triggers
298 AliDebug(AliQAv1::GetQADebugLevel(),"entering MakeRaws\n");
303 AliITSRawStream *stream;
307 if(GetHLTMode()==kTRUE)
309 //AliInfo("Online mode: HLT C compressed mode used for SDD\n");
310 stream = new AliITSRawStreamSDDCompressed(rawReader); }
312 //AliInfo("Online mode: HLT A mode used for SDD\n");
313 stream = new AliITSRawStreamSDD(rawReader);}
317 if(fHLTSDD->IsHLTmodeC()==kTRUE){
318 //AliInfo("Offline mode: HLT C compressed mode used for SDD\n");
319 stream = new AliITSRawStreamSDDCompressed(rawReader);
322 //AliInfo("Offline mode: HLT A mode used for SDD\n");
323 stream = new AliITSRawStreamSDD(rawReader);
329 // AliITSRawStreamSDD s(rawReader);
330 stream->SetDDLModuleMap(fDDLModuleMap);
336 for(Int_t moduleSDD =0; moduleSDD<fgknSDDmodules; moduleSDD++){
337 for(Int_t iside=0;iside<fgknSide;iside++) {
338 if(fSDDhRawsTask > 4 + index) fAliITSQADataMakerRec->GetRawsData(4 + index +fGenRawsOffset)->Reset();
339 // 4 because the 2D histos for single events start after the fourth position
349 Int_t coord1, coord2, signal, moduleSDD, activeModule, index1;
351 while(stream->Next()) {
352 ildcID = rawReader->GetLDCId();
353 iddl = rawReader->GetDDLID() - fgkDDLIDshift;
355 isddmod = fDDLModuleMap->GetModuleNumber(iddl,stream->GetCarlosId());
357 AliDebug(AliQAv1::GetQADebugLevel(),Form("Found module with iddl: %d, stream->GetCarlosId: %d \n",iddl,stream->GetCarlosId()));
360 if(stream->IsCompletedModule()) {
361 AliDebug(AliQAv1::GetQADebugLevel(),Form("IsCompletedModule == KTRUE\n"));
364 if(stream->IsCompletedDDL()) {
365 AliDebug(AliQAv1::GetQADebugLevel(),Form("IsCompletedDDL == KTRUE\n"));
369 coord1 = stream->GetCoord1();
370 coord2 = stream->GetCoord2();
371 signal = stream->GetSignal();
373 moduleSDD = isddmod - fgkmodoffset;
375 if(isddmod <fgkmodoffset|| isddmod>fgknSDDmodules+fgkmodoffset-1) {
376 AliDebug(AliQAv1::GetQADebugLevel(),Form( "Module SDD = %d, resetting it to 1 \n",isddmod));
380 AliITSgeomTGeo::GetModuleId(isddmod, lay, lad, det);
383 fAliITSQADataMakerRec->GetRawsData( 0 + fGenRawsOffset )->Fill(isddmod);
385 if(lay==3) fAliITSQADataMakerRec->GetRawsData(1+fGenRawsOffset)->Fill(det,lad);
387 fAliITSQADataMakerRec->GetRawsData(2+fGenRawsOffset)->Fill(det,lad);}
389 Short_t iside = stream->GetChannel();
396 fAliITSQADataMakerRec->GetRawsData(3+fGenRawsOffset)->Fill(2*(stream->GetCarlosId())+iside,iddl);
398 activeModule = moduleSDD;
399 index1 = activeModule * 2 + iside;
402 AliDebug(AliQAv1::GetQADebugLevel(),Form("Wrong index number %d - patched to 0\n",index1));
405 fAliITSQADataMakerRec->GetRawsData(3+fGenRawsOffset)->Fill(2*(stream->GetCarlosId())+iside,iddl);
406 if(fSDDhRawsTask > 4 + index1) {
407 ((TProfile2D *)(fAliITSQADataMakerRec->GetRawsData(4 + index1 +fGenRawsOffset)))->Fill(coord2, coord1, signal);
408 ((TProfile2D *)(fAliITSQADataMakerRec->GetRawsData(4 + index1 + 260*2 +fGenRawsOffset)))->Fill(coord2, coord1, signal);
412 if(!(cnt%10000)) AliDebug(AliQAv1::GetQADebugLevel(),Form(" %d raw digits read",cnt));
414 AliDebug(AliQAv1::GetQADebugLevel(),Form("Event completed, %d raw digits read",cnt));
420 //____________________________________________________________________________
421 Int_t AliITSQASDDDataMakerRec::InitDigits()
425 // Initialization for DIGIT data - SDD -
426 const Bool_t expert = kTRUE ;
427 const Bool_t image = kTRUE ;
429 // fGenDigitsOffset = (fAliITSQADataMakerRec->fDigitsQAList[AliRecoParam::kDefault])->GetEntries();
430 //fSDDhTask must be incremented by one unit every time a histogram is ADDED to the QA List
431 TH1F* h0=new TH1F("SDD DIGITS Module Pattern","SDD DIGITS Module Pattern",260,239.5,499.5); //hmod
432 h0->GetXaxis()->SetTitle("SDD Module Number");
433 h0->GetYaxis()->SetTitle("# DIGITS");
434 rv = fAliITSQADataMakerRec->Add2DigitsList(h0,fGenDigitsOffset, !expert, image);
436 TH1F* h1=new TH1F("SDD Anode Distribution","DIGITS Anode Distribution",512,-0.5,511.5); //hanocc
437 h1->GetXaxis()->SetTitle("Anode Number");
438 h1->GetYaxis()->SetTitle("# DIGITS");
439 rv = fAliITSQADataMakerRec->Add2DigitsList(h1,1+fGenDigitsOffset, !expert, image);
441 TH1F* h2=new TH1F("SDD Tbin Distribution","DIGITS Tbin Distribution",256,-0.5,255.5); //htbocc
442 h2->GetXaxis()->SetTitle("Tbin Number");
443 h2->GetYaxis()->SetTitle("# DIGITS");
444 rv = fAliITSQADataMakerRec->Add2DigitsList(h2,2+fGenDigitsOffset, !expert, image);
446 TH1F* h3=new TH1F("SDD ADC Counts Distribution","DIGITS ADC Counts Distribution",200,0.,1024.); //hsig
447 h3->GetXaxis()->SetTitle("ADC Value");
448 h3->GetYaxis()->SetTitle("# DIGITS");
449 rv = fAliITSQADataMakerRec->Add2DigitsList(h3,3+fGenDigitsOffset, !expert, image);
451 AliDebug(AliQAv1::GetQADebugLevel(),Form("%d SDD Digits histograms booked\n",fSDDhDigitsTask));
455 //____________________________________________________________________________
456 Int_t AliITSQASDDDataMakerRec::MakeDigits(TTree * digits)
459 // Fill QA for DIGIT - SDD -
460 //AliITS *fITS = (AliITS*)gAlice->GetModule("ITS");
461 //fITS->SetTreeAddress();
462 //TClonesArray *iITSdigits = fITS->DigitsAddress(1);
467 TBranch *branchD = digits->GetBranch("ITSDigitsSDD");
470 AliError("can't get the branch with the ITS SDD digits !");
473 // Check id histograms already created for this Event Specie
474 if ( ! fAliITSQADataMakerRec->GetDigitsData(fGenDigitsOffset) )
477 static TClonesArray statDigits("AliITSdigitSDD");
478 TClonesArray *iITSdigits = &statDigits;
479 branchD->SetAddress(&iITSdigits);
481 for(Int_t i=0; i<260; i++){
483 digits->GetEvent(nmod);
484 Int_t ndigits = iITSdigits->GetEntries();
485 fAliITSQADataMakerRec->GetDigitsData(fGenDigitsOffset)->Fill(nmod,ndigits);
487 for (Int_t idig=0; idig<ndigits; idig++) {
488 AliITSdigit *dig=(AliITSdigit*)iITSdigits->UncheckedAt(idig);
489 Int_t iz=dig->GetCoord1(); // cell number z
490 Int_t ix=dig->GetCoord2(); // cell number x
491 Int_t sig=dig->GetSignal();
492 fAliITSQADataMakerRec->GetDigitsData(1+fGenDigitsOffset)->Fill(iz);
493 fAliITSQADataMakerRec->GetDigitsData(2+fGenDigitsOffset)->Fill(ix);
494 fAliITSQADataMakerRec->GetDigitsData(3+fGenDigitsOffset)->Fill(sig);
500 //____________________________________________________________________________
501 Int_t AliITSQASDDDataMakerRec::InitRecPoints()
505 // Initialization for RECPOINTS - SDD -
506 const Bool_t expert = kTRUE ;
507 const Bool_t image = kTRUE ;
509 // fGenRecPointsOffset = (fAliITSQADataMakerRec->fRecPointsQAList[AliRecoParam::kDefault])->GetEntries();
524 TH1F *h0 = new TH1F("SDDLay3TotCh","Layer 3 total charge",1000/nOnline,-0.5, 499.5); //position number 0
525 h0->GetXaxis()->SetTitle("ADC value");
526 h0->GetYaxis()->SetTitle("Entries");
527 rv = fAliITSQADataMakerRec->Add2RecPointsList((new TH1F(*h0)), 0 +fGenRecPointsOffset, !expert, image);
529 fSDDhRecPointsTask++;
531 TH1F *h1 = new TH1F("SDDLay4TotCh","Layer 4 total charge",1000/nOnline,-0.5, 499.5);//position number 1
532 h1->GetXaxis()->SetTitle("ADC value");
533 h1->GetYaxis()->SetTitle("Entries");
534 rv = fAliITSQADataMakerRec->Add2RecPointsList((new TH1F(*h1)), 1 +fGenRecPointsOffset, !expert, image);
536 fSDDhRecPointsTask++;
539 TH2F *h2 = new TH2F("SDDGlobalCoordDistribYX","YX Global Coord Distrib",5600/nOnline2,-28,28,5600/nOnline2,-28,28);//position number 2
540 h2->GetYaxis()->SetTitle("Y[cm]");
541 h2->GetXaxis()->SetTitle("X[cm]");
542 rv = fAliITSQADataMakerRec->Add2RecPointsList((new TH2F(*h2)),2+fGenRecPointsOffset, expert, !image);
544 fSDDhRecPointsTask++;
546 TH2F *h3 = new TH2F("SDDGlobalCoordDistribRZ","RZ Global Coord Distrib",6400/nOnline3,-32,32,1400/nOnline4,12,26);//position number 3
547 h3->GetYaxis()->SetTitle("R[cm]");
548 h3->GetXaxis()->SetTitle("Z[cm]");
549 rv = fAliITSQADataMakerRec->Add2RecPointsList((new TH2F(*h3)),3+fGenRecPointsOffset, expert, !image);
551 fSDDhRecPointsTask++;
553 TH2F *h4 = new TH2F("SDDGlobalCoordDistribL3PHIZ","#varphi Z Global Coord Distrib L3",6400/nOnline3,-32,32,360/nOnline,-TMath::Pi(),TMath::Pi());//position number 4
554 h4->GetYaxis()->SetTitle("#phi[rad]");
555 h4->GetXaxis()->SetTitle("Z[cm]");
556 rv = fAliITSQADataMakerRec->Add2RecPointsList((new TH2F(*h4)),4+fGenRecPointsOffset, !expert, image);
558 fSDDhRecPointsTask++;
560 TH2F *h5 = new TH2F("SDDGlobalCoordDistribL4PHIZ","#varphi Z Global Coord Distrib L4",6400/nOnline3,-32,32,360/nOnline,-TMath::Pi(),TMath::Pi());//position number 5
561 h5->GetYaxis()->SetTitle("#phi[rad]");
562 h5->GetXaxis()->SetTitle("Z[cm]");
563 rv = fAliITSQADataMakerRec->Add2RecPointsList((new TH2F(*h5)),5+fGenRecPointsOffset, !expert, image);
565 fSDDhRecPointsTask++;
567 TH1F *h6 = new TH1F("SDDModPatternRP","Modules pattern RP",fgknSDDmodules,239.5,499.5); //position number 6
568 h6->GetXaxis()->SetTitle("Module number"); //spd offset = 240
569 h6->GetYaxis()->SetTitle("Entries");
570 rv = fAliITSQADataMakerRec->Add2RecPointsList((new TH1F(*h6)),6 +fGenRecPointsOffset, expert, !image);
572 fSDDhRecPointsTask++;
573 TH1F *h7 = new TH1F("SDDLadPatternL3RP","Ladder pattern L3 RP",14,0.5,14.5); //position number 7
574 h7->GetXaxis()->SetTitle("Ladder #, Layer 3");
575 h7->GetYaxis()->SetTitle("Entries");
576 rv = fAliITSQADataMakerRec->Add2RecPointsList((new TH1F(*h7)),7 +fGenRecPointsOffset, expert, !image);
578 fSDDhRecPointsTask++;
579 TH1F *h8 = new TH1F("SDDLadPatternL4RP","Ladder pattern L4 RP",22,0.5,22.5); //position number 8
580 h8->GetXaxis()->SetTitle("Ladder #, Layer 4");
581 h8->GetYaxis()->SetTitle("Entries");
582 rv = fAliITSQADataMakerRec->Add2RecPointsList((new TH1F(*h8)),8 +fGenRecPointsOffset, expert, !image);
584 fSDDhRecPointsTask++;
585 TH2F *h9 = new TH2F("SDDLocalCoordDistrib","Local Coord Distrib",1000/nOnline,-4,4,1000/nOnline,-4,4);//position number 9
586 h9->GetXaxis()->SetTitle("X local coord, drift, cm");
587 h9->GetYaxis()->SetTitle("Z local coord, anode, cm");
588 rv = fAliITSQADataMakerRec->Add2RecPointsList((new TH2F(*h9)),9 +fGenRecPointsOffset, expert, !image);
590 fSDDhRecPointsTask++;
593 TH1F *h10 = new TH1F("SDDrdistrib_Layer3" ,"SDD r distribution Layer3" ,100,14.,18.);//position number 10 (L3)
594 h10->GetXaxis()->SetTitle("r[cm]");
595 h10->GetXaxis()->CenterTitle();
596 h10->GetYaxis()->SetTitle("Entries");
597 rv = fAliITSQADataMakerRec->Add2RecPointsList((new TH1F(*h10)),10 +fGenRecPointsOffset, expert, !image);
599 fSDDhRecPointsTask++;
601 TH1F *h11 = new TH1F("SDDrdistrib_Layer4" ,"SDD r distribution Layer4" ,100,22.,26.);// and position number 11 (L4)
602 h11->GetXaxis()->SetTitle("r[cm]");
603 h11->GetXaxis()->CenterTitle();
604 h11->GetYaxis()->SetTitle("Entries");
605 rv = fAliITSQADataMakerRec->Add2RecPointsList((new TH1F(*h11)),11 +fGenRecPointsOffset, expert, !image);
607 fSDDhRecPointsTask++;
609 for(Int_t iLay=0; iLay<=1; iLay++){
610 sprintf(hisnam,"SDDphidistrib_Layer%d",iLay+3);
611 TH1F *h12 = new TH1F(hisnam,hisnam,180,-TMath::Pi(),TMath::Pi());//position number 12 (L3) and position number 13 (L4)
612 h12->GetXaxis()->SetTitle("#varphi[rad]");
613 h12->GetXaxis()->CenterTitle();
614 h12->GetYaxis()->SetTitle("Entries");
615 rv = fAliITSQADataMakerRec->Add2RecPointsList((new TH1F(*h12)),iLay+12+fGenRecPointsOffset, expert, !image);
617 fSDDhRecPointsTask++;
622 TH2F *h14 = new TH2F("SDDGlobalCoordDistribYXFSE","YX Global Coord Distrib FSE",5600/nOnline2,-28,28,5600/nOnline2,-28,28);//position number 14
623 h14->GetYaxis()->SetTitle("Y[cm]");
624 h14->GetXaxis()->SetTitle("X[cm]");
625 rv = fAliITSQADataMakerRec->Add2RecPointsList((new TH2F(*h14)),14+fGenRecPointsOffset, expert, !image);
627 fSDDhRecPointsTask++;
629 TH2F *h15 = new TH2F("SDDGlobalCoordDistribRZFSE","RZ Global Coord Distrib FSE",Int_t(6400/nOnline3),-32,32,1400/nOnline4,12,26);//position number 15
630 h15->GetYaxis()->SetTitle("R[cm]");
631 h15->GetXaxis()->SetTitle("Z[cm]");
632 rv = fAliITSQADataMakerRec->Add2RecPointsList((new TH2F(*h15)),15+fGenRecPointsOffset, expert, !image);
634 fSDDhRecPointsTask++;
638 AliDebug(AliQAv1::GetQADebugLevel(),Form("%d SDD Recs histograms booked\n",fSDDhRecPointsTask));
643 //____________________________________________________________________________
644 Int_t AliITSQASDDDataMakerRec::MakeRecPoints(TTree * clustersTree)
646 // Fill QA for RecPoints - SDD -
649 // Check id histograms already created for this Event Specie
650 if ( ! fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset) )
651 rv = InitRecPoints() ;
653 TBranch *branchRecP = clustersTree->GetBranch("ITSRecPoints");
655 AliError("can't get the branch with the ITS clusters !");
659 static TClonesArray statRecpoints("AliITSRecPoint") ;
660 TClonesArray *recpoints = &statRecpoints;
661 branchRecP->SetAddress(&recpoints);
663 Float_t cluglo[3]={0.,0.,0.};
666 for(Int_t i=14;i<16;i++)
668 fAliITSQADataMakerRec->GetRecPointsData(i+fGenRecPointsOffset)->Reset();
671 for(Int_t module=0; module<clustersTree->GetEntries();module++){
672 branchRecP->GetEvent(module);
673 npoints += recpoints->GetEntries();
674 AliITSgeomTGeo::GetModuleId(module, lay, lad, det);
675 //printf("modnumb %d, lay %d, lad %d, det %d \n",module, lay, lad, det);
676 for(Int_t j=0;j<recpoints->GetEntries();j++){
677 AliITSRecPoint *recp = (AliITSRecPoint*)recpoints->At(j);
678 fAliITSQADataMakerRec->GetRecPointsData(6 +fGenRecPointsOffset)->Fill(module);//modpatternrp
679 recp->GetGlobalXYZ(cluglo);
680 Float_t rad=TMath::Sqrt(cluglo[0]*cluglo[0]+cluglo[1]*cluglo[1]);
681 Float_t phi=TMath::ATan2(cluglo[1],cluglo[0]);
683 fAliITSQADataMakerRec->GetRecPointsData(9 +fGenRecPointsOffset)->Fill(recp->GetDetLocalX(),recp->GetDetLocalZ());//local distribution
684 fAliITSQADataMakerRec->GetRecPointsData(2 +fGenRecPointsOffset)->Fill(cluglo[0],cluglo[1]);//global distribution YX
685 fAliITSQADataMakerRec->GetRecPointsData(3 +fGenRecPointsOffset)->Fill(cluglo[2],rad);//global distribution rz
688 fAliITSQADataMakerRec->GetRecPointsData(14 +fGenRecPointsOffset)->Fill(cluglo[0],cluglo[1]);//global distribution YX FSE
689 fAliITSQADataMakerRec->GetRecPointsData(15 +fGenRecPointsOffset)->Fill(cluglo[2],rad);//global distribution rz FSE
691 if(recp->GetLayer() ==3) {
692 fAliITSQADataMakerRec->GetRecPointsData(0 +fGenRecPointsOffset)->Fill(recp->GetQ()) ;//total charge of layer 3
693 fAliITSQADataMakerRec->GetRecPointsData(7 +fGenRecPointsOffset)->Fill(lad);//lad pattern layer 3
694 fAliITSQADataMakerRec->GetRecPointsData(10 +fGenRecPointsOffset)->Fill(rad);//r distribution layer 3
695 fAliITSQADataMakerRec->GetRecPointsData(12 +fGenRecPointsOffset)->Fill(phi);// phi distribution layer 3
696 fAliITSQADataMakerRec->GetRecPointsData(4 +fGenRecPointsOffset)->Fill(cluglo[2],phi);// phi distribution layer 3
698 else if(recp->GetLayer() ==4) {
699 fAliITSQADataMakerRec->GetRecPointsData(1 +fGenRecPointsOffset)->Fill(recp->GetQ()) ;//total charge layer 4
700 fAliITSQADataMakerRec->GetRecPointsData(8 +fGenRecPointsOffset)->Fill(lad);//ladpatternlayer4
701 fAliITSQADataMakerRec->GetRecPointsData(11 +fGenRecPointsOffset)->Fill(rad);//r distribution
702 fAliITSQADataMakerRec->GetRecPointsData(13 +fGenRecPointsOffset)->Fill(phi);//phi distribution
703 fAliITSQADataMakerRec->GetRecPointsData(5 +fGenRecPointsOffset)->Fill(cluglo[2],phi);// phi distribution layer 4
707 statRecpoints.Clear();
711 //_______________________________________________________________
713 void AliITSQASDDDataMakerRec::SetHLTModeFromEnvironment()
716 Int_t hltmode= ::atoi(gSystem->Getenv("HLT_MODE"));
720 AliInfo("Online mode: HLT mode A selected from environment for SDD\n");
726 AliInfo("Online mode: HLT mode C compressed selected from environment for SDD\n");
732 //_______________________________________________________________
734 Int_t AliITSQASDDDataMakerRec::GetOffset(AliQAv1::TASKINDEX_t task)
737 if( task == AliQAv1::kRAWS )
739 offset=fGenRawsOffset;
741 else if(task == AliQAv1::kDIGITSR )
743 offset=fGenDigitsOffset;
745 else if( task == AliQAv1::kRECPOINTS )
747 offset=fGenRecPointsOffset;
749 else AliInfo("No task has been selected. Offset set to zero.\n");
753 //_______________________________________________________________
755 void AliITSQASDDDataMakerRec::SetOffset(AliQAv1::TASKINDEX_t task, Int_t offset) {
756 // Returns offset number according to the specified task
757 if( task == AliQAv1::kRAWS ) {
758 fGenRawsOffset=offset;
760 else if( task == AliQAv1::kDIGITSR ) {
761 fGenDigitsOffset=offset;
763 else if( task == AliQAv1::kRECPOINTS ) {
764 fGenRecPointsOffset=offset;
767 AliInfo("No task has been selected. Offset set to zero.\n");
771 //_______________________________________________________________
773 Int_t AliITSQASDDDataMakerRec::GetTaskHisto(AliQAv1::TASKINDEX_t task)
778 if( task == AliQAv1::kRAWS )
780 histotot=fSDDhRawsTask ;
782 else if(task == AliQAv1::kDIGITSR)
784 histotot=fSDDhDigitsTask;
786 else if( task == AliQAv1::kRECPOINTS )
788 histotot=fSDDhRecPointsTask;
790 else AliInfo("No task has been selected. TaskHisto set to zero.\n");