]>
Commit | Line | Data |
---|---|---|
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" | |
30 | ||
31 | //_____________________________________________________________________ | |
32 | // This is the class that collects the QA data for the FMD during simulation. | |
33 | // The following data types are picked up: | |
34 | // - hits | |
35 | // - digits | |
36 | // The following data types are not supported (yet): | |
37 | // - raws | |
38 | // - sdigits | |
39 | // Author : Hans Hjersing Dalsgaard, Niels Bohr Institute, hans.dalsgaard@cern.ch | |
40 | //_____________________________________________________________________ | |
41 | ||
42 | ClassImp(AliFMDQADataMakerSim) | |
ffa78f64 | 43 | #if 0 |
44 | ; // This line is for Emacs - do not delete! | |
45 | #endif | |
c9dd1c4d | 46 | //_____________________________________________________________________ |
ffa78f64 | 47 | AliFMDQADataMakerSim::AliFMDQADataMakerSim() |
48 | : AliQADataMakerSim(AliQA::GetDetName(AliQA::kFMD), | |
9bd2ccc2 | 49 | "FMD Quality Assurance Data Maker"), |
50 | fDigitsArray(0), | |
51 | fHitsArray(0) | |
c9dd1c4d | 52 | { |
53 | // ctor | |
9bd2ccc2 | 54 | fDigitsArray = new TClonesArray("AliFMDDigit", 1000) ; |
55 | fHitsArray = new TClonesArray("AliFMDHit", 10); | |
c9dd1c4d | 56 | } |
57 | ||
58 | //_____________________________________________________________________ | |
a7e41e8d | 59 | AliFMDQADataMakerSim::AliFMDQADataMakerSim(const AliFMDQADataMakerSim& qadm) |
60 | : AliQADataMakerSim(), | |
61 | fDigitsArray(qadm.fDigitsArray), | |
62 | fHitsArray(qadm.fHitsArray) | |
c9dd1c4d | 63 | { |
64 | //copy ctor | |
a7e41e8d | 65 | |
c9dd1c4d | 66 | // Parameters: |
67 | // qadm Object to copy from | |
68 | ||
69 | } | |
9bd2ccc2 | 70 | //_____________________________________________________________________ |
a7e41e8d | 71 | AliFMDQADataMakerSim& AliFMDQADataMakerSim::operator = (const AliFMDQADataMakerSim& qadm ) |
72 | { | |
73 | fDigitsArray = qadm.fDigitsArray; | |
74 | fHitsArray = qadm.fHitsArray; | |
75 | ||
76 | return *this; | |
77 | } | |
78 | //_____________________________________________________________________ | |
9bd2ccc2 | 79 | AliFMDQADataMakerSim::~AliFMDQADataMakerSim() |
80 | { | |
81 | delete fDigitsArray; | |
82 | delete fHitsArray; | |
83 | } | |
c9dd1c4d | 84 | |
85 | //_____________________________________________________________________ | |
92a357bf | 86 | void AliFMDQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX_t task, |
ffa78f64 | 87 | TObjArray * list) |
c9dd1c4d | 88 | { |
89 | //Detector specific actions at end of cycle | |
90 | // do the QA checking | |
ffa78f64 | 91 | AliLog::Message(5,"FMD: end of detector cycle", |
92 | "AliFMDQADataMakerSim","AliFMDQADataMakerSim", | |
93 | "AliFMDQADataMakerSim::EndOfDetectorCycle", | |
94 | "AliFMDQADataMakerSim.cxx",83); | |
c9dd1c4d | 95 | AliQAChecker::Instance()->Run(AliQA::kFMD, task, list) ; |
96 | ||
97 | } | |
98 | ||
99 | //____________________________________________________________________ | |
100 | void AliFMDQADataMakerSim::InitHits() | |
101 | { | |
102 | // create Digits histograms in Digits subdir | |
ffa78f64 | 103 | TH1F* hEnergyOfHits = new TH1F("hEnergyOfHits","Energy distribution",100,0,3); |
c9dd1c4d | 104 | hEnergyOfHits->SetXTitle("Edep"); |
105 | hEnergyOfHits->SetYTitle("Counts"); | |
106 | Add2HitsList(hEnergyOfHits, 0); | |
107 | } | |
108 | ||
109 | //_____________________________________________________________________ | |
110 | void AliFMDQADataMakerSim::InitDigits() | |
111 | { | |
112 | // create Digits histograms in Digits subdir | |
113 | TH1I* hADCCounts = new TH1I("hADCCounts","Dist of ADC counts",1024,0,1024); | |
c9dd1c4d | 114 | hADCCounts->SetXTitle("ADC counts"); |
c9dd1c4d | 115 | Add2DigitsList(hADCCounts, 0); |
c9dd1c4d | 116 | } |
117 | ||
118 | //_____________________________________________________________________ | |
119 | void AliFMDQADataMakerSim::MakeHits(TClonesArray * hits) | |
120 | { | |
a7e41e8d | 121 | TIter next(hits); |
c9dd1c4d | 122 | AliFMDHit * hit; |
123 | while ((hit = static_cast<AliFMDHit *>(next()))) | |
124 | GetHitsData(0)->Fill(hit->Edep()/hit->Length()*0.032); | |
125 | } | |
126 | ||
127 | //_____________________________________________________________________ | |
128 | void AliFMDQADataMakerSim::MakeHits(TTree * hitTree) | |
129 | { | |
130 | // make QA data from Hit Tree | |
131 | ||
132 | TBranch * branch = hitTree->GetBranch("FMD") ; | |
133 | if (!branch) { | |
134 | AliWarning("FMD branch in Hit Tree not found") ; | |
135 | return; | |
136 | } | |
9bd2ccc2 | 137 | fHitsArray->Clear(); |
138 | branch->SetAddress(&fHitsArray) ; | |
c9dd1c4d | 139 | |
140 | for (Int_t ientry = 0 ; ientry < branch->GetEntries() ; ientry++) { | |
141 | branch->GetEntry(ientry); | |
9bd2ccc2 | 142 | MakeHits(fHitsArray); //tmp); |
c9dd1c4d | 143 | } |
9bd2ccc2 | 144 | |
c9dd1c4d | 145 | } |
146 | ||
147 | //_____________________________________________________________________ | |
148 | void AliFMDQADataMakerSim::MakeDigits(TClonesArray * digits) | |
149 | { | |
150 | // makes data from Digits | |
151 | if(!digits) return; | |
152 | ||
9bd2ccc2 | 153 | for(Int_t i = 0 ; i < fDigitsArray->GetEntriesFast() ; i++) { |
c9dd1c4d | 154 | //Raw ADC counts |
155 | AliFMDDigit* digit = static_cast<AliFMDDigit*>(digits->At(i)); | |
156 | GetDigitsData(0)->Fill(digit->Counts()); | |
157 | } | |
158 | } | |
159 | ||
160 | //_____________________________________________________________________ | |
161 | void AliFMDQADataMakerSim::MakeDigits(TTree * digitTree) | |
162 | { | |
163 | ||
9bd2ccc2 | 164 | fDigitsArray->Clear(); |
c9dd1c4d | 165 | TBranch * branch = digitTree->GetBranch("FMD") ; |
166 | if (!branch) { | |
167 | AliWarning("FMD branch in Digit Tree not found") ; | |
168 | return; | |
169 | } | |
9bd2ccc2 | 170 | branch->SetAddress(&fDigitsArray) ; |
c9dd1c4d | 171 | branch->GetEntry(0) ; |
9bd2ccc2 | 172 | MakeDigits(fDigitsArray) ; |
c9dd1c4d | 173 | } |
174 | ||
175 | //_____________________________________________________________________ | |
176 | void AliFMDQADataMakerSim::StartOfDetectorCycle() | |
177 | { | |
178 | ||
179 | } | |
180 | //_____________________________________________________________________ | |
181 | // | |
182 | // EOF | |
183 | // |