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