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>
30 #include <TDirectory.h>
31 // --- Standard library ---
33 // --- AliRoot header files ---
34 #include "AliESDEvent.h"
36 #include "AliT0digit.h"
38 #include "AliT0RecPoint.h"
39 #include "AliT0QADataMakerSim.h"
40 #include "AliQAChecker.h"
41 #include "AliT0RawReader.h"
43 ClassImp(AliT0QADataMakerSim)
45 //____________________________________________________________________________
46 AliT0QADataMakerSim::AliT0QADataMakerSim() :
47 AliQADataMakerSim(AliQAv1::GetDetName(AliQAv1::kT0), "T0 Quality Assurance Data Maker")
52 for(Int_t i=0; i<24; i++) {
61 // fDetectorDir = fOutput->GetDirectory(GetName()) ;
63 // fDetectorDir = fOutput->mkdir(GetName()) ;
66 //____________________________________________________________________________
67 AliT0QADataMakerSim::AliT0QADataMakerSim(const AliT0QADataMakerSim& qadm) :
72 for(Int_t i=0; i<24; i++) {
81 SetName((const char*)qadm.GetName()) ;
82 SetTitle((const char*)qadm.GetTitle());
85 //__________________________________________________________________
86 AliT0QADataMakerSim& AliT0QADataMakerSim::operator = (const AliT0QADataMakerSim& qadm )
89 this->~AliT0QADataMakerSim();
90 new(this) AliT0QADataMakerSim(qadm);
93 //____________________________________________________________________________
94 void AliT0QADataMakerSim::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray ** list)
96 //Detector specific actions at end of cycle
98 AliQAChecker::Instance()->Run(AliQAv1::kT0, task, list) ;
101 //____________________________________________________________________________
102 void AliT0QADataMakerSim::StartOfDetectorCycle()
104 //Detector specific actions at start of cycle
108 //____________________________________________________________________________
109 void AliT0QADataMakerSim::InitHits()
111 // create Hits histograms in Hits subdir
112 // create Hits histograms in Hits subdir
115 TH2F *fhHitsTimeA = new TH2F("hHitsTimeA", "Hits Efficiency", 25, 0, 25, 100,12,15 );
116 Add2HitsList(fhHitsTimeA,0);
117 TH2F *fhHitsTimeC = new TH2F("hHitsTimeC", "Hits Efficiency", 25, 0, 25, 100,2,5 );
118 Add2HitsList(fhHitsTimeC,1);
121 //____________________________________________________________________________
122 void AliT0QADataMakerSim::InitDigits()
124 // create Digits histograms in Digits subdir
127 TH2F * fhDigCFD = new TH2F("fhDigCFD", " CFD digits",25,-0.5,24.5,100,100,1000);
128 Add2DigitsList( fhDigCFD,0);
129 TH2F *fhDigLEDamp = new TH2F("fhDigLEDamp", " LED-CFD digits",25,-0.5,24.5,100,100,1000);
130 Add2DigitsList( fhDigLEDamp,1);
131 TH2F * fhDigQTC = new TH2F("fhDigQTC", " QTC digits",25,-0.5,24.5,100,100,1000);
132 Add2DigitsList( fhDigQTC,2);
138 //____________________________________________________________________________
140 void AliT0QADataMakerSim::MakeHits(TTree *hitTree)
142 //fills QA histos for Hits
143 TClonesArray * hits = new TClonesArray("AliT0hit", 1000);
145 TBranch * branch = hitTree->GetBranch("T0") ;
147 AliWarning("T0 branch in Hit Tree not found") ;
151 branch->SetAddress(&hits);
153 AliError("Branch T0 hit not found");
156 Int_t ntracks = (Int_t) hitTree->GetEntries();
158 if (ntracks<=0) return;
159 // Start loop on tracks in the hits containers
160 for (Int_t track=0; track<ntracks;track++) {
161 branch->GetEntry(track);
162 Int_t nhits = hits->GetEntriesFast();
163 for (Int_t ihit=0;ihit<nhits;ihit++)
165 AliT0hit * startHit = (AliT0hit*) hits->UncheckedAt(ihit);
167 AliError("The unchecked hit doesn't exist");
170 Int_t pmt=startHit->Pmt();
171 Float_t time = 0.001 * startHit->Time();
172 if(pmt<13)GetHitsData(1)->Fill(pmt,time) ;
173 if(pmt>12)GetHitsData(0)->Fill(pmt,time) ;
179 //____________________________________________________________________________
180 void AliT0QADataMakerSim::MakeDigits( TTree *digitsTree)
182 //fills QA histos for Digits
184 TArrayI *digCFD = new TArrayI(24);
185 TArrayI *digLED = new TArrayI(24);
186 TArrayI *digQT0 = new TArrayI(24);
187 TArrayI *digQT1 = new TArrayI(24);
190 TBranch *brDigits=digitsTree->GetBranch("T0");
191 AliT0digit *fDigits = new AliT0digit() ;
193 brDigits->SetAddress(&fDigits);
195 AliError(Form("EXEC Branch T0 digits not found"));
198 digitsTree->GetEvent(0);
199 digitsTree->GetEntry(0);
200 brDigits->GetEntry(0);
201 fDigits->GetTimeCFD(*digCFD);
202 fDigits->GetTimeLED(*digLED);
203 fDigits->GetQT0(*digQT0);
204 fDigits->GetQT1(*digQT1);
205 refpoint = fDigits->RefPoint();
206 for (Int_t i=0; i<24; i++)
208 if (digCFD->At(i)>0) {
209 Int_t cfd=digCFD->At(i)- refpoint;
210 GetDigitsData(0) ->Fill(i,cfd);
211 GetDigitsData(1) -> Fill(i,(digLED->At(i) - digCFD->At(i)));
212 GetDigitsData(2) -> Fill(i, (digQT1->At(i) - digQT0->At(i)));