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 timename ="hHitTime";
145 TH1F * fhHitsTime[24];
146 for (Int_t i=0; i<24; i++)
149 if(i<12) fhHitsTime[i] = new TH1F(timename.Data(),timename.Data(),100,2,3);
151 fhHitsTime[i] = new TH1F(timename.Data(),timename.Data(),100,12,13);
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;
183 TH1F *fhDigCFD[24]; TH1F * fhDigLEDamp[24]; TH1F *fhDigQTC[24];
185 for (Int_t i=0; i<24; i++)
190 fhDigCFD[i] = new TH1F(timename.Data(), timename.Data(),100,100,1000);
191 Add2DigitsList( fhDigCFD[i],i);
192 fhDigLEDamp[i] = new TH1F(ampname.Data(), ampname.Data(),100,100,1000);
193 Add2DigitsList( fhDigLEDamp[i],i+24);
194 fhDigQTC[i] = new TH1F(qtcname.Data(), qtcname.Data(),100,100,1000);
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;
225 TH1F *fhRecCFD[24]; TH1F *fhRecLEDAmp[24]; TH1F * fhRecQTC[24];
226 for (Int_t i=0; i<24; i++)
231 fhRecCFD[i] = new TH1F(timename.Data(), timename.Data(),100,100,1000);
232 Add2RecPointsList ( fhRecCFD[i],i);
233 fhRecLEDAmp[i] = new TH1F(ampname.Data(), ampname.Data(),100,100,1000);
234 Add2RecPointsList ( fhRecLEDAmp[i],i+24);
235 fhRecQTC[i] = new TH1F(qtcname.Data(), qtcname.Data(),100,100,1000);
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,500,600);
250 Add2ESDsList(fhESDMean, 0) ;
251 TH1F * fhESDVertex = new TH1F("hESDvertex","EAD vertex",100,-50,50);
252 Add2ESDsList(fhESDVertex, 1) ;
256 //____________________________________________________________________________
257 void AliT0QADataMaker::MakeHits(TObject * data)
259 //fills QA histos for Hits
260 TClonesArray * hits = dynamic_cast<TClonesArray *>(data) ;
262 AliError("Wrong type of hits container") ;
266 while ( (hit = dynamic_cast<AliT0hit *>(next())) ) {
267 Int_t pmt=hit->Pmt();
268 GetHitsData(pmt)->Fill(pmt,hit->Time()) ;
273 //____________________________________________________________________________
274 void AliT0QADataMaker::MakeDigits( TObject * data)
276 //fills QA histos for Digits
278 TArrayI *digCFD = new TArrayI(24);
279 TArrayI *digLED = new TArrayI(24);
280 TArrayI *digQT0 = new TArrayI(24);
281 TArrayI *digQT1 = new TArrayI(24);
284 TClonesArray * digits = dynamic_cast<TClonesArray *>(data) ;
287 AliError("Wrong type of digits container") ;
291 while ( (digit = dynamic_cast<AliT0digit *>(next())) ) {
292 digit->GetTimeCFD(*digCFD);
293 digit->GetTimeLED(*digLED);
294 digit->GetQT0(*digQT0);
295 digit->GetQT1(*digQT1);
296 refpoint = digit->RefPoint();
297 for (Int_t i=0; i<24; i++)
299 if (digCFD->At(i)>0) {
300 Int_t cfd=digCFD->At(i)- refpoint;
301 GetDigitsData(i) ->Fill(i,cfd);
302 GetDigitsData(i+24) -> Fill(i, digLED->At(i) - digCFD->At(i));
303 GetDigitsData(i+48) -> Fill(i, digQT1->At(i) - digQT0->At(i));
304 // fhDigEff->Fill(i);
317 //____________________________________________________________________________
318 void AliT0QADataMaker::MakeRecPoints(TTree * clustersTree)
320 //fills QA histos for clusters
322 AliT0RecPoint* frecpoints= new AliT0RecPoint ();
324 AliError("Reconstruct Fill ESD >> no recpoints found");
327 TBranch *brRec =clustersTree ->GetBranch("T0");
329 brRec->SetAddress(&frecpoints);
331 cerr<<"EXEC Branch T0 rec not found"<<endl;
338 for ( Int_t i=0; i<24; i++) {
339 GetRecPointsData(i) -> Fill(frecpoints -> GetTime(i));
340 GetRecPointsData(i+24) -> Fill(frecpoints -> GetAmp(i));
341 GetRecPointsData(i+48) -> Fill(frecpoints->AmpLED(i));
342 // if(frecpoints -> GetTime(i) > 0) fhRecEff->Fill(i);
344 GetRecPointsData(72) ->Fill(frecpoints->GetMeanTime());
348 //____________________________________________________________________________
349 void AliT0QADataMaker::MakeESDs(AliESDEvent * esd)
351 //fills QA histos for ESD
353 GetESDsData(0) -> Fill(esd->GetT0());
354 GetESDsData(1)-> Fill(esd->GetT0zVertex());