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"
44 ClassImp(AliT0QADataMaker)
46 //____________________________________________________________________________
47 AliT0QADataMaker::AliT0QADataMaker() :
48 AliQADataMaker(AliQA::GetDetName(AliQA::kT0), "T0 Quality Assurance Data Maker"),
67 for(Int_t i=0; i<24; i++) {
75 // fDetectorDir = fOutput->GetDirectory(GetName()) ;
77 // fDetectorDir = fOutput->mkdir(GetName()) ;
80 //____________________________________________________________________________
81 AliT0QADataMaker::AliT0QADataMaker(const AliT0QADataMaker& qadm) :
99 for(Int_t i=0; i<24; i++) {
108 SetName((const char*)qadm.GetName()) ;
109 SetTitle((const char*)qadm.GetTitle());
112 //__________________________________________________________________
113 AliT0QADataMaker& AliT0QADataMaker::operator = (const AliT0QADataMaker& qadm )
116 this->~AliT0QADataMaker();
117 new(this) AliT0QADataMaker(qadm);
121 //____________________________________________________________________________
122 void AliT0QADataMaker::InitHits()
124 // create Hits histograms in Hits subdir
126 timename ="hHitTime";
127 for (Int_t i=0; i<24; i++)
130 if(i<12) fhHitsTime[i] = new TH1F(timename.Data(),timename.Data(),100,2,3);
132 fhHitsTime[i] = new TH1F(timename.Data(),timename.Data(),100,12,13);
134 fhHitsEff = new TH1F("hHitsEff", "Hits Efficiency", 25,-0.5,24.5);
137 //____________________________________________________________________________
138 void AliT0QADataMaker::InitDigits()
140 // create Digits histograms in Digits subdir
141 TString timename, ampname, qtcname;
145 for (Int_t i=0; i<24; i++)
150 fhDigCFD[i] = new TH1F(timename.Data(), timename.Data(),100,100,1000);
151 fhDigLEDamp[i] = new TH1F(ampname.Data(), ampname.Data(),100,100,1000);
152 fhDigQTC[i] = new TH1F(qtcname.Data(), qtcname.Data(),100,100,1000);
154 fhDigEff = new TH1F("hDigEff","digits efficiency", 25,-0.5,24.5);
155 fhDigMean = new TH1F("hDigMean","online mean signal", 100,500,600);
159 //____________________________________________________________________________
161 void AliT0QADataMaker::InitRecPoints()
163 // create cluster histograms in RecPoint subdir
165 // create Digits histograms in Digits subdir
166 TString timename,ampname, qtcname;
170 for (Int_t i=0; i<24; i++)
175 fhRecCFD[i] = new TH1F(timename.Data(), timename.Data(),100,100,1000);
176 fhRecLEDamp[i] = new TH1F(ampname.Data(), ampname.Data(),100,100,1000);
177 fhRecQTC[i] = new TH1F(qtcname.Data(), qtcname.Data(),100,100,1000);
179 fhRecEff = new TH1F("hRecEff","Efficiency rec.points",25,-0.5,24.5);
180 fhRecMean = new TH1F("hRecMean"," reconstructed mean signal",100,500,600);
183 //____________________________________________________________________________
184 void AliT0QADataMaker::InitESDs()
186 //create ESDs histograms in ESDs subdir
187 fhESDMean = new TH1F("hESDmean"," ESD mean",100,500,600);
188 fhESDVertex = new TH1F("hESDvertex","EAD vertex",100,-50,50);
192 //____________________________________________________________________________
193 void AliT0QADataMaker::MakeHits(TObject * data)
195 //fills QA histos for Hits
196 TClonesArray * hits = dynamic_cast<TClonesArray *>(data) ;
198 AliError("Wrong type of hits container") ;
202 while ( (hit = dynamic_cast<AliT0hit *>(next())) ) {
203 Int_t pmt=hit->Pmt();
204 fhHitsTime[pmt]->Fill(hit->Time()) ;
205 fhHitsEff->Fill(pmt);
210 //____________________________________________________________________________
211 void AliT0QADataMaker::MakeDigits( TObject * data)
213 //fills QA histos for Digits
214 TArrayI *digCFD = new TArrayI(24);
215 TArrayI *digLED = new TArrayI(24);
216 TArrayI *digQT0 = new TArrayI(24);
217 TArrayI *digQT1 = new TArrayI(24);
220 TClonesArray * digits = dynamic_cast<TClonesArray *>(data) ;
223 AliError("Wrong type of digits container") ;
227 while ( (digit = dynamic_cast<AliT0digit *>(next())) ) {
228 digit->GetTimeCFD(*digCFD);
229 digit->GetTimeLED(*digLED);
230 digit->GetQT0(*digQT0);
231 digit->GetQT1(*digQT1);
232 refpoint = digit->RefPoint();
233 for (Int_t i=0; i<24; i++)
235 if (digCFD->At(i)>0) {
236 Int_t cfd=digCFD->At(i)- refpoint;
237 fhDigCFD[i] -> Fill(cfd);
238 fhDigLEDamp[i] -> Fill(digLED->At(i) - digCFD->At(i));
239 fhDigQTC [i]-> Fill(digQT1->At(i) - digQT0->At(i));
253 //____________________________________________________________________________
254 void AliT0QADataMaker::MakeRecPoints(TTree * clustersTree)
256 //fills QA histos for clusters
258 AliT0RecPoint* frecpoints= new AliT0RecPoint ();
260 AliError("Reconstruct Fill ESD >> no recpoints found");
263 TBranch *brRec =clustersTree ->GetBranch("T0");
265 brRec->SetAddress(&frecpoints);
267 cerr<<"EXEC Branch T0 rec not found"<<endl;
274 for ( Int_t i=0; i<24; i++) {
275 fhRecCFD[i] -> Fill(frecpoints -> GetTime(i));
276 fhRecQTC[i] -> Fill(frecpoints -> GetAmp(i));
277 fhRecLEDamp[i] -> Fill( frecpoints->AmpLED(i));
278 if(frecpoints -> GetTime(i) > 0) fhRecEff->Fill(i);
280 fhRecMean->Fill(frecpoints->GetMeanTime());
284 //____________________________________________________________________________
285 void AliT0QADataMaker::MakeESDs(AliESDEvent * esd)
287 //fills QA histos for ESD
289 fhESDMean -> Fill(esd->GetT0());
290 fhESDVertex -> Fill(esd->GetT0zVertex());