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 AliLog::Message(5,"FMD: end of detector cycle",
86 "AliFMDQADataMakerSim","AliFMDQADataMakerSim",
87 "AliFMDQADataMakerSim::EndOfDetectorCycle",
88 "AliFMDQADataMakerSim.cxx",83);
89 AliQAChecker::Instance()->Run(AliQAv1::kFMD, task, list) ;
92 //_____________________________________________________________________
93 void AliFMDQADataMakerSim::InitSDigits()
95 // create SDigits histograms in SDigits subdir
96 const Bool_t expert = kTRUE ;
97 const Bool_t image = kTRUE ;
99 TH1I* hADCCounts = new TH1I("hADCCounts",
100 "Dist of ADC counts;ADC counts;Entries",
102 hADCCounts->SetXTitle("ADC counts");
103 Add2SDigitsList(hADCCounts, 0, !expert, image);
106 //____________________________________________________________________
107 void AliFMDQADataMakerSim::InitHits()
109 // create Digits histograms in Digits subdir
110 const Bool_t expert = kTRUE ;
111 const Bool_t image = kTRUE ;
113 TH1F* hEnergyOfHits = new TH1F("hEnergyOfHits",
114 "Energy distribution;Energy [MeV];Counts",
116 hEnergyOfHits->SetXTitle("Edep");
117 hEnergyOfHits->SetYTitle("Counts");
118 Add2HitsList(hEnergyOfHits, 0, !expert, image);
121 //_____________________________________________________________________
122 void AliFMDQADataMakerSim::InitDigits()
124 // create Digits histograms in Digits subdir
125 const Bool_t expert = kTRUE ;
126 const Bool_t image = kTRUE ;
128 TH1I* hADCCounts = new TH1I("hADCCounts",
129 "Dist of ADC counts; ADC counts;Entries",
131 hADCCounts->SetXTitle("ADC counts");
132 Add2DigitsList(hADCCounts, 0, !expert, image);
135 //_____________________________________________________________________
136 void AliFMDQADataMakerSim::MakeHits()
138 // Check id histograms already created for this Event Specie
139 if ( ! GetHitsData(0) )
142 TIter next(fHitsArray);
144 while ((hit = static_cast<AliFMDHit *>(next())))
145 GetHitsData(0)->Fill(hit->Edep()/hit->Length()*0.032);
148 //_____________________________________________________________________
149 void AliFMDQADataMakerSim::MakeHits(TTree * hitTree)
151 // make QA data from Hit Tree
154 // hitTree Hits container
157 fHitsArray = new TClonesArray("AliFMDHit", 1000) ;
158 fHitsArray->Clear() ;
160 TBranch * branch = hitTree->GetBranch("FMD") ;
162 AliWarning("FMD branch in Hit Tree not found") ;
166 branch->SetAddress(&fHitsArray) ;
168 for (Int_t ientry = 0 ; ientry < branch->GetEntries() ; ientry++) {
169 branch->GetEntry(ientry);
171 fHitsArray->Clear() ;
175 //_____________________________________________________________________
176 void AliFMDQADataMakerSim::MakeDigits()
178 // makes data from Digits
182 if(!fDigitsArray) return;
184 for(Int_t i = 0 ; i < fDigitsArray->GetEntriesFast() ; i++) {
186 AliFMDDigit* digit = static_cast<AliFMDDigit*>(fDigitsArray->At(i));
187 GetDigitsData(0)->Fill(digit->Counts());
191 //_____________________________________________________________________
192 void AliFMDQADataMakerSim::MakeDigits(TTree * digitTree)
194 // Make data from digits.
197 // digitTree Tree holding digits.
200 fDigitsArray = new TClonesArray("AliFMDDigit", 1000) ;
201 fDigitsArray->Clear();
203 TBranch * branch = digitTree->GetBranch("FMD") ;
205 AliWarning("FMD branch in Digit Tree not found") ;
208 branch->SetAddress(&fDigitsArray) ;
210 if (fDigitsArray) fDigitsArray->Clear();
212 branch->GetEntry(0) ;
216 //_____________________________________________________________________
217 void AliFMDQADataMakerSim::MakeSDigits()
219 // makes data from Digits
223 if(!fSDigitsArray) return;
225 for(Int_t i = 0 ; i < fSDigitsArray->GetEntriesFast() ; i++) {
227 AliFMDSDigit* sdigit = static_cast<AliFMDSDigit*>(fSDigitsArray->At(i));
228 GetSDigitsData(0)->Fill(sdigit->Counts());
232 //_____________________________________________________________________
233 void AliFMDQADataMakerSim::MakeSDigits(TTree * sdigitTree)
235 // Make data from digits.
238 // digitTree Tree holding digits.
241 fSDigitsArray = new TClonesArray("AliFMDSDigit", 1000) ;
242 fSDigitsArray->Clear() ;
244 TBranch * branch = sdigitTree->GetBranch("FMD") ;
246 AliWarning("FMD branch in SDigit Tree not found") ;
249 branch->SetAddress(&fSDigitsArray) ;
250 branch->GetEntry(0) ;
254 //_____________________________________________________________________
255 void AliFMDQADataMakerSim::StartOfDetectorCycle()
262 //_____________________________________________________________________