]>
Commit | Line | Data |
---|---|---|
c9dd1c4d | 1 | /************************************************************************** |
2 | * Copyright(c) 2004, ALICE Experiment at CERN, All rights reserved. * | |
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 "AliFMDQADataMakerRec.h" | |
26 | #include "AliFMDDigit.h" | |
27 | #include "AliFMDRecPoint.h" | |
28 | #include "AliQAChecker.h" | |
29 | #include "AliESDFMD.h" | |
30 | #include "AliFMDParameters.h" | |
31 | ||
32 | //_____________________________________________________________________ | |
33 | // This is the class that collects the QA data for the FMD during | |
34 | // reconstruction. | |
35 | // | |
36 | // The following data types are picked up: | |
37 | // - digits | |
38 | // - rec points | |
39 | // - esd data | |
40 | // The following data types are not supported (yet): | |
41 | // - raws | |
42 | // Author : Hans Hjersing Dalsgaard, hans.dalsgaard@cern.ch | |
43 | //_____________________________________________________________________ | |
44 | ||
45 | ClassImp(AliFMDQADataMakerRec) | |
46 | #if 0 | |
47 | ; // For Emacs - do not delete! | |
48 | #endif | |
49 | ||
50 | //_____________________________________________________________________ | |
51 | AliFMDQADataMakerRec::AliFMDQADataMakerRec() : | |
52 | AliQADataMakerRec(AliQA::GetDetName(AliQA::kFMD), | |
a7e41e8d | 53 | "FMD Quality Assurance Data Maker"), |
56236ce9 | 54 | fDigitsArray("AliFMDDigit", 1000), |
55 | fRecPointsArray("AliFMDRecPoints", 1000) | |
c9dd1c4d | 56 | { |
57 | // ctor | |
56236ce9 | 58 | |
c9dd1c4d | 59 | } |
60 | ||
61 | //_____________________________________________________________________ | |
a7e41e8d | 62 | AliFMDQADataMakerRec::AliFMDQADataMakerRec(const AliFMDQADataMakerRec& qadm) |
63 | : AliQADataMakerRec(AliQA::GetDetName(AliQA::kFMD), | |
64 | "FMD Quality Assurance Data Maker"), | |
65 | fDigitsArray(qadm.fDigitsArray), | |
66 | fRecPointsArray(qadm.fRecPointsArray) | |
c9dd1c4d | 67 | { |
ffa78f64 | 68 | // copy ctor |
c9dd1c4d | 69 | // Parameters: |
70 | // qadm Object to copy from | |
71 | ||
72 | } | |
9bd2ccc2 | 73 | //_____________________________________________________________________ |
a7e41e8d | 74 | AliFMDQADataMakerRec& AliFMDQADataMakerRec::operator = (const AliFMDQADataMakerRec& qadm ) |
75 | { | |
76 | fDigitsArray = qadm.fDigitsArray; | |
77 | fRecPointsArray = qadm.fRecPointsArray; | |
78 | ||
79 | return *this; | |
80 | } | |
81 | //_____________________________________________________________________ | |
9bd2ccc2 | 82 | AliFMDQADataMakerRec::~AliFMDQADataMakerRec() |
83 | { | |
56236ce9 | 84 | |
9bd2ccc2 | 85 | } |
c9dd1c4d | 86 | |
87 | ||
88 | //_____________________________________________________________________ | |
89 | ||
90 | void | |
92a357bf | 91 | AliFMDQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX_t task, |
c9dd1c4d | 92 | TObjArray * list) |
93 | { | |
94 | // Detector specific actions at end of cycle | |
95 | // do the QA checking | |
ffa78f64 | 96 | AliLog::Message(5,"FMD: end of detector cycle", |
97 | "AliFMDQADataMakerRec","AliFMDQADataMakerRec", | |
98 | "AliFMDQADataMakerRec::EndOfDetectorCycle", | |
99 | "AliFMDQADataMakerRec.cxx",95); | |
c9dd1c4d | 100 | AliQAChecker::Instance()->Run(AliQA::kFMD, task, list); |
101 | } | |
102 | ||
103 | //_____________________________________________________________________ | |
104 | void AliFMDQADataMakerRec::InitESDs() | |
105 | { | |
106 | // create Digits histograms in Digits subdir | |
107 | TH1F* hEnergyOfESD = new TH1F("hEnergyOfESD","Energy distribution",100,0,3); | |
108 | hEnergyOfESD->SetXTitle("Edep/Emip"); | |
109 | hEnergyOfESD->SetYTitle("Counts"); | |
110 | Add2ESDsList(hEnergyOfESD, 0); | |
111 | ||
112 | } | |
113 | ||
114 | //_____________________________________________________________________ | |
115 | void AliFMDQADataMakerRec::InitDigits() | |
116 | { | |
117 | // create Digits histograms in Digits subdir | |
118 | TH1I* hADCCounts = new TH1I("hADCCounts","Dist of ADC counts", | |
119 | 1024,0,1024); | |
c9dd1c4d | 120 | hADCCounts->SetXTitle("ADC counts"); |
121 | hADCCounts->SetYTitle(""); | |
c9dd1c4d | 122 | Add2DigitsList(hADCCounts, 0); |
c9dd1c4d | 123 | |
124 | } | |
125 | ||
126 | //_____________________________________________________________________ | |
127 | void AliFMDQADataMakerRec::InitRecPoints() | |
128 | { | |
129 | TH1F* hEnergyOfRecpoints = new TH1F("hEnergyOfRecpoints", | |
130 | "Energy Distribution",100,0,3); | |
131 | hEnergyOfRecpoints->SetXTitle("Edep/Emip"); | |
132 | hEnergyOfRecpoints->SetYTitle(""); | |
133 | Add2RecPointsList(hEnergyOfRecpoints,0); | |
134 | } | |
135 | ||
136 | //_____________________________________________________________________ | |
137 | void AliFMDQADataMakerRec::InitRaws() | |
138 | { | |
139 | ||
140 | } | |
141 | ||
142 | //_____________________________________________________________________ | |
143 | void AliFMDQADataMakerRec::MakeESDs(AliESDEvent * esd) | |
144 | { | |
145 | if(!esd) { | |
146 | AliError("FMD ESD object not found!!") ; | |
147 | return; | |
148 | } | |
149 | AliESDFMD* fmd = esd->GetFMDData(); | |
150 | if (!fmd) return; | |
151 | ||
152 | for(UShort_t det=1;det<=3;det++) { | |
153 | for (UShort_t ir = 0; ir < 2; ir++) { | |
154 | Char_t ring = (ir == 0 ? 'I' : 'O'); | |
155 | UShort_t nsec = (ir == 0 ? 20 : 40); | |
156 | UShort_t nstr = (ir == 0 ? 512 : 256); | |
157 | for(UShort_t sec =0; sec < nsec; sec++) { | |
158 | for(UShort_t strip = 0; strip < nstr; strip++) { | |
159 | Float_t mult = fmd->Multiplicity(det,ring,sec,strip); | |
160 | if(mult == AliESDFMD::kInvalidMult) continue; | |
161 | ||
162 | GetESDsData(0)->Fill(mult); | |
163 | } | |
164 | } | |
165 | } | |
166 | } | |
167 | } | |
168 | ||
169 | //_____________________________________________________________________ | |
170 | void AliFMDQADataMakerRec::MakeDigits(TClonesArray * digits) | |
171 | { | |
172 | // makes data from Digits | |
173 | if(!digits) { | |
ffa78f64 | 174 | AliError("FMD Digit object not found!!") ; |
175 | return; | |
c9dd1c4d | 176 | } |
56236ce9 | 177 | for(Int_t i=0;i<digits->GetEntriesFast();i++) { |
c9dd1c4d | 178 | //Raw ADC counts |
56236ce9 | 179 | AliFMDDigit* digit = static_cast<AliFMDDigit*>(digits->At(i)); |
c9dd1c4d | 180 | GetDigitsData(0)->Fill(digit->Counts()); |
181 | } | |
182 | } | |
183 | ||
184 | //_____________________________________________________________________ | |
185 | void AliFMDQADataMakerRec::MakeDigits(TTree * digitTree) | |
186 | { | |
187 | ||
56236ce9 | 188 | fDigitsArray.Clear(); |
ffa78f64 | 189 | TBranch* branch = digitTree->GetBranch("FMD"); |
190 | if (!branch) { | |
c9dd1c4d | 191 | AliWarning("FMD branch in Digit Tree not found") ; |
192 | return; | |
193 | } | |
56236ce9 | 194 | TClonesArray* digitsAddress = &fDigitsArray; |
195 | branch->SetAddress(&digitsAddress); | |
ffa78f64 | 196 | branch->GetEntry(0); |
56236ce9 | 197 | MakeDigits(digitsAddress); |
c9dd1c4d | 198 | } |
199 | ||
200 | //_____________________________________________________________________ | |
c61a7285 | 201 | void AliFMDQADataMakerRec::MakeRaws(AliRawReader* /*rawReader*/) |
c9dd1c4d | 202 | { |
203 | ||
204 | } | |
205 | ||
206 | //_____________________________________________________________________ | |
207 | void AliFMDQADataMakerRec::MakeRecPoints(TTree* clustersTree) | |
208 | { | |
209 | // makes data from RecPoints | |
56236ce9 | 210 | fRecPointsArray.Clear(); |
c9dd1c4d | 211 | TBranch *fmdbranch = clustersTree->GetBranch("FMD"); |
212 | if (!fmdbranch) { | |
213 | AliError("can't get the branch with the FMD recpoints !"); | |
214 | return; | |
215 | } | |
216 | ||
56236ce9 | 217 | TClonesArray* RecPointsAddress = &fRecPointsArray; |
9bd2ccc2 | 218 | |
56236ce9 | 219 | fmdbranch->SetAddress(&RecPointsAddress); |
c9dd1c4d | 220 | fmdbranch->GetEntry(0); |
221 | ||
56236ce9 | 222 | TIter next(RecPointsAddress) ; |
c9dd1c4d | 223 | AliFMDRecPoint * rp ; |
224 | while ((rp = static_cast<AliFMDRecPoint*>(next()))) { | |
a7e41e8d | 225 | GetRecPointsData(0)->Fill(rp->Edep()) ; |
c9dd1c4d | 226 | } |
c9dd1c4d | 227 | |
228 | } | |
229 | ||
230 | //_____________________________________________________________________ | |
231 | void AliFMDQADataMakerRec::StartOfDetectorCycle() | |
232 | { | |
233 | // What | |
234 | // to | |
235 | // do? | |
236 | } | |
237 | //_____________________________________________________________________ | |
238 | // | |
239 | // EOF | |
240 | // |