1 /**************************************************************************
2 * Copyright(c) 2004, 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 **************************************************************************/
15 // --- ROOT system ---
17 #include <TClonesArray.h>
22 // --- AliRoot header files ---
23 #include "AliESDEvent.h"
25 #include "AliFMDQADataMakerSim.h"
26 #include "AliFMDDigit.h"
27 #include "AliFMDHit.h"
28 #include "AliQAChecker.h"
29 #include "AliFMDParameters.h"
30 #include "AliFMDSDigit.h"
32 //_____________________________________________________________________
33 // This is the class that collects the QA data for the FMD during simulation.
34 // The following data types are picked up:
37 // The following data types are not supported (yet):
40 // Author : Hans Hjersing Dalsgaard, Niels Bohr Institute, hans.dalsgaard@cern.ch
41 //_____________________________________________________________________
43 ClassImp(AliFMDQADataMakerSim)
45 ; // This line is for Emacs - do not delete!
47 //_____________________________________________________________________
48 AliFMDQADataMakerSim::AliFMDQADataMakerSim()
49 : AliQADataMakerSim(AliQAv1::GetDetName(AliQAv1::kFMD),
50 "FMD Quality Assurance Data Maker")
56 //_____________________________________________________________________
57 AliFMDQADataMakerSim::AliFMDQADataMakerSim(const AliFMDQADataMakerSim& /*qadm*/)
63 // qadm Object to copy from
66 //_____________________________________________________________________
68 AliFMDQADataMakerSim::operator = (const AliFMDQADataMakerSim& )
73 //_____________________________________________________________________
74 AliFMDQADataMakerSim::~AliFMDQADataMakerSim()
79 //_____________________________________________________________________
80 void AliFMDQADataMakerSim::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task,
83 //Detector specific actions at end of cycle
85 ResetEventTrigClasses(); // reset triggers list to select all histos
86 AliLog::Message(5,"FMD: end of detector cycle",
87 "AliFMDQADataMakerSim","AliFMDQADataMakerSim",
88 "AliFMDQADataMakerSim::EndOfDetectorCycle",
89 "AliFMDQADataMakerSim.cxx",83);
90 AliQAChecker::Instance()->Run(AliQAv1::kFMD, task, list) ;
93 //_____________________________________________________________________
94 void AliFMDQADataMakerSim::InitSDigits()
96 // create SDigits histograms in SDigits subdir
97 const Bool_t expert = kTRUE ;
98 const Bool_t image = kTRUE ;
100 TH1I* hADCCounts = new TH1I("hADCCounts",
101 "Dist of ADC counts;ADC counts;Entries",
103 hADCCounts->SetXTitle("ADC counts");
104 Add2SDigitsList(hADCCounts, 0, !expert, image);
106 ClonePerTrigClass(AliQAv1::kSDIGITS); // this should be the last line
109 //____________________________________________________________________
110 void AliFMDQADataMakerSim::InitHits()
112 // create Digits histograms in Digits subdir
113 const Bool_t expert = kTRUE ;
114 const Bool_t image = kTRUE ;
116 TH1F* hEnergyOfHits = new TH1F("hEnergyOfHits",
117 "Energy distribution;Energy [MeV];Counts",
119 hEnergyOfHits->SetXTitle("Edep");
120 hEnergyOfHits->SetYTitle("Counts");
121 Add2HitsList(hEnergyOfHits, 0, !expert, image);
123 ClonePerTrigClass(AliQAv1::kHITS); // this should be the last line
126 //_____________________________________________________________________
127 void AliFMDQADataMakerSim::InitDigits()
129 // create Digits histograms in Digits subdir
130 const Bool_t expert = kTRUE ;
131 const Bool_t image = kTRUE ;
133 TH1I* hADCCounts = new TH1I("hADCCounts",
134 "Dist of ADC counts; ADC counts;Entries",
136 hADCCounts->SetXTitle("ADC counts");
137 Add2DigitsList(hADCCounts, 0, !expert, image);
139 ClonePerTrigClass(AliQAv1::kDIGITS); // this should be the last line
142 //_____________________________________________________________________
143 void AliFMDQADataMakerSim::MakeHits()
145 // Check id histograms already created for this Event Specie
146 if ( ! GetHitsData(0) )
149 TIter next(fHitsArray);
151 while ((hit = static_cast<AliFMDHit *>(next()))) FillHitsData(0,hit->Edep()/hit->Length()*0.032);
155 //_____________________________________________________________________
156 void AliFMDQADataMakerSim::MakeHits(TTree * hitTree)
158 // make QA data from Hit Tree
161 // hitTree Hits container
164 fHitsArray = new TClonesArray("AliFMDHit", 1000) ;
165 fHitsArray->Clear() ;
167 TBranch * branch = hitTree->GetBranch("FMD") ;
169 AliWarning("FMD branch in Hit Tree not found") ;
173 branch->SetAddress(&fHitsArray) ;
175 for (Int_t ientry = 0 ; ientry < branch->GetEntries() ; ientry++) {
176 branch->GetEntry(ientry);
178 fHitsArray->Clear() ;
181 IncEvCountCycleHits();
182 IncEvCountTotalHits();
186 //_____________________________________________________________________
187 void AliFMDQADataMakerSim::MakeDigits()
189 // makes data from Digits
193 if(!fDigitsArray) return;
195 for(Int_t i = 0 ; i < fDigitsArray->GetEntriesFast() ; i++) {
197 AliFMDDigit* digit = static_cast<AliFMDDigit*>(fDigitsArray->At(i));
198 FillDigitsData(0,digit->Counts());
203 //_____________________________________________________________________
204 void AliFMDQADataMakerSim::MakeDigits(TTree * digitTree)
206 // Make data from digits.
209 // digitTree Tree holding digits.
210 // RS: counters are incremented in MakeDigits()
213 fDigitsArray = new TClonesArray("AliFMDDigit", 1000) ;
214 fDigitsArray->Clear();
216 TBranch * branch = digitTree->GetBranch("FMD") ;
218 AliWarning("FMD branch in Digit Tree not found") ;
221 branch->SetAddress(&fDigitsArray) ;
223 if (fDigitsArray) fDigitsArray->Clear();
225 branch->GetEntry(0) ;
228 IncEvCountCycleDigits();
229 IncEvCountTotalDigits();
233 //_____________________________________________________________________
234 void AliFMDQADataMakerSim::MakeSDigits()
236 // makes data from Digits
240 if(!fSDigitsArray) return;
242 for(Int_t i = 0 ; i < fSDigitsArray->GetEntriesFast() ; i++) {
244 AliFMDSDigit* sdigit = static_cast<AliFMDSDigit*>(fSDigitsArray->At(i));
245 FillSDigitsData(0,sdigit->Counts());
250 //_____________________________________________________________________
251 void AliFMDQADataMakerSim::MakeSDigits(TTree * sdigitTree)
253 // Make data from digits.
256 // digitTree Tree holding digits.
259 fSDigitsArray = new TClonesArray("AliFMDSDigit", 1000) ;
260 fSDigitsArray->Clear() ;
262 TBranch * branch = sdigitTree->GetBranch("FMD") ;
264 AliWarning("FMD branch in SDigit Tree not found") ;
267 branch->SetAddress(&fSDigitsArray) ;
268 branch->GetEntry(0) ;
271 IncEvCountCycleSDigits();
272 IncEvCountTotalSDigits();
276 //_____________________________________________________________________
277 void AliFMDQADataMakerSim::StartOfDetectorCycle()
284 //_____________________________________________________________________