1 /**************************************************************************
2 * Copyright(c) 1998-1999, 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 **************************************************************************/
20 // Produces the data needed to calculate the quality assurance.
21 // All data must be mergeable objects.
25 // --- ROOT system ---
26 #include <TClonesArray.h>
31 #include <TDirectory.h>
32 #include <Riostream.h>
33 // --- Standard library ---
35 // --- AliRoot header files ---
36 #include "AliESDCaloCluster.h"
37 #include "AliESDEvent.h"
39 #include "AliT0digit.h"
41 #include "AliT0RecPoint.h"
42 #include "AliT0QADataMaker.h"
43 #include "AliQAChecker.h"
45 ClassImp(AliT0QADataMaker)
47 //____________________________________________________________________________
48 AliT0QADataMaker::AliT0QADataMaker() :
49 AliQADataMaker(AliQA::GetDetName(AliQA::kT0), "T0 Quality Assurance Data Maker")
69 for(Int_t i=0; i<24; i++) {
78 // fDetectorDir = fOutput->GetDirectory(GetName()) ;
80 // fDetectorDir = fOutput->mkdir(GetName()) ;
83 //____________________________________________________________________________
84 AliT0QADataMaker::AliT0QADataMaker(const AliT0QADataMaker& qadm) :
103 for(Int_t i=0; i<24; i++) {
112 SetName((const char*)qadm.GetName()) ;
113 SetTitle((const char*)qadm.GetTitle());
116 //__________________________________________________________________
117 AliT0QADataMaker& AliT0QADataMaker::operator = (const AliT0QADataMaker& qadm )
120 this->~AliT0QADataMaker();
121 new(this) AliT0QADataMaker(qadm);
124 //____________________________________________________________________________
125 void AliT0QADataMaker::EndOfDetectorCycle(AliQA::TASKINDEX task, TList * list)
127 //Detector specific actions at end of cycle
128 // do the QA checking
129 AliQAChecker::Instance()->Run(AliQA::kT0, task, list) ;
132 //____________________________________________________________________________
133 void AliT0QADataMaker::StartOfDetectorCycle()
135 //Detector specific actions at start of cycle
139 //____________________________________________________________________________
140 void AliT0QADataMaker::InitHits()
142 // create Hits histograms in Hits subdir
144 TH1F * fhHitsTime[24];
145 for (Int_t i=0; i<24; i++)
147 timename ="hHitTime";
149 if(i<12) fhHitsTime[i] = new TH1F(timename.Data(),timename.Data(),100,2000,3000);
151 fhHitsTime[i] = new TH1F(timename.Data(),timename.Data(),100,12000,13000);
152 Add2HitsList( fhHitsTime[i],i);
155 TH2F *fhHitsEffA = new TH2F("hHitsEffA", "Hits Efficiency A side", 25,-0.5,24.5, 100,12,13 );
156 Add2HitsList(fhHitsEffA,0);
157 TH2F *fhHitsEffC = new TH2F("hHitsEffC", "Hits Efficiency C side", 25,-0.5,24.5, 100,2,3 );
158 Add2HitsList(fhHitsEffC,1);
162 //____________________________________________________________________________
163 void AliT0QADataMaker::InitDigits()
165 // create Digits histograms in Digits subdir
168 TH2F * fhDigCFD = new TH2F("fhDigCFD", " CFD digits",25,-0.5,24.5,100,100,1000);
169 Add2DigitsList( fhDigCFD,0);
170 TH2F *fhDigLEDamp = new TH2F("fhDigLEDamp", " LED-CFD digits",25,-0.5,24.5,100,100,1000);
171 Add2DigitsList( fhDigLEDamp,1);
172 TH2F * fhDigQTC = new TH2F("fhDigQTC", " QTC digits",25,-0.5,24.5,100,100,1000);
173 Add2DigitsList( fhDigQTC,2);
174 TH1F * fhDigMean = new TH1F("hDigMean","online mean signal", 100,500,600);
175 Add2DigitsList( fhDigMean,23);
178 TString timename, ampname, qtcname;
180 TH1F *fhDigCFD[24]; TH1F * fhDigLEDamp[24]; TH1F *fhDigQTC[24];
182 for (Int_t i=0; i<24; i++)
190 fhDigCFD[i] = new TH1F(timename.Data(), timename.Data(),100,100,5000);
191 Add2DigitsList( fhDigCFD[i],i);
192 fhDigLEDamp[i] = new TH1F(ampname.Data(), ampname.Data(),100,120000,150000);
193 Add2DigitsList( fhDigLEDamp[i],i+24);
194 fhDigQTC[i] = new TH1F(qtcname.Data(), qtcname.Data(),100,100,500);
195 Add2DigitsList( fhDigQTC[i],i+48);
198 TH1F* fhDigEff = new TH1F("hDigEff","digits efficiency", 25,-0.5,24.5);
199 Add2DigitsList( fhDigEff,72);
200 TH1F* fhDigMean = new TH1F("hDigMean","online mean signal", 100,500,600);
201 Add2DigitsList( fhDigMean,73);
205 //____________________________________________________________________________
207 void AliT0QADataMaker::InitRecPoints()
209 // create cluster histograms in RecPoint subdir
211 TH2F * fhRecCFD = new TH2F("fhRecCFD", " CFD reconstructed",25,-0.5,24.5,100,12,13);
212 Add2DigitsList( fhRecCFD,0);
213 TH2F *fhRecLEDamp = new TH2F("fhRecLEDamp", " amplitude LED reconstructed",25,-0.5,24.5,100,1000,1000);
214 Add2DigitsList( fhRecLEDamp,1);
215 TH2F * fhRecQTC = new TH2F("fhRecQTC", " amplitude QTC reconstructed",25,-0.5,24.5,100,1000,1000);
216 Add2DigitsList( fhRecQTC,2);
217 TH1F * fhRecMean = new TH1F("hRecMean"," reconstructed mean signal",100,500,600);
218 Add2DigitsList( fhRecMean,3);
221 TString timename,ampname, qtcname;
222 TH1F *fhRecCFD[24]; TH1F *fhRecLEDAmp[24]; TH1F * fhRecQTC[24];
223 for (Int_t i=0; i<24; i++)
231 fhRecCFD[i] = new TH1F(timename.Data(), timename.Data(),100,0,1000);
232 Add2RecPointsList ( fhRecCFD[i],i);
233 fhRecLEDAmp[i] = new TH1F(ampname.Data(), ampname.Data(),100,0,200);
234 Add2RecPointsList ( fhRecLEDAmp[i],i+24);
235 fhRecQTC[i] = new TH1F(qtcname.Data(), qtcname.Data(),100,0,200);
236 Add2RecPointsList ( fhRecQTC[i],i+48);
239 TH1F *fhRecEff = new TH1F("hRecEff","Efficiency rec.points",25,-0.5,24.5);
240 Add2RecPointsList ( fhRecEff,72);
241 TH1F * fhRecMean = new TH1F("hRecMean"," reconstructed mean signal",100,500,600);
242 Add2RecPointsList( fhRecMean,73);
245 //____________________________________________________________________________
246 void AliT0QADataMaker::InitESDs()
248 //create ESDs histograms in ESDs subdir
249 TH1F *fhESDMean = new TH1F("hESDmean"," ESD mean",100,0,100);
250 Add2ESDsList(fhESDMean, 0) ;
251 TH1F * fhESDVertex = new TH1F("hESDvertex","EAD vertex",100,-50,50);
252 Add2ESDsList(fhESDVertex, 1) ;
256 //____________________________________________________________________________
258 void AliT0QADataMaker::MakeHits(TTree *hitTree)
260 //fills QA histos for Hits
261 TClonesArray * hits = new TClonesArray("AliT0hit", 1000);
263 TBranch * branch = hitTree->GetBranch("T0") ;
265 AliWarning("T0 branch in Hit Tree not found") ;
269 branch->SetAddress(&hits);
271 AliError("Branch T0 hit not found");
274 Int_t ntracks = (Int_t) hitTree->GetEntries();
276 if (ntracks<=0) return;
277 // Start loop on tracks in the hits containers
278 for (Int_t track=0; track<ntracks;track++) {
279 branch->GetEntry(track);
280 Int_t nhits = hits->GetEntriesFast();
281 for (Int_t ihit=0;ihit<nhits;ihit++)
283 AliT0hit * startHit = (AliT0hit*) hits->UncheckedAt(ihit);
285 AliError("The unchecked hit doesn't exist");
288 Int_t pmt=startHit->Pmt();
289 GetHitsData(pmt)->Fill(startHit->Time()) ;
295 //____________________________________________________________________________
296 void AliT0QADataMaker::MakeDigits( TTree *digitsTree)
298 //fills QA histos for Digits
300 TArrayI *digCFD = new TArrayI(24);
301 TArrayI *digLED = new TArrayI(24);
302 TArrayI *digQT0 = new TArrayI(24);
303 TArrayI *digQT1 = new TArrayI(24);
306 TBranch *brDigits=digitsTree->GetBranch("T0");
307 AliT0digit *fDigits = new AliT0digit() ;
309 brDigits->SetAddress(&fDigits);
311 AliError(Form("EXEC Branch T0 digits not found"));
315 digitsTree->GetEvent(0);
316 digitsTree->GetEntry(0);
317 brDigits->GetEntry(0);
318 fDigits->GetTimeCFD(*digCFD);
319 fDigits->GetTimeLED(*digLED);
320 fDigits->GetQT0(*digQT0);
321 fDigits->GetQT1(*digQT1);
322 refpoint = fDigits->RefPoint();
323 for (Int_t i=0; i<24; i++)
325 if (digCFD->At(i)>0) {
326 Int_t cfd=digCFD->At(i)- refpoint;
327 GetDigitsData(i) ->Fill(cfd);
328 GetDigitsData(i+24) -> Fill(digLED->At(i) - digCFD->At(i));
329 GetDigitsData(i+48) -> Fill(digQT1->At(i) - digQT0->At(i));
341 //____________________________________________________________________________
342 void AliT0QADataMaker::MakeRecPoints(TTree * clustersTree)
344 //fills QA histos for clusters
346 AliT0RecPoint* frecpoints= new AliT0RecPoint ();
348 AliError("Reconstruct Fill ESD >> no recpoints found");
351 TBranch *brRec =clustersTree ->GetBranch("T0");
353 brRec->SetAddress(&frecpoints);
355 cerr<<"EXEC Branch T0 rec not found"<<endl;
362 for ( Int_t i=0; i<24; i++) {
363 GetRecPointsData(i) -> Fill(frecpoints -> GetTime(i));
364 GetRecPointsData(i+24) -> Fill(frecpoints -> GetAmp(i));
365 GetRecPointsData(i+48) -> Fill(frecpoints->AmpLED(i));
366 // if(frecpoints -> GetTime(i) > 0) fhRecEff->Fill(i);
368 GetRecPointsData(72) ->Fill(frecpoints->GetMeanTime());
372 //____________________________________________________________________________
373 void AliT0QADataMaker::MakeESDs(AliESDEvent * esd)
375 //fills QA histos for ESD
377 GetESDsData(0) -> Fill(esd->GetT0());
378 GetESDsData(1)-> Fill(esd->GetT0zVertex());