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