]>
Commit | Line | Data |
---|---|---|
075a0e70 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, 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 | **************************************************************************/ | |
fdc38bb2 | 15 | |
16 | /////////////////////////////////////////////////////////////////////// | |
17 | // // | |
18 | // Produces the data needed to calculate the ZDC quality assurance. // | |
19 | // QA objects are 1 & 2 Dimensional histograms. // | |
20 | // author: C. Oppedisano // | |
21 | // // | |
22 | /////////////////////////////////////////////////////////////////////// | |
23 | ||
075a0e70 | 24 | // --- ROOT system --- |
25 | #include <TClonesArray.h> | |
26 | #include <TFile.h> | |
27 | #include <TH1F.h> | |
28 | #include <TH2F.h> | |
34f81d3d | 29 | #include <TLine.h> |
075a0e70 | 30 | #include <TProfile.h> |
31 | #include <Riostream.h> | |
32 | // --- Standard library --- | |
33 | ||
34 | // --- AliRoot header files --- | |
35 | #include "AliLog.h" | |
36 | #include "AliQAChecker.h" | |
f5e4ee59 | 37 | #include "AliZDCReco.h" |
78328afd | 38 | #include "AliRawReader.h" |
075a0e70 | 39 | #include "AliZDCQADataMakerRec.h" |
796c8b58 | 40 | #include "AliZDCPedestals.h" |
075a0e70 | 41 | #include "AliZDCRawStream.h" |
44ed7a66 | 42 | #include "AliZDCDigit.h" |
075a0e70 | 43 | #include "AliESDZDC.h" |
44 | #include "AliESDEvent.h" | |
45 | ||
46 | ClassImp(AliZDCQADataMakerRec) | |
47 | ||
48 | //____________________________________________________________________________ | |
49 | AliZDCQADataMakerRec::AliZDCQADataMakerRec() : | |
eca4fa66 | 50 | AliQADataMakerRec(AliQAv1::GetDetName(AliQAv1::kZDC), "ZDC Quality Assurance Data Maker"), |
796c8b58 | 51 | fPedCalibData(0x0) |
075a0e70 | 52 | { |
53 | // ctor | |
54 | } | |
55 | ||
56 | //____________________________________________________________________________ | |
57 | AliZDCQADataMakerRec::AliZDCQADataMakerRec(const AliZDCQADataMakerRec& qadm) : | |
eca4fa66 | 58 | AliQADataMakerRec(), |
2537e870 | 59 | fPedCalibData(qadm.fPedCalibData) |
796c8b58 | 60 | |
075a0e70 | 61 | { |
62 | //copy ctor | |
63 | SetName((const char*)qadm.GetName()); | |
64 | SetTitle((const char*)qadm.GetTitle()); | |
65 | } | |
66 | ||
67 | //__________________________________________________________________ | |
68 | AliZDCQADataMakerRec& AliZDCQADataMakerRec::operator = (const AliZDCQADataMakerRec& qadm ) | |
69 | { | |
70 | // Equal operator. | |
71 | this->~AliZDCQADataMakerRec(); | |
72 | new(this) AliZDCQADataMakerRec(qadm); | |
73 | return *this; | |
74 | } | |
75 | ||
2537e870 | 76 | //____________________________________________________________________________ |
77 | AliZDCQADataMakerRec::~AliZDCQADataMakerRec() | |
78 | { | |
98994547 | 79 | if(fPedCalibData && !(AliCDBManager::Instance()->GetCacheFlag())){ |
2537e870 | 80 | delete fPedCalibData; |
81 | fPedCalibData=0; | |
82 | } | |
83 | } | |
84 | ||
44ed7a66 | 85 | //____________________________________________________________________________ |
796c8b58 | 86 | AliZDCPedestals* AliZDCQADataMakerRec::GetPedCalibData() const |
87 | { | |
88 | ||
89 | // Retrieving pedestal calibration object from OCDB | |
bbcf5200 | 90 | AliZDCPedestals *calibdata = 0x0; |
796c8b58 | 91 | AliCDBEntry *entry = AliCDBManager::Instance()->Get("ZDC/Calib/Pedestals"); |
92 | if(!entry) AliWarning("No calibration data loaded!"); | |
bbcf5200 | 93 | else{ |
94 | calibdata = (AliZDCPedestals*) (entry->GetObject()); | |
95 | if(!calibdata) AliFatal("Wrong calibration object in calibration file!"); | |
96 | } | |
796c8b58 | 97 | return calibdata; |
98 | ||
99 | } | |
100 | ||
2537e870 | 101 | //____________________________________________________________________________ |
102 | void AliZDCQADataMakerRec::InitDigits() | |
103 | { | |
104 | // create Digits histograms in Digits subdir | |
105 | // | |
106 | const Bool_t expert = kTRUE ; | |
107 | const Bool_t image = kTRUE ; | |
108 | ||
109 | // ------------------- HIGH GAIN CHAIN --------------------------- | |
110 | TH1F * hDigZNCTot = new TH1F("hDigZNCTot", "Signal in ZNC;Amplitude [ADC counts];Counts", 100, 0., 6000.); | |
111 | TH1F * hDigZNATot = new TH1F("hDigZNATot", "Signal in ZNA;Amplitude [ADC counts];Counts", 100, 0., 6000.); | |
112 | TH1F * hDigZPCTot = new TH1F("hDigZPCTot", "Signal in ZPC;Amplitude [ADC counts];Counts", 100, 0., 6000.); | |
113 | TH1F * hDigZPATot = new TH1F("hDigZPATot", "Signal in ZPA;Amplitude [ADC counts];Counts", 100, 0., 6000.); | |
114 | Add2DigitsList(hDigZNCTot, 0, !expert, image); | |
115 | Add2DigitsList(hDigZNATot, 1, !expert, image); | |
116 | Add2DigitsList(hDigZPCTot, 2, !expert, image); | |
117 | Add2DigitsList(hDigZPATot, 3, !expert, image); | |
118 | // | |
119 | TH1F * hDigSumQZNC = new TH1F("hDigSumQZNC", "Signal in 4 ZNC PMQ;Amplitude [ADC counts];Counts",100, 0., 4000.); | |
120 | TH1F * hDigSumQZNA = new TH1F("hDigSumQZNA", "Signal in 4 ZNA PMQ;Amplitude [ADC counts];Counts",100, 0., 4000.); | |
121 | TH1F * hDigSumQZPC = new TH1F("hDigSumQZPC", "Signal in 4 ZPC PMQ;Amplitude [ADC counts];Counts",100, 0., 4000.); | |
122 | TH1F * hDigSumQZPA = new TH1F("hDigSumQZPA", "Signal in 4 ZPA PMQ;Amplitude [ADC counts];Counts",100, 0., 4000.); | |
123 | Add2DigitsList(hDigSumQZNC, 4, expert, !image); | |
124 | Add2DigitsList(hDigSumQZNA, 5, expert, !image); | |
125 | Add2DigitsList(hDigSumQZPC, 6, expert, !image); | |
126 | Add2DigitsList(hDigSumQZPA, 7, expert, !image); | |
127 | // | |
128 | TH1F * hDigPMCZNC = new TH1F("hDigPMCZNC", "Signal in ZNC PMC;Amplitude [ADC counts];Counts",100, 0., 4000.); | |
129 | TH1F * hDigPMCZNA = new TH1F("hDigPMCZNA", "Signal in ZNA PMC;Amplitude [ADC counts];Counts",100, 0., 4000.); | |
130 | TH1F * hDigPMCZPC = new TH1F("hDigPMCZPC", "Signal in ZPC PMC;Amplitude [ADC counts];Counts",100, 0., 4000.); | |
131 | TH1F * hDigPMCZPA = new TH1F("hDigPMCZPA", "Signal in ZPA PMC;Amplitude [ADC counts];Counts",100, 0., 4000.); | |
132 | Add2DigitsList(hDigPMCZNC, 8, expert, !image); | |
133 | Add2DigitsList(hDigPMCZNA, 9, expert, !image); | |
134 | Add2DigitsList(hDigPMCZPC, 10, expert, !image); | |
135 | Add2DigitsList(hDigPMCZPA, 11, expert, !image); | |
136 | // | |
92664bc8 | 137 | ClonePerTrigClass(AliQAv1::kDIGITS); // this should be the last line |
2537e870 | 138 | } |
139 | ||
796c8b58 | 140 | //____________________________________________________________________________ |
141 | void AliZDCQADataMakerRec::InitRaws() | |
44ed7a66 | 142 | { |
143 | // create Digits histograms in Digits subdir | |
44ed7a66 | 144 | const Bool_t expert = kTRUE ; |
145 | const Bool_t image = kTRUE ; | |
34f81d3d | 146 | |
2d9c70ab | 147 | TH1F * hZNCSpectrum = new TH1F("hZNCSpectrum","ZNC spectrum;Amplitude [ADC counts];Counts",100,0.,1200.); |
148 | TH1F * hZPCSpectrum = new TH1F("hZPCSpectrum","ZPC spectrum;Amplitude [ADC counts];Counts",100,0.,1200.); | |
149 | TH1F * hZNASpectrum = new TH1F("hZNASpectrum","ZNA spectrum;Amplitude [ADC counts];Counts",100,0.,1200.); | |
150 | TH1F * hZPASpectrum = new TH1F("hZPASpectrum","ZPA spectrum;Amplitude [ADC counts];Counts",100,0.,1200.); | |
4998d47e | 151 | // Booking from ch. 8 for checked signals to avoid running QA on pedestals! |
9a3cf92f | 152 | TH1F * hZEM1Spectrum = new TH1F("hZEM1Spectrum","ZEM1 spectrum;Amplitude [ADC counts];Counts",100,8., 1208.); |
153 | TH1F * hZEM2Spectrum = new TH1F("hZEM2Spectrum","ZEM2 spectrum;Amplitude [ADC counts];Counts",100,8., 1208.); | |
34f81d3d | 154 | Add2RawsList(hZNCSpectrum, 0, expert, !image); |
155 | Add2RawsList(hZNASpectrum, 1, expert, !image); | |
156 | Add2RawsList(hZPCSpectrum, 2, expert, !image); | |
157 | Add2RawsList(hZPASpectrum, 3, expert, !image); | |
891ddd89 | 158 | Add2RawsList(hZEM1Spectrum, 4, expert, !image); |
159 | Add2RawsList(hZEM2Spectrum, 5, expert, !image); | |
2d9c70ab | 160 | |
9a3cf92f | 161 | TH1F * hRawPMCZNC = new TH1F("hRawPMCZNC", "Raw ZNC PMC;Amplitude [ADC counts];Counts",100, 8., 1208.); |
162 | TH1F * hRawPMCZNA = new TH1F("hRawPMCZNA", "Raw ZNA PMC;Amplitude [ADC counts];Counts",100, 8., 1208.); | |
163 | TH1F * hRawPMCZPC = new TH1F("hRawPMCZPC", "Raw ZPC PMC;Amplitude [ADC counts];Counts",100, 8., 1208.); | |
164 | TH1F * hRawPMCZPA = new TH1F("hRawPMCZPA", "Raw ZPA PMC;Amplitude [ADC counts];Counts",100, 8., 1208.); | |
92664bc8 | 165 | Add2RawsList(hRawPMCZNC, 6, expert, !image); |
166 | Add2RawsList(hRawPMCZNA, 7, expert, !image); | |
167 | Add2RawsList(hRawPMCZPC, 8, expert, !image); | |
168 | Add2RawsList(hRawPMCZPA, 9, expert, !image); | |
2d9c70ab | 169 | TH1F * hRawSumQZNC = new TH1F("hRawSumQZNC", "Raw sumQ ZNC;Amplitude [ADC counts];Counts",100, 0., 1200.); |
170 | TH1F * hRawSumQZNA = new TH1F("hRawSumQZNA", "Raw sumQ ZNA;Amplitude [ADC counts];Counts",100, 0., 1200.); | |
171 | TH1F * hRawSumQZPC = new TH1F("hRawSumQZPC", "Raw sumQ ZPC;Amplitude [ADC counts];Counts",100, 0., 1200.); | |
172 | TH1F * hRawSumQZPA = new TH1F("hRawSumQZPA", "Raw sumQ ZPA;Amplitude [ADC counts];Counts",100, 0., 1200.); | |
92664bc8 | 173 | Add2RawsList(hRawSumQZNC, 10, expert, !image); |
174 | Add2RawsList(hRawSumQZNA, 11, expert, !image); | |
175 | Add2RawsList(hRawSumQZPC, 12, expert, !image); | |
176 | Add2RawsList(hRawSumQZPA, 13, expert, !image); | |
193f9a91 | 177 | |
df7e8023 | 178 | TH1F * hRawTDCZNC = new TH1F("hRawTDCZNC", "TDC ZNC;TDC [ns]",160, -320., -260.); |
179 | Add2RawsList(hRawTDCZNC, 14, expert, !image); | |
180 | TH1F * hRawTDCZPC = new TH1F("hRawTDCZPC", "TDC ZPC;TDC [ns]",160, -340., -280.); | |
92664bc8 | 181 | Add2RawsList(hRawTDCZPC, 15, expert, !image); |
df7e8023 | 182 | TH1F * hRawTDCZNA = new TH1F("hRawTDCZNA", "TDC ZNA;TDC [ns]",160, -340., -280.); |
183 | Add2RawsList(hRawTDCZNA, 16, expert, !image); | |
184 | TH1F * hRawTDCZPA = new TH1F("hRawTDCZPA", "TDC ZPA;TDC [ns]",160, -340., -280.); | |
185 | Add2RawsList(hRawTDCZPA, 17, expert, !image); | |
186 | TH1F * hRawTDCZEM1 = new TH1F("hRawTDCZEM1", "TDC ZEM1;TDC [ns]",160, -320., -280.); | |
187 | Add2RawsList(hRawTDCZEM1, 18, expert, !image); | |
188 | TH1F * hRawTDCZEM2 = new TH1F("hRawTDCZEM2", "TDC ZEM2;TDC [ns]",160, -320., -280.); | |
189 | Add2RawsList(hRawTDCZEM2, 19, expert, !image); | |
891ddd89 | 190 | |
191 | TProfile * hRawADCProfs = new TProfile("hRawADCProfs", "ADC profiles;ADC id;Mean ADC values",22,-0.5,21.5,10.,1210.,""); | |
df7e8023 | 192 | Add2RawsList(hRawADCProfs, 20, expert, !image); |
f9223476 | 193 | TProfile * hRawTDCProfs = new TProfile("hRawTDCProfs", "TDC profiles;TDC id;Mean TDC values",6,0.5,6.5,-340.,-290.,"S"); |
df7e8023 | 194 | Add2RawsList(hRawTDCProfs, 21, expert, !image); |
891ddd89 | 195 | |
196 | TH1F * hRawADCs = new TH1F("hRawADCs", "ADCs;ADC id;Mean ADC values",22,-0.5,21.5); | |
df7e8023 | 197 | Add2RawsList(hRawADCs, 22, !expert, image); |
891ddd89 | 198 | |
199 | TH1F * hRawTDCs = new TH1F("hRawTDCs", "TDCs;TDC id;Mean TDC values",6,0.5,6.5); | |
92664bc8 | 200 | // hRawTDCs->SetMaximum(-300); hRawTDCs->SetMinimum(-340); |
df7e8023 | 201 | Add2RawsList(hRawTDCs, 23, !expert, image); |
202 | ||
203 | TH2F *hTimeZDC = new TH2F("hTimeZDC", "ZDC timing;(ZNC-ZNA) (ns);(ZNC+ZNA) (ns)", 120,-30.,30.,120,-100.,-40.); | |
204 | Add2RawsList(hTimeZDC, 24, !expert, image); | |
891ddd89 | 205 | |
4998d47e | 206 | TH2F *hZNCrawCentr = new TH2F("hZNCrawCentr", "ZNC centroid;X (cm);Y(cm)", 100,-3.5,3.5,100,-3.5,3.5); |
df7e8023 | 207 | Add2RawsList(hZNCrawCentr, 25, expert, image); |
4998d47e | 208 | TH2F *hZNArawCentr = new TH2F("hZNArawCentr", "ZNA centroid;X (cm);Y(cm)", 100,-3.5,3.5,100,-3.5,3.5); |
df7e8023 | 209 | Add2RawsList(hZNArawCentr, 26, expert, image); |
08e3bee4 | 210 | |
92664bc8 | 211 | // |
212 | ClonePerTrigClass(AliQAv1::kRAWS); // this should be the last line | |
44ed7a66 | 213 | } |
214 | ||
f5e4ee59 | 215 | //____________________________________________________________________________ |
216 | void AliZDCQADataMakerRec::InitRecPoints() | |
217 | { | |
218 | // create Digits histograms in Digits subdir | |
219 | const Bool_t expert = kTRUE ; | |
220 | const Bool_t image = kTRUE ; | |
221 | // | |
222 | // ------------------- HIGH GAIN CHAIN --------------------------- | |
796c8b58 | 223 | TH1F * hRecZNCTot = new TH1F("hRecZNCTot", "Rec signal in ZNC;Amplitude [ADC counts];Counts", 100, 0., 2000.); |
224 | TH1F * hRecZNATot = new TH1F("hRecZNATot", "Rec signal in ZNA;Amplitude [ADC counts];Counts", 100, 0., 2000.); | |
225 | TH1F * hRecZPCTot = new TH1F("hRecZPCTot", "Rec signal in ZPC;Amplitude [ADC counts];Counts", 100, 0., 8000.); | |
226 | TH1F * hRecZPATot = new TH1F("hRecZPATot", "Rec signal in ZPA;Amplitude [ADC counts];Counts", 100, 0., 8000.); | |
227 | Add2RecPointsList(hRecZNCTot, 0, !expert, image); | |
228 | Add2RecPointsList(hRecZNATot, 1, !expert, image); | |
229 | Add2RecPointsList(hRecZPCTot, 2, !expert, image); | |
230 | Add2RecPointsList(hRecZPATot, 3, !expert, image); | |
f5e4ee59 | 231 | // |
796c8b58 | 232 | TH1F * hRecSumQZNC = new TH1F("hRecSumQZNC", "Rec summed 4 ZNC quadrants;Amplitude [ADC counts];Counts",100, 0., 2000.); |
233 | TH1F * hRecSumQZNA = new TH1F("hRecSumQZNA", "Rec summed 4 ZNA quadrants;Amplitude [ADC counts];Counts",100, 0., 2000.); | |
234 | TH1F * hRecSumQZPC = new TH1F("hRecSumQZPC", "Rec summed 4 ZPC quadrants;Amplitude [ADC counts];Counts",100, 0., 2000.); | |
235 | TH1F * hRecSumQZPA = new TH1F("hRecSumQZPA", "Rec summed 4 ZPA quadrants;Amplitude [ADC counts];Counts",100, 0., 2000.); | |
f5e4ee59 | 236 | Add2RecPointsList(hRecSumQZNC, 4, expert, !image); |
237 | Add2RecPointsList(hRecSumQZNA, 5, expert, !image); | |
238 | Add2RecPointsList(hRecSumQZPC, 6, expert, !image); | |
239 | Add2RecPointsList(hRecSumQZPA, 7, expert, !image); | |
240 | // | |
796c8b58 | 241 | TH1F * hRecPMCZNC = new TH1F("hRecPMCZNC", "Rec common ZNC PMT;Amplitude [ADC counts];Counts",100, 0., 2000.); |
242 | TH1F * hRecPMCZNA = new TH1F("hRecPMCZNA", "Rec common ZNA PMT;Amplitude [ADC counts];Counts",100, 0., 2000.); | |
243 | TH1F * hRecPMCZPC = new TH1F("hRecPMCZPC", "Rec common ZPC PMT;Amplitude [ADC counts];Counts",100, 0., 2000.); | |
244 | TH1F * hRecPMCZPA = new TH1F("hRecPMCZPA", "Rec common ZPA PMT;Amplitude [ADC counts];Counts",100, 0., 2000.); | |
245 | Add2RecPointsList(hRecPMCZNC, 8 , expert, !image); | |
246 | Add2RecPointsList(hRecPMCZNA, 9 , expert, !image); | |
247 | Add2RecPointsList(hRecPMCZPC, 10, expert, !image); | |
248 | Add2RecPointsList(hRecPMCZPA, 11, expert, !image); | |
92664bc8 | 249 | // |
250 | ClonePerTrigClass(AliQAv1::kRECPOINTS); // this should be the last line | |
f5e4ee59 | 251 | } |
252 | ||
075a0e70 | 253 | //____________________________________________________________________________ |
254 | void AliZDCQADataMakerRec::InitESDs() | |
255 | { | |
256 | //Booking ESDs histograms | |
257 | // | |
b72460a5 | 258 | const Bool_t expert = kTRUE ; |
259 | const Bool_t image = kTRUE ; | |
7d297381 | 260 | |
fdc38bb2 | 261 | // ------------------- HIGH GAIN CHAIN --------------------------- |
796c8b58 | 262 | TH1F * hESDZNCTot = new TH1F("hESDZNCTot", "Energy in ZNC", 100, 0., 4000.); |
263 | TH1F * hESDZNATot = new TH1F("hESDZNATot", "Energy in ZNA", 100, 0., 4000.); | |
264 | TH1F * hESDZPCTot = new TH1F("hESDZPCTot", "Energy in ZPC", 100, 0., 4000.); | |
265 | TH1F * hESDZPATot = new TH1F("hESDZPATot", "Energy in ZPA", 100, 0., 4000.); | |
92664bc8 | 266 | Add2ESDsList(hESDZNCTot, 0, !expert, image); |
267 | Add2ESDsList(hESDZNATot, 1, !expert, image); | |
268 | Add2ESDsList(hESDZPCTot, 2, !expert, image); | |
269 | Add2ESDsList(hESDZPATot, 3, !expert, image); | |
796c8b58 | 270 | // |
271 | TH1F * hESDZEM1 = new TH1F("hESDZEM1", "Energy in ZEM1", 100, 0., 2000.); | |
272 | TH1F * hESDZEM2 = new TH1F("hESDZEM2", "Energy in ZEM2", 100, 0., 2000.); | |
92664bc8 | 273 | Add2ESDsList(hESDZEM1,4, !expert, image); |
274 | Add2ESDsList(hESDZEM2,5, !expert, image); | |
075a0e70 | 275 | // |
796c8b58 | 276 | TH1F * hESDSumQZNC = new TH1F("hESDSumQZNC", "Sum of 4 ZNC energy",100, 0., 2000.); |
277 | TH1F * hESDSumQZNA = new TH1F("hESDSumQZNA", "Sum of 4 ZNA energy",100, 0., 2000.); | |
278 | TH1F * hESDSumQZPC = new TH1F("hESDSumQZPC", "Sum of 4 ZPC energy",100, 0., 2000.); | |
279 | TH1F * hESDSumQZPA = new TH1F("hESDSumQZPA", "Sum of 4 ZPA energy",100, 0., 2000.); | |
92664bc8 | 280 | Add2ESDsList(hESDSumQZNC, 6, expert, !image); |
281 | Add2ESDsList(hESDSumQZNA, 7, expert, !image); | |
282 | Add2ESDsList(hESDSumQZPC, 8, expert, !image); | |
283 | Add2ESDsList(hESDSumQZPA, 9, expert, !image); | |
075a0e70 | 284 | // |
796c8b58 | 285 | TH1F * hESDPMCZNC = new TH1F("hESDPMCZNC", "Energy in ZNC PMC",100, 0., 2000.); |
286 | TH1F * hESDPMCZNA = new TH1F("hESDPMCZNA", "Energy in ZNA PMC",100, 0., 2000.); | |
287 | TH1F * hESDPMCZPC = new TH1F("hESDPMCZPC", "Energy in ZPC PMC",100, 0., 2000.); | |
288 | TH1F * hESDPMCZPA = new TH1F("hESDPMCZPA", "Energy in ZPA PMC",100, 0., 2000.); | |
92664bc8 | 289 | Add2ESDsList(hESDPMCZNC, 10, expert, !image); |
290 | Add2ESDsList(hESDPMCZNA, 11, expert, !image); | |
291 | Add2ESDsList(hESDPMCZPC, 12, expert, !image); | |
292 | Add2ESDsList(hESDPMCZPA, 13, expert, !image); | |
075a0e70 | 293 | // |
92664bc8 | 294 | ClonePerTrigClass(AliQAv1::kESDS); // this should be the last line |
075a0e70 | 295 | } |
075a0e70 | 296 | |
2537e870 | 297 | //___________________________________________________________________________ |
298 | void AliZDCQADataMakerRec::MakeDigits(TTree *digitTree) | |
299 | { | |
300 | // makes data from Digit Tree | |
301 | if(!GetDigitsData(0)) InitDigits(); | |
302 | ||
303 | if(!digitTree){ | |
304 | AliError("Can't get ZDC digit tree!!"); | |
305 | return; | |
306 | } | |
307 | ||
308 | TBranch * branch = digitTree->GetBranch("ZDC"); | |
309 | if(!branch){ | |
310 | AliError("ZDC branch in digit tree not found"); | |
311 | return; | |
312 | } | |
313 | ||
314 | AliZDCDigit *digit = 0x0; | |
315 | branch->SetAddress(&digit); | |
316 | ||
317 | Float_t adcSum_ZNC=0., adcSum_ZNA=0., adcSum_ZPC=0., adcSum_ZPA=0.; | |
318 | Float_t adcSumQ_ZNC=0., adcSumQ_ZNA=0., adcSumQ_ZPC=0., adcSumQ_ZPA=0.; | |
92664bc8 | 319 | //Float_t adcSum_ZNC_lg=0., adcSum_ZNA_lg=0., adcSum_ZPC_lg=0., adcSum_ZPA_lg=0.; |
320 | //Float_t adcSumQ_ZNC_lg=0., adcSumQ_ZNA_lg=0., adcSumQ_ZPC_lg=0., adcSumQ_ZPA_lg=0.; | |
2537e870 | 321 | |
322 | Int_t ndig = digitTree->GetEntries(); | |
323 | for(Int_t i=0; i<ndig; i++){ | |
324 | branch->GetEntry(i); | |
325 | ||
326 | if(digit->GetSector(0)==1 && digit->GetSector(1)!=5){ | |
327 | adcSum_ZNC += digit->GetADCValue(0); | |
92664bc8 | 328 | //adcSum_ZNC_lg += digit->GetADCValue(1); |
2537e870 | 329 | // |
330 | if(digit->GetSector(1)!=0){ | |
331 | adcSumQ_ZNC += digit->GetADCValue(0); | |
92664bc8 | 332 | //adcSumQ_ZNC_lg+= digit->GetADCValue(1); |
2537e870 | 333 | } |
334 | else{ | |
92664bc8 | 335 | FillDigitsData(8,digit->GetADCValue(0)); |
336 | //FillDigitsData(20,digit->GetADCValue(1)); | |
2537e870 | 337 | } |
338 | } | |
339 | else if(digit->GetSector(0)==2){ | |
340 | adcSum_ZPC += digit->GetADCValue(0); | |
92664bc8 | 341 | //adcSum_ZPC_lg += digit->GetADCValue(1); |
2537e870 | 342 | // |
343 | if(digit->GetSector(1)!=0){ | |
344 | adcSumQ_ZPC += digit->GetADCValue(0); | |
92664bc8 | 345 | //adcSumQ_ZPC_lg+= digit->GetADCValue(1); |
2537e870 | 346 | } |
347 | else{ | |
92664bc8 | 348 | FillDigitsData(10,digit->GetADCValue(0)); |
349 | //FillDigitsData(22,digit->GetADCValue(1)); | |
2537e870 | 350 | } |
351 | } | |
352 | else if(digit->GetSector(0)==4 && digit->GetSector(1)!=5){ | |
353 | adcSum_ZNA += digit->GetADCValue(0); | |
92664bc8 | 354 | //adcSum_ZNA_lg += digit->GetADCValue(1); |
2537e870 | 355 | // |
356 | if(digit->GetSector(1)!=0){ | |
357 | adcSumQ_ZNA += digit->GetADCValue(0); | |
92664bc8 | 358 | //adcSumQ_ZNA_lg+= digit->GetADCValue(1); |
2537e870 | 359 | } |
360 | else{ | |
92664bc8 | 361 | FillDigitsData(9,digit->GetADCValue(0)); |
362 | //FillDigitsData(21,digit->GetADCValue(1)); | |
2537e870 | 363 | } |
364 | } | |
365 | else if(digit->GetSector(0)==5){ | |
366 | adcSum_ZPA += digit->GetADCValue(0); | |
92664bc8 | 367 | //adcSum_ZPA_lg += digit->GetADCValue(1); |
2537e870 | 368 | // |
369 | if(digit->GetSector(1)!=0){ | |
370 | adcSumQ_ZPA += digit->GetADCValue(0); | |
92664bc8 | 371 | //adcSumQ_ZPA_lg+= digit->GetADCValue(1); |
2537e870 | 372 | } |
373 | else{ | |
92664bc8 | 374 | FillDigitsData(11,digit->GetADCValue(0)); |
375 | //FillDigitsData(23,digit->GetADCValue(1)); | |
2537e870 | 376 | } |
377 | } | |
378 | } | |
379 | // | |
92664bc8 | 380 | FillDigitsData(0,adcSum_ZNC); |
381 | FillDigitsData(1,adcSum_ZNA); | |
382 | FillDigitsData(2,adcSum_ZPC); | |
383 | FillDigitsData(3,adcSum_ZPA); | |
2537e870 | 384 | // |
92664bc8 | 385 | FillDigitsData(4,adcSumQ_ZNC); |
386 | FillDigitsData(5,adcSumQ_ZNA); | |
387 | FillDigitsData(6,adcSumQ_ZPC); | |
388 | FillDigitsData(7,adcSumQ_ZPA); | |
2537e870 | 389 | |
390 | delete digit; | |
391 | digit=0; | |
92664bc8 | 392 | // |
393 | IncEvCountCycleDigits(); | |
394 | IncEvCountTotalDigits(); | |
395 | // | |
2537e870 | 396 | } |
397 | ||
398 | ||
796c8b58 | 399 | //____________________________________________________________________________ |
400 | void AliZDCQADataMakerRec::MakeRaws(AliRawReader *rawReader) | |
44ed7a66 | 401 | { |
796c8b58 | 402 | // Filling Raws QA histos |
403 | // | |
d8fa3de2 | 404 | // Checking the event type |
405 | // if (rawReader->GetType()!=7){ | |
eca4fa66 | 406 | |
d8fa3de2 | 407 | // Check if histograms already created for this Event Specie |
408 | if(!GetRawsData(0)) InitRaws(); | |
d8fa3de2 | 409 | // Parameters for mean value pedestal subtraction |
410 | int const kNch = 24; | |
411 | Float_t meanPed[2*kNch]; | |
bbcf5200 | 412 | for(Int_t jj=0; jj<2*kNch; jj++){ |
413 | if(fPedCalibData) meanPed[jj] = fPedCalibData->GetMeanPed(jj); | |
414 | else{ | |
415 | meanPed[jj] = 0.; | |
416 | printf(" AliZDCQADataMakerRec::MakeRaws -> No valid pedestal object loaded!\n\n"); | |
417 | } | |
418 | } | |
01c49108 | 419 | |
420 | Float_t zncSignal=0., znaSignal=0., zpcSignal=0., zpaSignal=0.; | |
421 | Float_t zncSumQ=0., znaSumQ=0., zpcSumQ=0., zpaSumQ=0.; | |
422 | Float_t zncpmC=0., znapmC=0., zpcpmC=0., zpapmC=0.; | |
423 | Bool_t isZNCFired=kFALSE, isZPCFired=kFALSE, isZNAFired=kFALSE, isZPAFired=kFALSE; | |
424 | Int_t indZNC=0, indZNA=0, indZPC=0, indZPA=0; | |
1df1f73b | 425 | Double_t zncTDC=0., zpcTDC=0., zem1TDC=0., zem2TDC=0., znaTDC=0., zpaTDC=0.; |
426 | Double_t zncSumTDC=0., znaSumTDC=0., tdcGate=0., l0=0.; | |
891ddd89 | 427 | |
428 | const Float_t x[4] = {-1.75, 1.75, -1.75, 1.75}; | |
429 | const Float_t y[4] = {-1.75, -1.75, 1.75, 1.75}; | |
430 | const Float_t alpha=0.5; | |
431 | Float_t numXZNC=0., numYZNC=0., denZNC=0., wZNC=0.; | |
432 | Float_t numXZNA=0., numYZNA=0., denZNA=0., wZNA=0.; | |
193f9a91 | 433 | |
01c49108 | 434 | rawReader->Reset(); |
d8fa3de2 | 435 | AliZDCRawStream stream(rawReader); |
436 | while(stream.Next()){ | |
01c49108 | 437 | |
d8fa3de2 | 438 | if(stream.IsADCDataWord() && |
439 | (stream.GetADCModule()==0 || stream.GetADCModule()==1)){ | |
796c8b58 | 440 | |
d8fa3de2 | 441 | Int_t det = stream.GetSector(0); |
442 | Int_t quad = stream.GetSector(1); | |
443 | Int_t gain = stream.GetADCGain(); | |
444 | Int_t pedindex=0; | |
445 | ||
446 | // Stuff for pedestal subtraction | |
447 | if(quad != 5){ // ZDCs (not reference PTMs) | |
4998d47e | 448 | Float_t rawVal=-99., pedSubVal=-99.; |
d8fa3de2 | 449 | if(det == 1){ |
450 | pedindex = quad; | |
451 | if(gain == 0){ | |
4998d47e | 452 | rawVal = (Float_t) (stream.GetADCValue()); |
453 | pedSubVal = (Float_t) (rawVal-meanPed[pedindex]); | |
d8fa3de2 | 454 | zncSignal += pedSubVal; |
455 | isZNCFired = kTRUE; | |
891ddd89 | 456 | if(quad!=0){ |
457 | zncSumQ += pedSubVal; | |
4998d47e | 458 | if(pedSubVal>0.&& zncpmC>7.){ |
891ddd89 | 459 | wZNC = TMath::Power(pedSubVal, alpha); |
460 | numXZNC += x[quad-1]*wZNC; | |
461 | numYZNC += y[quad-1]*wZNC; | |
462 | denZNC += wZNC; | |
463 | } | |
464 | } | |
d8fa3de2 | 465 | else{ |
466 | zncpmC = pedSubVal; | |
92664bc8 | 467 | FillRawsData(6,zncpmC); |
d8fa3de2 | 468 | } |
a633806a | 469 | indZNC++; |
891ddd89 | 470 | |
df7e8023 | 471 | FillRawsData(20, pedindex, pedSubVal); |
d8fa3de2 | 472 | } |
473 | } | |
474 | else if(det == 2){ | |
475 | pedindex = quad+5; | |
476 | if(gain == 0){ | |
4998d47e | 477 | rawVal = (Float_t) (stream.GetADCValue()); |
478 | pedSubVal = (Float_t) (rawVal-meanPed[pedindex]); | |
d8fa3de2 | 479 | zpcSignal += pedSubVal; |
480 | isZPCFired = kTRUE; | |
481 | if(quad!=0) zpcSumQ += pedSubVal; | |
482 | else{ | |
483 | zpcpmC = pedSubVal; | |
92664bc8 | 484 | FillRawsData(8,zpcpmC); |
d8fa3de2 | 485 | } |
a633806a | 486 | indZPC++; |
891ddd89 | 487 | |
df7e8023 | 488 | FillRawsData(20, pedindex, pedSubVal); |
d8fa3de2 | 489 | } |
490 | } | |
491 | else if(det == 3){ | |
492 | pedindex = quad+9; | |
493 | if(quad==1){ | |
494 | if(gain == 0){ | |
4998d47e | 495 | rawVal = (Float_t) (stream.GetADCValue()); |
496 | pedSubVal = (Float_t) (rawVal-meanPed[pedindex]); | |
92664bc8 | 497 | FillRawsData(4,pedSubVal); |
df7e8023 | 498 | FillRawsData(20,pedindex, pedSubVal); |
d8fa3de2 | 499 | } |
500 | } | |
501 | else if(quad==2){ | |
502 | if(gain == 0){ | |
4998d47e | 503 | rawVal = (Float_t) (stream.GetADCValue()); |
504 | pedSubVal = (Float_t) (rawVal-meanPed[pedindex]); | |
92664bc8 | 505 | FillRawsData(5,pedSubVal); |
df7e8023 | 506 | FillRawsData(20,pedindex, pedSubVal); |
d8fa3de2 | 507 | } |
508 | } | |
509 | } | |
510 | else if(det == 4){ | |
511 | pedindex = quad+12; | |
512 | if(gain == 0){ | |
4998d47e | 513 | rawVal = (Float_t) (stream.GetADCValue()); |
514 | pedSubVal = (Float_t) (rawVal-meanPed[pedindex]); | |
d8fa3de2 | 515 | znaSignal += pedSubVal; |
516 | isZNAFired = kTRUE; | |
891ddd89 | 517 | if(quad!=0){ |
518 | znaSumQ += pedSubVal; | |
4998d47e | 519 | if(pedSubVal>0.&& znapmC>7.) { |
891ddd89 | 520 | wZNA = TMath::Power(pedSubVal, alpha); |
521 | numXZNA += x[quad-1]*wZNA; | |
522 | numYZNA += y[quad-1]*wZNA; | |
523 | denZNA += wZNA; | |
524 | } | |
525 | } | |
d8fa3de2 | 526 | else{ |
527 | znapmC = pedSubVal; | |
92664bc8 | 528 | FillRawsData(7,znapmC); |
d8fa3de2 | 529 | } |
a633806a | 530 | indZNA++; |
891ddd89 | 531 | |
df7e8023 | 532 | FillRawsData(20,pedindex, pedSubVal); |
d8fa3de2 | 533 | } |
534 | } | |
535 | else if(det == 5){ | |
536 | pedindex = quad+17; | |
537 | if(gain == 0){ | |
4998d47e | 538 | rawVal = (Float_t) (stream.GetADCValue()); |
539 | pedSubVal = (Float_t) (rawVal-meanPed[pedindex]); | |
d8fa3de2 | 540 | zpaSignal += pedSubVal; |
541 | isZPAFired = kTRUE; | |
542 | if(quad!=0) zpaSumQ += pedSubVal; | |
543 | else{ | |
544 | zpapmC = pedSubVal; | |
92664bc8 | 545 | FillRawsData(9,zpapmC); |
d8fa3de2 | 546 | } |
a633806a | 547 | indZPA++; |
891ddd89 | 548 | |
df7e8023 | 549 | FillRawsData(20,pedindex, pedSubVal); |
d8fa3de2 | 550 | } |
551 | } | |
891ddd89 | 552 | |
553 | } | |
554 | ||
01c49108 | 555 | if(isZNCFired && indZNC==5){ |
92664bc8 | 556 | FillRawsData(0,zncSignal); |
557 | FillRawsData(10,zncSumQ); | |
891ddd89 | 558 | // |
559 | Float_t xZNC, yZNC; | |
560 | if(denZNC!=0){ | |
561 | xZNC = numXZNC/denZNC; | |
562 | yZNC = numYZNC/denZNC; | |
563 | } | |
564 | else xZNC = yZNC = 999.; | |
df7e8023 | 565 | FillRawsData(25, xZNC, yZNC, zncpmC); |
d8fa3de2 | 566 | } |
01c49108 | 567 | if(isZPCFired && indZPC==5){ |
92664bc8 | 568 | FillRawsData(2,zpcSignal); |
569 | FillRawsData(12,zpcSumQ); | |
d8fa3de2 | 570 | } |
01c49108 | 571 | if(isZNAFired && indZNA==5){ |
92664bc8 | 572 | FillRawsData(1,znaSignal); |
573 | FillRawsData(11,znaSumQ); | |
891ddd89 | 574 | // |
575 | Float_t xZNA, yZNA; | |
576 | if(denZNA!=0){ | |
577 | xZNA = numXZNA/denZNA; | |
578 | yZNA = numYZNA/denZNA; | |
579 | } | |
580 | else xZNA = yZNA = 999.; | |
df7e8023 | 581 | FillRawsData(26, xZNA, yZNA, znapmC); |
d8fa3de2 | 582 | } |
01c49108 | 583 | if(isZPAFired && indZPA==5){ |
92664bc8 | 584 | FillRawsData(3,zpaSignal); |
585 | FillRawsData(13,zpaSumQ); | |
d8fa3de2 | 586 | } |
01c49108 | 587 | |
588 | if(indZNC==5){ | |
589 | zncSignal = zncSumQ = zncpmC = 0; | |
590 | isZNCFired=kFALSE; indZNC=0; | |
591 | } | |
592 | if(indZPC==5){ | |
593 | zpcSignal = zpcSumQ = zpcpmC = 0; | |
594 | isZPCFired=kFALSE; indZPC=0; | |
595 | } | |
596 | if(indZNA==5){ | |
597 | znaSignal = znaSumQ = znapmC = 0; | |
598 | isZNAFired=kFALSE; indZNA=0; | |
599 | } | |
600 | if(indZPA==5){ | |
601 | zpaSignal = zpaSumQ = zpapmC = 0; | |
602 | isZPAFired=kFALSE; indZPA=0; | |
603 | } | |
891ddd89 | 604 | |
d8fa3de2 | 605 | } //IsADCDataWord && signal ADCs |
193f9a91 | 606 | else if(stream.IsZDCTDCDatum()){ |
aaba06a5 | 607 | Float_t tdcValue = 0.025*stream.GetZDCTDCDatum(); |
df7e8023 | 608 | if(stream.GetChannel()==1 && tdcValue!=0.){ |
609 | zncTDC = tdcValue; | |
610 | } | |
611 | else if(stream.GetChannel()==3 && tdcValue!=0.){ | |
612 | zpcTDC = tdcValue; | |
613 | } | |
dc4d8a8a | 614 | else if(stream.GetChannel()==5 && tdcValue!=0.){ |
df7e8023 | 615 | znaTDC = tdcValue; |
616 | } | |
617 | else if(stream.GetChannel()==7 && tdcValue!=0.){ | |
618 | zpaTDC = tdcValue; | |
619 | } | |
620 | else if(stream.GetChannel()==8 && tdcValue!=0.){ | |
aaba06a5 | 621 | zem1TDC = tdcValue; |
891ddd89 | 622 | } |
aaba06a5 | 623 | else if(stream.GetChannel()==9 && tdcValue!=0.){ |
624 | zem2TDC = tdcValue; | |
193f9a91 | 625 | } |
aaba06a5 | 626 | else if(stream.GetChannel()==10 && tdcValue!=0.){ |
df7e8023 | 627 | zncSumTDC = tdcValue; |
08e3bee4 | 628 | } |
aaba06a5 | 629 | else if(stream.GetChannel()==12 && tdcValue!=0.){ |
df7e8023 | 630 | znaSumTDC = tdcValue; |
08e3bee4 | 631 | } |
aaba06a5 | 632 | else if(stream.GetChannel()==14 && tdcValue!=0.) tdcGate = tdcValue; |
633 | else if(stream.GetChannel()==15 && tdcValue!=0.) l0 = tdcValue; | |
193f9a91 | 634 | |
aaba06a5 | 635 | if(stream.GetChannel()==16 && tdcGate!=0. && l0!=0.){ |
636 | if(zncTDC!=0.){ | |
637 | Float_t znc = zncTDC-tdcGate; | |
df7e8023 | 638 | FillRawsData(14,znc); |
dc4d8a8a | 639 | if(znc>-340. && znc<-290.) FillRawsData(21,1, znc); |
891ddd89 | 640 | } |
aaba06a5 | 641 | if(zpcTDC!=0.){ |
642 | Float_t zpc = zpcTDC-tdcGate; | |
643 | FillRawsData(15,zpc); | |
dc4d8a8a | 644 | if(zpc>-340. && zpc<-290.) FillRawsData(21,2, zpc); |
891ddd89 | 645 | } |
aaba06a5 | 646 | if(znaTDC!=0.){ |
647 | Float_t zna = znaTDC-tdcGate; | |
df7e8023 | 648 | FillRawsData(16,zna); |
dc4d8a8a | 649 | if(zna>-340. && zna<-290.) FillRawsData(21,3, zna); |
891ddd89 | 650 | } |
aaba06a5 | 651 | if(zpaTDC!=0.){ |
652 | Float_t zpa = zpaTDC-tdcGate; | |
df7e8023 | 653 | FillRawsData(17,zpa); |
dc4d8a8a | 654 | if(zpa>-340. && zpa<-290.) FillRawsData(21,4, zpa); |
193f9a91 | 655 | } |
aaba06a5 | 656 | if(zem1TDC!=0.){ |
657 | Float_t zem1 = zem1TDC-tdcGate; | |
df7e8023 | 658 | FillRawsData(18,zem1); |
dc4d8a8a | 659 | if(zem1>-340. && zem1<-290.) FillRawsData(21,5, zem1); |
193f9a91 | 660 | } |
aaba06a5 | 661 | if(zem2TDC!=0.){ |
662 | Float_t zem2 = zem2TDC-tdcGate; | |
df7e8023 | 663 | FillRawsData(19,zem2); |
dc4d8a8a | 664 | if(zem2TDC>-340. && zem2<-290.) FillRawsData(21,6, zem2); |
891ddd89 | 665 | } |
df7e8023 | 666 | if(znaSumTDC!=0. && zncSumTDC!=0.){ |
667 | Float_t tdcC = zncSumTDC-l0; | |
668 | Float_t tdcA = znaSumTDC-l0; | |
669 | FillRawsData(24, tdcC-tdcA, tdcC+tdcA); | |
08e3bee4 | 670 | } |
193f9a91 | 671 | // |
aaba06a5 | 672 | tdcGate = zncTDC = zpcTDC = zem1TDC = zem2TDC = znaTDC = zpaTDC = 0.; |
1df1f73b | 673 | zncSumTDC = znaSumTDC = 0.; |
193f9a91 | 674 | } |
675 | } | |
796c8b58 | 676 | |
d8fa3de2 | 677 | } //stream.Next() |
678 | // } // check on event type | |
679 | // else{ | |
680 | // AliDebug(1,Form("Skipping non-physics event for QA -> event type %d \n", rawReader->GetType())); | |
681 | // } | |
92664bc8 | 682 | // |
683 | IncEvCountCycleRaws(); | |
684 | IncEvCountTotalRaws(); | |
685 | // | |
44ed7a66 | 686 | } |
687 | ||
f5e4ee59 | 688 | //____________________________________________________________________________ |
689 | void AliZDCQADataMakerRec::MakeRecPoints(TTree * clustersTree) | |
690 | { | |
691 | // Filling QA histos from RecPoints | |
692 | ||
693 | TBranch *branch = clustersTree->GetBranch("ZDC"); | |
694 | if(!branch){ | |
695 | AliError("Can't get the ZDC branch for rec points!"); | |
696 | return; | |
697 | } | |
698 | ||
699 | if(!GetRecPointsData(0)) InitRecPoints() ; | |
700 | ||
701 | Float_t sum_ZNC=0., sum_ZNA=0., sum_ZPC=0., sum_ZPA=0.; | |
702 | Float_t sumQ_ZNC=0., sumQ_ZNA=0., sumQ_ZPC=0., sumQ_ZPA=0.; | |
703 | ||
704 | AliZDCReco reco; | |
705 | AliZDCReco* preco = &reco; | |
706 | clustersTree->SetBranchAddress("ZDC", &preco); | |
707 | ||
708 | clustersTree->GetEntry(0); | |
709 | for(Int_t i=0; i<5; i++){ | |
710 | sum_ZNC += reco.GetZN1HREnTow(i); | |
711 | sum_ZPC += reco.GetZN2HREnTow(i); | |
712 | sum_ZNA += reco.GetZP1HREnTow(i); | |
713 | sum_ZPA += reco.GetZP2HREnTow(i); | |
714 | if(i==0){ | |
92664bc8 | 715 | FillRecPointsData(8,reco.GetZN1HREnTow(i)); |
716 | FillRecPointsData(9,reco.GetZN2HREnTow(i)); | |
717 | FillRecPointsData(10,reco.GetZP1HREnTow(i)); | |
718 | FillRecPointsData(11,reco.GetZP2HREnTow(i)); | |
f5e4ee59 | 719 | } |
720 | else{ | |
721 | sumQ_ZNC += reco.GetZN1HREnTow(i); | |
722 | sumQ_ZPC += reco.GetZN2HREnTow(i); | |
723 | sumQ_ZNA += reco.GetZP1HREnTow(i); | |
724 | sumQ_ZPA += reco.GetZP2HREnTow(i); | |
725 | } | |
726 | } | |
727 | ||
92664bc8 | 728 | FillRecPointsData(0,sum_ZNC); |
729 | FillRecPointsData(1,sum_ZNA); | |
730 | FillRecPointsData(2,sum_ZPC); | |
731 | FillRecPointsData(3,sum_ZPA); | |
f5e4ee59 | 732 | // |
92664bc8 | 733 | FillRecPointsData(4,sumQ_ZNC); |
734 | FillRecPointsData(5,sumQ_ZNA); | |
735 | FillRecPointsData(6,sumQ_ZPC); | |
736 | FillRecPointsData(7,sumQ_ZPA); | |
737 | // | |
738 | IncEvCountCycleRecPoints(); | |
739 | IncEvCountTotalRecPoints(); | |
740 | // | |
f5e4ee59 | 741 | } |
742 | ||
075a0e70 | 743 | //____________________________________________________________________________ |
744 | void AliZDCQADataMakerRec::MakeESDs(AliESDEvent * esd) | |
745 | { | |
746 | // make QA data from ESDs | |
747 | // | |
eca4fa66 | 748 | |
749 | // Check id histograms already created for this Event Specie | |
796c8b58 | 750 | if(!GetESDsData(0)) InitESDs() ; |
eca4fa66 | 751 | |
075a0e70 | 752 | AliESDZDC * zdcESD = esd->GetESDZDC(); |
753 | // | |
92664bc8 | 754 | /*TString beamType = esd->GetBeamType(); |
789b8a8d | 755 | Double_t centr_ZNC[2]={999.,999}, centr_ZNA[2]={999.,999}; |
b72460a5 | 756 | if(((beamType.CompareTo("pp"))==0) || ((beamType.CompareTo("p-p"))==0) |
757 | ||((beamType.CompareTo("PP"))==0) || ((beamType.CompareTo("P-P"))==0)){ | |
789b8a8d | 758 | zdcESD->GetZNCentroidInpp(centr_ZNC, centr_ZNA); |
b72460a5 | 759 | } |
2d9c70ab | 760 | else if((beamType.CompareTo("A-A")) == 0 || (beamType.CompareTo("Pb-Pb")) == 0){ |
789b8a8d | 761 | Float_t beamEne = esd->GetBeamEnergy(); |
762 | zdcESD->GetZNCentroidInPbPb(beamEne, centr_ZNC, centr_ZNA); | |
b72460a5 | 763 | } |
c473b43d | 764 | else printf("\n WARNING!!! AliZDCQADataMakerRec::MakeESDs: can't calculate centroids for beam type: %s\n\n",beamType.Data()); |
92664bc8 | 765 | FillESDsData(0,centr_ZNC[0], centr_ZNC[1]); |
766 | FillESDsData(1,centr_ZNA[0], centr_ZNA[1]);*/ | |
767 | ||
768 | FillESDsData(0,esd->GetZDCN1Energy()); | |
769 | FillESDsData(1,esd->GetZDCN2Energy()); | |
770 | FillESDsData(2,esd->GetZDCP1Energy()); | |
771 | FillESDsData(3,esd->GetZDCP2Energy()); | |
772 | FillESDsData(4,esd->GetZDCEMEnergy(0)); | |
773 | FillESDsData(5,esd->GetZDCEMEnergy(1)); | |
075a0e70 | 774 | // |
fdc38bb2 | 775 | Double_t sumQZNC=0., sumQZPC=0., sumQZNA=0., sumQZPA=0.; |
92664bc8 | 776 | //Double_t sumQZNC_lg=0., sumQZPC_lg=0., sumQZNA_lg=0., sumQZPA_lg=0.; |
075a0e70 | 777 | // |
fdc38bb2 | 778 | const Double_t *towZNC, *towZPC, *towZNA, *towZPA; |
92664bc8 | 779 | //const Double_t *towZNC_lg, *towZPC_lg, *towZNA_lg, *towZPA_lg; |
075a0e70 | 780 | // |
fdc38bb2 | 781 | towZNC = zdcESD->GetZN1TowerEnergy(); |
782 | towZPC = zdcESD->GetZP1TowerEnergy(); | |
783 | towZNA = zdcESD->GetZN2TowerEnergy(); | |
784 | towZPA = zdcESD->GetZP2TowerEnergy(); | |
075a0e70 | 785 | // |
92664bc8 | 786 | /*towZNC_lg = zdcESD->GetZN1TowerEnergyLR(); |
fdc38bb2 | 787 | towZPC_lg = zdcESD->GetZP1TowerEnergyLR(); |
788 | towZNA_lg = zdcESD->GetZN2TowerEnergyLR(); | |
92664bc8 | 789 | towZPA_lg = zdcESD->GetZP2TowerEnergyLR();*/ |
075a0e70 | 790 | // |
791 | for(Int_t i=0; i<5; i++){ | |
792 | if(i==0){ | |
92664bc8 | 793 | FillESDsData(10,towZNC[i]); |
794 | FillESDsData(11,towZNA[i]); | |
795 | FillESDsData(12,towZPC[i]); | |
796 | FillESDsData(13,towZPA[i]); | |
075a0e70 | 797 | } |
798 | else{ | |
fdc38bb2 | 799 | sumQZNC += towZNC[i]; |
800 | sumQZPC += towZPC[i]; | |
801 | sumQZNA += towZNA[i]; | |
802 | sumQZPA += towZPA[i]; | |
075a0e70 | 803 | } |
804 | } | |
92664bc8 | 805 | FillESDsData(6,sumQZNC); |
806 | FillESDsData(7,sumQZNA); | |
807 | FillESDsData(8,sumQZPC); | |
808 | FillESDsData(9,sumQZPA); | |
809 | // | |
810 | IncEvCountCycleESDs(); | |
811 | IncEvCountTotalESDs(); | |
075a0e70 | 812 | // |
075a0e70 | 813 | } |
814 | ||
815 | //____________________________________________________________________________ | |
816 | void AliZDCQADataMakerRec::StartOfDetectorCycle() | |
817 | { | |
818 | //Detector specific actions at start of cycle | |
796c8b58 | 819 | |
820 | fPedCalibData = GetPedCalibData(); | |
075a0e70 | 821 | |
822 | } | |
823 | ||
824 | //____________________________________________________________________________ | |
4e25ac79 | 825 | void AliZDCQADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray ** list) |
075a0e70 | 826 | { |
827 | //Detector specific actions at end of cycle | |
828 | // do the QA checking | |
92664bc8 | 829 | // |
830 | ResetEventTrigClasses(); | |
831 | for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { // RS: loop over event types | |
832 | // | |
833 | if (!IsValidEventSpecie(specie, list)) continue; | |
834 | SetEventSpecie(AliRecoParam::ConvertIndex(specie)); | |
835 | // | |
836 | for (int itc=-1;itc<GetNTrigClasses();itc++) { // RS: loop over eventual clones per trigger class | |
837 | // | |
df7e8023 | 838 | if(task == AliQAv1::kRAWS) { |
839 | TH1F* h14 = dynamic_cast<TH1F*> (GetRawsData(14, itc)); | |
840 | TH1F* h15 = dynamic_cast<TH1F*> (GetRawsData(15, itc)); | |
841 | TH1F* h16 = dynamic_cast<TH1F*> (GetRawsData(16, itc)); | |
842 | TH1F* h17 = dynamic_cast<TH1F*> (GetRawsData(17, itc)); | |
d992ff39 | 843 | TH1F* h18 = dynamic_cast<TH1F*> (GetRawsData(18, itc)); |
844 | TH1F* h19 = dynamic_cast<TH1F*> (GetRawsData(19, itc)); | |
df7e8023 | 845 | TProfile* h20 = dynamic_cast<TProfile*> (GetRawsData(20, itc)); |
846 | //TProfile* h21 = dynamic_cast<TProfile*> (GetRawsData(21, itc)); | |
847 | TH1F* h22 = dynamic_cast<TH1F*> (GetRawsData(22, itc)); | |
848 | TH1F* h23 = dynamic_cast<TH1F*> (GetRawsData(23, itc)); | |
849 | TH2F* h24 = dynamic_cast<TH2F*> (GetRawsData(24, itc)); | |
850 | TH2F* h25 = dynamic_cast<TH2F*> (GetRawsData(25, itc)); | |
851 | TH2F* h26 = dynamic_cast<TH2F*> (GetRawsData(26, itc)); | |
852 | if(!h20){ | |
853 | AliWarning("AliZDCQADataMakerRec -> RAW ADC histo not found!"); | |
92664bc8 | 854 | AliWarning(Form("for specie %s and trigger class %s", |
855 | AliRecoParam::GetEventSpecieName(specie), AliQADataMaker::GetTrigClassName(itc))); | |
856 | } | |
857 | else{ | |
eca8df18 | 858 | if(h22){ |
df7e8023 | 859 | |
eca8df18 | 860 | for(Int_t ibin=1; ibin<=h20->GetNbinsX(); ibin++){ |
861 | h22->SetBinContent(ibin, h20->GetBinContent(ibin)); | |
862 | h22->SetBinError(ibin, h20->GetBinError(ibin)); | |
863 | } | |
864 | h22->SetLineColor(kBlue+1); h22->SetLineWidth(2); | |
92664bc8 | 865 | } |
eca8df18 | 866 | else printf("Warning: Raw ADC QA histo not found \n\n"); |
df7e8023 | 867 | } |
868 | if(!h14 || !h15 || !h16 || !h17 || !h18 || !h19){ | |
869 | AliWarning("AliZDCQADataMakerRec -> RAW TDC histos not found!"); | |
870 | AliWarning(Form("for specie %s and trigger class %s", | |
871 | AliRecoParam::GetEventSpecieName(specie), AliQADataMaker::GetTrigClassName(itc))); | |
872 | } | |
873 | else{ | |
874 | /*for(Int_t ibin=1; ibin<=h21->GetNbinsX(); ibin++){ | |
875 | printf(" bin %d TDC %f\n",ibin, h21->GetBinContent(ibin)); | |
876 | h23->SetBinContent(ibin, h21->GetBinContent(ibin)); | |
877 | h23->SetBinError(ibin, h21->GetBinError(ibin)); | |
878 | }*/ | |
eca8df18 | 879 | if(h23){ |
880 | h23->SetBinContent(1, h14->GetMean()); | |
881 | h23->SetBinError(1, h14->GetRMS()); | |
882 | h23->SetBinContent(2, h15->GetMean()); | |
883 | h23->SetBinError(2, h15->GetRMS()); | |
884 | h23->SetBinContent(3, h16->GetMean()); | |
885 | h23->SetBinError(3, h16->GetRMS()); | |
886 | h23->SetBinContent(4, h17->GetMean()); | |
887 | h23->SetBinError(4, h17->GetRMS()); | |
888 | h23->SetBinContent(5, h18->GetMean()); | |
889 | h23->SetBinError(5, h18->GetRMS()); | |
890 | h23->SetBinContent(6, h19->GetMean()); | |
891 | h23->SetBinError(6, h19->GetRMS()); | |
892 | // | |
be7fc6f8 | 893 | h23->SetLineColor(kAzure+6); |
894 | h23->SetLineWidth(2); | |
eca8df18 | 895 | } |
896 | else printf(" Warning: Raw TDC QA histo not found\n\n"); | |
4998d47e | 897 | } |
df7e8023 | 898 | if(!h25 || !h26){ |
899 | AliWarning("AliZDCQADataMakerRec -> RAW centroid histos not found!"); | |
4998d47e | 900 | AliWarning(Form("for specie %s and trigger class %s", |
901 | AliRecoParam::GetEventSpecieName(specie), AliQADataMaker::GetTrigClassName(itc))); | |
902 | } | |
903 | else{ | |
df7e8023 | 904 | h25->SetMarkerColor(kPink-2); |
905 | h26->SetMarkerColor(kAzure-2); | |
4998d47e | 906 | } |
df7e8023 | 907 | if(!h24) { |
908 | AliWarning("AliZDCQADataMakerRec -> RAW debunching histo not found!"); | |
4998d47e | 909 | AliWarning(Form("for specie %s and trigger class %s", |
910 | AliRecoParam::GetEventSpecieName(specie), AliQADataMaker::GetTrigClassName(itc))); | |
92664bc8 | 911 | } |
df7e8023 | 912 | else h24->SetMarkerColor(kAzure); |
92664bc8 | 913 | } |
914 | } // loop over t | |
915 | } // loop over species | |
d8fa3de2 | 916 | |
4e25ac79 | 917 | AliQAChecker::Instance()->Run(AliQAv1::kZDC, task, list) ; |
075a0e70 | 918 | } |