]> git.uio.no Git - u/mrichter/AliRoot.git/blame - FMD/AliFMDQADataMakerSim.cxx
- Replace the TClonesArray of AliMUONTrackParam by a TObjArray in
[u/mrichter/AliRoot.git] / FMD / AliFMDQADataMakerSim.cxx
CommitLineData
c9dd1c4d 1/**************************************************************************
ffa78f64 2 * Copyright(c) 2004, ALICE Experiment at CERN, All rights reserved. *
c9dd1c4d 3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
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 ---
16#include <iostream>
17#include <TClonesArray.h>
18#include <TFile.h>
19#include <TH1F.h>
20#include <TH1I.h>
21
22// --- AliRoot header files ---
23#include "AliESDEvent.h"
24#include "AliLog.h"
25#include "AliFMDQADataMakerSim.h"
26#include "AliFMDDigit.h"
27#include "AliFMDHit.h"
28#include "AliQAChecker.h"
29#include "AliFMDParameters.h"
028cb80b 30#include "AliFMDSDigit.h"
c9dd1c4d 31
32//_____________________________________________________________________
33// This is the class that collects the QA data for the FMD during simulation.
34// The following data types are picked up:
35// - hits
36// - digits
37// The following data types are not supported (yet):
38// - raws
39// - sdigits
40// Author : Hans Hjersing Dalsgaard, Niels Bohr Institute, hans.dalsgaard@cern.ch
41//_____________________________________________________________________
42
43ClassImp(AliFMDQADataMakerSim)
ffa78f64 44#if 0
45; // This line is for Emacs - do not delete!
46#endif
c9dd1c4d 47//_____________________________________________________________________
ffa78f64 48AliFMDQADataMakerSim::AliFMDQADataMakerSim()
4e25ac79 49 : AliQADataMakerSim(AliQAv1::GetDetName(AliQAv1::kFMD),
6252ceeb 50 "FMD Quality Assurance Data Maker")
c9dd1c4d 51{
52 // ctor
56236ce9 53
c9dd1c4d 54}
55
56//_____________________________________________________________________
f2597905 57AliFMDQADataMakerSim::AliFMDQADataMakerSim(const AliFMDQADataMakerSim& /*qadm*/)
6252ceeb 58 : AliQADataMakerSim()
c9dd1c4d 59{
75609cab 60 // copy ctor
61 //
c9dd1c4d 62 // Parameters:
63 // qadm Object to copy from
64
65}
9bd2ccc2 66//_____________________________________________________________________
75609cab 67AliFMDQADataMakerSim&
68AliFMDQADataMakerSim::operator = (const AliFMDQADataMakerSim& )
a7e41e8d 69{
a7e41e8d 70
71 return *this;
72}
73//_____________________________________________________________________
9bd2ccc2 74AliFMDQADataMakerSim::~AliFMDQADataMakerSim()
75{
56236ce9 76
9bd2ccc2 77}
c9dd1c4d 78
79//_____________________________________________________________________
4e25ac79 80void AliFMDQADataMakerSim::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task,
57acd2d2 81 TObjArray ** list)
c9dd1c4d 82{
83 //Detector specific actions at end of cycle
84 // do the QA checking
ffa78f64 85 AliLog::Message(5,"FMD: end of detector cycle",
86 "AliFMDQADataMakerSim","AliFMDQADataMakerSim",
87 "AliFMDQADataMakerSim::EndOfDetectorCycle",
88 "AliFMDQADataMakerSim.cxx",83);
4e25ac79 89 AliQAChecker::Instance()->Run(AliQAv1::kFMD, task, list) ;
c9dd1c4d 90
91}
028cb80b 92//_____________________________________________________________________
93void AliFMDQADataMakerSim::InitSDigits()
94{
95 // create SDigits histograms in SDigits subdir
7d297381 96 const Bool_t expert = kTRUE ;
97 const Bool_t image = kTRUE ;
98
75609cab 99 TH1I* hADCCounts = new TH1I("hADCCounts",
100 "Dist of ADC counts;ADC counts;Entries",
101 1024,0,1024);
028cb80b 102 hADCCounts->SetXTitle("ADC counts");
7d297381 103 Add2SDigitsList(hADCCounts, 0, !expert, image);
028cb80b 104}
c9dd1c4d 105
106//____________________________________________________________________
107void AliFMDQADataMakerSim::InitHits()
108{
109 // create Digits histograms in Digits subdir
7d297381 110 const Bool_t expert = kTRUE ;
111 const Bool_t image = kTRUE ;
112
75609cab 113 TH1F* hEnergyOfHits = new TH1F("hEnergyOfHits",
114 "Energy distribution;Energy [MeV];Counts",
115 100,0,3);
c9dd1c4d 116 hEnergyOfHits->SetXTitle("Edep");
117 hEnergyOfHits->SetYTitle("Counts");
7d297381 118 Add2HitsList(hEnergyOfHits, 0, !expert, image);
c9dd1c4d 119}
120
121//_____________________________________________________________________
122void AliFMDQADataMakerSim::InitDigits()
123{
124 // create Digits histograms in Digits subdir
7d297381 125 const Bool_t expert = kTRUE ;
126 const Bool_t image = kTRUE ;
127
75609cab 128 TH1I* hADCCounts = new TH1I("hADCCounts",
129 "Dist of ADC counts; ADC counts;Entries",
130 1024,0,1024);
c9dd1c4d 131 hADCCounts->SetXTitle("ADC counts");
7d297381 132 Add2DigitsList(hADCCounts, 0, !expert, image);
c9dd1c4d 133}
134
135//_____________________________________________________________________
6252ceeb 136void AliFMDQADataMakerSim::MakeHits()
c9dd1c4d 137{
eca4fa66 138 // Check id histograms already created for this Event Specie
139 if ( ! GetHitsData(0) )
140 InitHits() ;
141
6252ceeb 142 TIter next(fHitsArray);
c9dd1c4d 143 AliFMDHit * hit;
144 while ((hit = static_cast<AliFMDHit *>(next())))
145 GetHitsData(0)->Fill(hit->Edep()/hit->Length()*0.032);
146}
147
148//_____________________________________________________________________
149void AliFMDQADataMakerSim::MakeHits(TTree * hitTree)
150{
151 // make QA data from Hit Tree
75609cab 152 //
153 // Parameters:
154 // hitTree Hits container
155 //
156 if (!fHitsArray)
6252ceeb 157 fHitsArray = new TClonesArray("AliFMDHit", 1000) ;
75609cab 158 fHitsArray->Clear() ;
56236ce9 159
c9dd1c4d 160 TBranch * branch = hitTree->GetBranch("FMD") ;
161 if (!branch) {
162 AliWarning("FMD branch in Hit Tree not found") ;
163 return;
164 }
6252ceeb 165
166 branch->SetAddress(&fHitsArray) ;
c9dd1c4d 167
168 for (Int_t ientry = 0 ; ientry < branch->GetEntries() ; ientry++) {
169 branch->GetEntry(ientry);
6252ceeb 170 MakeHits(); //tmp);
171 fHitsArray->Clear() ;
c9dd1c4d 172 }
c9dd1c4d 173}
174
175//_____________________________________________________________________
6252ceeb 176void AliFMDQADataMakerSim::MakeDigits()
c9dd1c4d 177{
178 // makes data from Digits
75609cab 179 //
180 // Parameters:
181 // none
6252ceeb 182 if(!fDigitsArray) return;
183
184 for(Int_t i = 0 ; i < fDigitsArray->GetEntriesFast() ; i++) {
c9dd1c4d 185 //Raw ADC counts
6252ceeb 186 AliFMDDigit* digit = static_cast<AliFMDDigit*>(fDigitsArray->At(i));
c9dd1c4d 187 GetDigitsData(0)->Fill(digit->Counts());
188 }
189}
190
191//_____________________________________________________________________
192void AliFMDQADataMakerSim::MakeDigits(TTree * digitTree)
193{
75609cab 194 // Make data from digits.
195 //
196 // Parameters:
197 // digitTree Tree holding digits.
c9dd1c4d 198
75609cab 199 if (!fDigitsArray)
6252ceeb 200 fDigitsArray = new TClonesArray("AliFMDDigit", 1000) ;
75609cab 201 fDigitsArray->Clear();
6252ceeb 202
c9dd1c4d 203 TBranch * branch = digitTree->GetBranch("FMD") ;
204 if (!branch) {
205 AliWarning("FMD branch in Digit Tree not found") ;
206 return;
207 }
6252ceeb 208 branch->SetAddress(&fDigitsArray) ;
75609cab 209
210 if (fDigitsArray) fDigitsArray->Clear();
211
c9dd1c4d 212 branch->GetEntry(0) ;
6252ceeb 213 MakeDigits() ;
c9dd1c4d 214}
215
028cb80b 216//_____________________________________________________________________
6252ceeb 217void AliFMDQADataMakerSim::MakeSDigits()
028cb80b 218{
219 // makes data from Digits
75609cab 220 //
221 // Parameters:
222 // none
6252ceeb 223 if(!fSDigitsArray) return;
028cb80b 224
6252ceeb 225 for(Int_t i = 0 ; i < fSDigitsArray->GetEntriesFast() ; i++) {
028cb80b 226 //Raw ADC counts
6252ceeb 227 AliFMDSDigit* sdigit = static_cast<AliFMDSDigit*>(fSDigitsArray->At(i));
028cb80b 228 GetSDigitsData(0)->Fill(sdigit->Counts());
229 }
230}
231
232//_____________________________________________________________________
233void AliFMDQADataMakerSim::MakeSDigits(TTree * sdigitTree)
234{
75609cab 235 // Make data from digits.
236 //
237 // Parameters:
238 // digitTree Tree holding digits.
028cb80b 239
75609cab 240 if (!fSDigitsArray)
6252ceeb 241 fSDigitsArray = new TClonesArray("AliFMDSDigit", 1000) ;
75609cab 242 fSDigitsArray->Clear() ;
243
028cb80b 244 TBranch * branch = sdigitTree->GetBranch("FMD") ;
245 if (!branch) {
246 AliWarning("FMD branch in SDigit Tree not found") ;
247 return;
248 }
6252ceeb 249 branch->SetAddress(&fSDigitsArray) ;
028cb80b 250 branch->GetEntry(0) ;
6252ceeb 251 MakeSDigits() ;
028cb80b 252}
253
c9dd1c4d 254//_____________________________________________________________________
255void AliFMDQADataMakerSim::StartOfDetectorCycle()
256{
75609cab 257 // Does
258 // not
259 // do
260 // anything
c9dd1c4d 261}
262//_____________________________________________________________________
263//
264// EOF
265//