]>
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 | |
4998d47e | 199 | TH2F *hTimeZDC = new TH2F("hTimeZDC", "ZDC timing;Z_{vertex}/c (ns);time (ns)", 60,-30.,30.,120,-60,-60); |
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; | |
891ddd89 | 409 | Float_t zncTDC[10], zpcTDC[10], zem1TDC[10], zem2TDC[10], znaTDC[10], zpaTDC[10]; |
08e3bee4 | 410 | Float_t zncSumTDC[10], znaSumTDC[10]; |
193f9a91 | 411 | for(Int_t i=0; i<10; i++){ |
08e3bee4 | 412 | zncTDC[i]=zpcTDC[i]=zem1TDC[i]=zem2TDC[i]=znaTDC[i]=zpaTDC[i]=zncSumTDC[i]=znaSumTDC[i]=-999.; |
193f9a91 | 413 | } |
f33cb8ca | 414 | Float_t tdcGate=-999., l0=-999.; |
891ddd89 | 415 | Int_t iMultZNCTDC=0, iMultZPCTDC=0, iMultZEM1TDC=0, iMultZEM2TDC=0, iMultZNATDC=0, iMultZPATDC=0; |
08e3bee4 | 416 | Int_t iMultTDCC=0, iMultTDCA=0; |
891ddd89 | 417 | |
418 | const Float_t x[4] = {-1.75, 1.75, -1.75, 1.75}; | |
419 | const Float_t y[4] = {-1.75, -1.75, 1.75, 1.75}; | |
420 | const Float_t alpha=0.5; | |
421 | Float_t numXZNC=0., numYZNC=0., denZNC=0., wZNC=0.; | |
422 | Float_t numXZNA=0., numYZNA=0., denZNA=0., wZNA=0.; | |
193f9a91 | 423 | |
01c49108 | 424 | rawReader->Reset(); |
d8fa3de2 | 425 | AliZDCRawStream stream(rawReader); |
426 | while(stream.Next()){ | |
01c49108 | 427 | |
d8fa3de2 | 428 | if(stream.IsADCDataWord() && |
429 | (stream.GetADCModule()==0 || stream.GetADCModule()==1)){ | |
796c8b58 | 430 | |
d8fa3de2 | 431 | Int_t det = stream.GetSector(0); |
432 | Int_t quad = stream.GetSector(1); | |
433 | Int_t gain = stream.GetADCGain(); | |
434 | Int_t pedindex=0; | |
435 | ||
436 | // Stuff for pedestal subtraction | |
437 | if(quad != 5){ // ZDCs (not reference PTMs) | |
4998d47e | 438 | Float_t rawVal=-99., pedSubVal=-99.; |
d8fa3de2 | 439 | if(det == 1){ |
440 | pedindex = quad; | |
441 | if(gain == 0){ | |
4998d47e | 442 | rawVal = (Float_t) (stream.GetADCValue()); |
443 | pedSubVal = (Float_t) (rawVal-meanPed[pedindex]); | |
d8fa3de2 | 444 | zncSignal += pedSubVal; |
445 | isZNCFired = kTRUE; | |
891ddd89 | 446 | if(quad!=0){ |
447 | zncSumQ += pedSubVal; | |
4998d47e | 448 | if(pedSubVal>0.&& zncpmC>7.){ |
891ddd89 | 449 | wZNC = TMath::Power(pedSubVal, alpha); |
450 | numXZNC += x[quad-1]*wZNC; | |
451 | numYZNC += y[quad-1]*wZNC; | |
452 | denZNC += wZNC; | |
453 | } | |
454 | } | |
d8fa3de2 | 455 | else{ |
456 | zncpmC = pedSubVal; | |
92664bc8 | 457 | FillRawsData(6,zncpmC); |
d8fa3de2 | 458 | } |
a633806a | 459 | indZNC++; |
891ddd89 | 460 | |
92664bc8 | 461 | FillRawsData(16, pedindex, pedSubVal); |
d8fa3de2 | 462 | } |
463 | } | |
464 | else if(det == 2){ | |
465 | pedindex = quad+5; | |
466 | if(gain == 0){ | |
4998d47e | 467 | rawVal = (Float_t) (stream.GetADCValue()); |
468 | pedSubVal = (Float_t) (rawVal-meanPed[pedindex]); | |
d8fa3de2 | 469 | zpcSignal += pedSubVal; |
470 | isZPCFired = kTRUE; | |
471 | if(quad!=0) zpcSumQ += pedSubVal; | |
472 | else{ | |
473 | zpcpmC = pedSubVal; | |
92664bc8 | 474 | FillRawsData(8,zpcpmC); |
d8fa3de2 | 475 | } |
a633806a | 476 | indZPC++; |
891ddd89 | 477 | |
92664bc8 | 478 | FillRawsData(16, pedindex, pedSubVal); |
d8fa3de2 | 479 | } |
480 | } | |
481 | else if(det == 3){ | |
482 | pedindex = quad+9; | |
483 | if(quad==1){ | |
484 | if(gain == 0){ | |
4998d47e | 485 | rawVal = (Float_t) (stream.GetADCValue()); |
486 | pedSubVal = (Float_t) (rawVal-meanPed[pedindex]); | |
92664bc8 | 487 | FillRawsData(4,pedSubVal); |
488 | FillRawsData(16,pedindex, pedSubVal); | |
d8fa3de2 | 489 | } |
490 | } | |
491 | else if(quad==2){ | |
492 | if(gain == 0){ | |
4998d47e | 493 | rawVal = (Float_t) (stream.GetADCValue()); |
494 | pedSubVal = (Float_t) (rawVal-meanPed[pedindex]); | |
92664bc8 | 495 | FillRawsData(5,pedSubVal); |
496 | FillRawsData(16,pedindex, pedSubVal); | |
d8fa3de2 | 497 | } |
498 | } | |
499 | } | |
500 | else if(det == 4){ | |
501 | pedindex = quad+12; | |
502 | if(gain == 0){ | |
4998d47e | 503 | rawVal = (Float_t) (stream.GetADCValue()); |
504 | pedSubVal = (Float_t) (rawVal-meanPed[pedindex]); | |
d8fa3de2 | 505 | znaSignal += pedSubVal; |
506 | isZNAFired = kTRUE; | |
891ddd89 | 507 | if(quad!=0){ |
508 | znaSumQ += pedSubVal; | |
4998d47e | 509 | if(pedSubVal>0.&& znapmC>7.) { |
891ddd89 | 510 | wZNA = TMath::Power(pedSubVal, alpha); |
511 | numXZNA += x[quad-1]*wZNA; | |
512 | numYZNA += y[quad-1]*wZNA; | |
513 | denZNA += wZNA; | |
514 | } | |
515 | } | |
d8fa3de2 | 516 | else{ |
517 | znapmC = pedSubVal; | |
92664bc8 | 518 | FillRawsData(7,znapmC); |
d8fa3de2 | 519 | } |
a633806a | 520 | indZNA++; |
891ddd89 | 521 | |
92664bc8 | 522 | FillRawsData(16,pedindex, pedSubVal); |
d8fa3de2 | 523 | } |
524 | } | |
525 | else if(det == 5){ | |
526 | pedindex = quad+17; | |
527 | if(gain == 0){ | |
4998d47e | 528 | rawVal = (Float_t) (stream.GetADCValue()); |
529 | pedSubVal = (Float_t) (rawVal-meanPed[pedindex]); | |
d8fa3de2 | 530 | zpaSignal += pedSubVal; |
531 | isZPAFired = kTRUE; | |
532 | if(quad!=0) zpaSumQ += pedSubVal; | |
533 | else{ | |
534 | zpapmC = pedSubVal; | |
92664bc8 | 535 | FillRawsData(9,zpapmC); |
d8fa3de2 | 536 | } |
a633806a | 537 | indZPA++; |
891ddd89 | 538 | |
92664bc8 | 539 | FillRawsData(16,pedindex, pedSubVal); |
d8fa3de2 | 540 | } |
541 | } | |
891ddd89 | 542 | |
543 | } | |
544 | ||
01c49108 | 545 | if(isZNCFired && indZNC==5){ |
92664bc8 | 546 | FillRawsData(0,zncSignal); |
547 | FillRawsData(10,zncSumQ); | |
891ddd89 | 548 | // |
549 | Float_t xZNC, yZNC; | |
550 | if(denZNC!=0){ | |
551 | xZNC = numXZNC/denZNC; | |
552 | yZNC = numYZNC/denZNC; | |
553 | } | |
554 | else xZNC = yZNC = 999.; | |
92664bc8 | 555 | FillRawsData(20,xZNC, yZNC); |
d8fa3de2 | 556 | } |
01c49108 | 557 | if(isZPCFired && indZPC==5){ |
92664bc8 | 558 | FillRawsData(2,zpcSignal); |
559 | FillRawsData(12,zpcSumQ); | |
d8fa3de2 | 560 | } |
01c49108 | 561 | if(isZNAFired && indZNA==5){ |
92664bc8 | 562 | FillRawsData(1,znaSignal); |
563 | FillRawsData(11,znaSumQ); | |
891ddd89 | 564 | // |
565 | Float_t xZNA, yZNA; | |
566 | if(denZNA!=0){ | |
567 | xZNA = numXZNA/denZNA; | |
568 | yZNA = numYZNA/denZNA; | |
569 | } | |
570 | else xZNA = yZNA = 999.; | |
92664bc8 | 571 | FillRawsData(21,xZNA, yZNA); |
d8fa3de2 | 572 | } |
01c49108 | 573 | if(isZPAFired && indZPA==5){ |
92664bc8 | 574 | FillRawsData(3,zpaSignal); |
575 | FillRawsData(13,zpaSumQ); | |
d8fa3de2 | 576 | } |
01c49108 | 577 | |
578 | if(indZNC==5){ | |
579 | zncSignal = zncSumQ = zncpmC = 0; | |
580 | isZNCFired=kFALSE; indZNC=0; | |
581 | } | |
582 | if(indZPC==5){ | |
583 | zpcSignal = zpcSumQ = zpcpmC = 0; | |
584 | isZPCFired=kFALSE; indZPC=0; | |
585 | } | |
586 | if(indZNA==5){ | |
587 | znaSignal = znaSumQ = znapmC = 0; | |
588 | isZNAFired=kFALSE; indZNA=0; | |
589 | } | |
590 | if(indZPA==5){ | |
591 | zpaSignal = zpaSumQ = zpapmC = 0; | |
592 | isZPAFired=kFALSE; indZPA=0; | |
593 | } | |
891ddd89 | 594 | |
d8fa3de2 | 595 | } //IsADCDataWord && signal ADCs |
193f9a91 | 596 | else if(stream.IsZDCTDCDatum()){ |
891ddd89 | 597 | if(stream.GetChannel()==1){ |
f33cb8ca | 598 | zncTDC[iMultZNCTDC] = (0.025*stream.GetZDCTDCDatum()); |
891ddd89 | 599 | iMultZNCTDC++; |
600 | } | |
601 | else if(stream.GetChannel()==3){ | |
f33cb8ca | 602 | zpcTDC[iMultZPCTDC] = (0.025*stream.GetZDCTDCDatum()); |
193f9a91 | 603 | iMultZPCTDC++; |
604 | } | |
891ddd89 | 605 | else if(stream.GetChannel()==5){ |
f33cb8ca | 606 | znaTDC[iMultZNATDC] = (0.025*stream.GetZDCTDCDatum()); |
891ddd89 | 607 | iMultZNATDC++; |
608 | } | |
609 | else if(stream.GetChannel()==7){ | |
f33cb8ca | 610 | zpaTDC[iMultZPATDC] = (0.025*stream.GetZDCTDCDatum()); |
891ddd89 | 611 | iMultZPATDC++; |
612 | } | |
193f9a91 | 613 | else if(stream.GetChannel()==8){ |
f33cb8ca | 614 | zem1TDC[iMultZEM1TDC] = (0.025*stream.GetZDCTDCDatum()); |
891ddd89 | 615 | iMultZEM1TDC++; |
616 | } | |
617 | else if(stream.GetChannel()==9){ | |
f33cb8ca | 618 | zem2TDC[iMultZEM2TDC] = (0.025*stream.GetZDCTDCDatum()); |
891ddd89 | 619 | iMultZEM2TDC++; |
193f9a91 | 620 | } |
08e3bee4 | 621 | else if(stream.GetChannel()==10){ |
08ecfe07 | 622 | zncSumTDC[iMultTDCC] = (0.025*stream.GetZDCTDCDatum()); |
08e3bee4 | 623 | iMultTDCC++; |
624 | } | |
625 | else if(stream.GetChannel()==12){ | |
08ecfe07 | 626 | znaSumTDC[iMultTDCA] = (0.025*stream.GetZDCTDCDatum()); |
08e3bee4 | 627 | iMultTDCA++; |
628 | } | |
f33cb8ca | 629 | else if(stream.GetChannel()==14) tdcGate = (0.025*stream.GetZDCTDCDatum()); |
630 | else if(stream.GetChannel()==15) l0 = (0.025*stream.GetZDCTDCDatum()); | |
193f9a91 | 631 | |
17ffe44a | 632 | if(stream.GetChannel()==16 && tdcGate!=-999.){ |
193f9a91 | 633 | for(Int_t iHit=0; iHit<10; iHit++){ |
891ddd89 | 634 | if(zncTDC[iHit]!=-999.){ |
f33cb8ca | 635 | if(zncTDC[iHit]-tdcGate>-340. && zncTDC[iHit]-tdcGate<-300.) |
92664bc8 | 636 | FillRawsData(17,1, zncTDC[iHit]-tdcGate); |
891ddd89 | 637 | } |
193f9a91 | 638 | if(zpcTDC[iHit]!=-999.){ |
17ffe44a | 639 | Float_t diffZPC = zpcTDC[iHit]-tdcGate; |
92664bc8 | 640 | FillRawsData(15,diffZPC); |
641 | if(diffZPC>-340. && diffZPC<-300.) FillRawsData(17,2, diffZPC); | |
891ddd89 | 642 | } |
643 | if(znaTDC[iHit]!=-999.){ | |
f33cb8ca | 644 | if(znaTDC[iHit]-tdcGate>-340. && znaTDC[iHit]-tdcGate<-300.) |
92664bc8 | 645 | FillRawsData(17,3, znaTDC[iHit]-tdcGate); |
891ddd89 | 646 | } |
647 | if(zpaTDC[iHit]!=-999.){ | |
f33cb8ca | 648 | if(zpaTDC[iHit]-tdcGate>-340. && zpaTDC[iHit]-tdcGate<-300.) |
92664bc8 | 649 | FillRawsData(17,4, zpaTDC[iHit]-tdcGate); |
193f9a91 | 650 | } |
651 | if(zem1TDC[iHit]!=-999.){ | |
17ffe44a | 652 | Float_t diffZEM1 = zem1TDC[iHit]-tdcGate; |
92664bc8 | 653 | FillRawsData(14,diffZEM1); |
654 | if(diffZEM1>-340. && diffZEM1<-300.) FillRawsData(17,5, diffZEM1); | |
193f9a91 | 655 | } |
891ddd89 | 656 | if(zem2TDC[iHit]!=-999.){ |
f33cb8ca | 657 | if(zem2TDC[iHit]-tdcGate>-340. && zem2TDC[iHit]-tdcGate<-300.) |
92664bc8 | 658 | FillRawsData(17,6, zem2TDC[iHit]-tdcGate); |
891ddd89 | 659 | } |
08e3bee4 | 660 | if(zncSumTDC[iHit]!=-999.){ |
f33cb8ca | 661 | Float_t tdcC = zncSumTDC[iHit]-l0; |
08e3bee4 | 662 | if(znaSumTDC[iHit]!=-999.){ |
f33cb8ca | 663 | Float_t tdcA = znaSumTDC[iHit]-l0; |
664 | //if (((tdcC-tdcA-refDelta)*(tdcC-tdcA-refDelta)/(sigmaDelta*sigmaDelta) + | |
665 | //(tdcC+tdcA-refSum)*(tdcC+tdcA-refSum)/(sigmaSum*sigmaSum))< 1.0) | |
92664bc8 | 666 | FillRawsData(22,tdcC-tdcA,tdcC+tdcA); |
08e3bee4 | 667 | |
668 | } | |
669 | } | |
193f9a91 | 670 | } |
671 | // | |
17ffe44a | 672 | tdcGate = -999.; |
193f9a91 | 673 | for(Int_t i=0; i<10; i++){ |
f33cb8ca | 674 | zncTDC[i] = zpcTDC[i] = zem1TDC[i] = zem2TDC[i] = znaTDC[i] = zpaTDC[i] = -999.; |
675 | zncSumTDC[i] = znaSumTDC[i] = -999.; | |
193f9a91 | 676 | } |
677 | } | |
678 | } | |
796c8b58 | 679 | |
d8fa3de2 | 680 | } //stream.Next() |
681 | // } // check on event type | |
682 | // else{ | |
683 | // AliDebug(1,Form("Skipping non-physics event for QA -> event type %d \n", rawReader->GetType())); | |
684 | // } | |
92664bc8 | 685 | // |
686 | IncEvCountCycleRaws(); | |
687 | IncEvCountTotalRaws(); | |
688 | // | |
44ed7a66 | 689 | } |
690 | ||
f5e4ee59 | 691 | //____________________________________________________________________________ |
692 | void AliZDCQADataMakerRec::MakeRecPoints(TTree * clustersTree) | |
693 | { | |
694 | // Filling QA histos from RecPoints | |
695 | ||
696 | TBranch *branch = clustersTree->GetBranch("ZDC"); | |
697 | if(!branch){ | |
698 | AliError("Can't get the ZDC branch for rec points!"); | |
699 | return; | |
700 | } | |
701 | ||
702 | if(!GetRecPointsData(0)) InitRecPoints() ; | |
703 | ||
704 | Float_t sum_ZNC=0., sum_ZNA=0., sum_ZPC=0., sum_ZPA=0.; | |
705 | Float_t sumQ_ZNC=0., sumQ_ZNA=0., sumQ_ZPC=0., sumQ_ZPA=0.; | |
706 | ||
707 | AliZDCReco reco; | |
708 | AliZDCReco* preco = &reco; | |
709 | clustersTree->SetBranchAddress("ZDC", &preco); | |
710 | ||
711 | clustersTree->GetEntry(0); | |
712 | for(Int_t i=0; i<5; i++){ | |
713 | sum_ZNC += reco.GetZN1HREnTow(i); | |
714 | sum_ZPC += reco.GetZN2HREnTow(i); | |
715 | sum_ZNA += reco.GetZP1HREnTow(i); | |
716 | sum_ZPA += reco.GetZP2HREnTow(i); | |
717 | if(i==0){ | |
92664bc8 | 718 | FillRecPointsData(8,reco.GetZN1HREnTow(i)); |
719 | FillRecPointsData(9,reco.GetZN2HREnTow(i)); | |
720 | FillRecPointsData(10,reco.GetZP1HREnTow(i)); | |
721 | FillRecPointsData(11,reco.GetZP2HREnTow(i)); | |
f5e4ee59 | 722 | } |
723 | else{ | |
724 | sumQ_ZNC += reco.GetZN1HREnTow(i); | |
725 | sumQ_ZPC += reco.GetZN2HREnTow(i); | |
726 | sumQ_ZNA += reco.GetZP1HREnTow(i); | |
727 | sumQ_ZPA += reco.GetZP2HREnTow(i); | |
728 | } | |
729 | } | |
730 | ||
92664bc8 | 731 | FillRecPointsData(0,sum_ZNC); |
732 | FillRecPointsData(1,sum_ZNA); | |
733 | FillRecPointsData(2,sum_ZPC); | |
734 | FillRecPointsData(3,sum_ZPA); | |
f5e4ee59 | 735 | // |
92664bc8 | 736 | FillRecPointsData(4,sumQ_ZNC); |
737 | FillRecPointsData(5,sumQ_ZNA); | |
738 | FillRecPointsData(6,sumQ_ZPC); | |
739 | FillRecPointsData(7,sumQ_ZPA); | |
740 | // | |
741 | IncEvCountCycleRecPoints(); | |
742 | IncEvCountTotalRecPoints(); | |
743 | // | |
f5e4ee59 | 744 | } |
745 | ||
075a0e70 | 746 | //____________________________________________________________________________ |
747 | void AliZDCQADataMakerRec::MakeESDs(AliESDEvent * esd) | |
748 | { | |
749 | // make QA data from ESDs | |
750 | // | |
eca4fa66 | 751 | |
752 | // Check id histograms already created for this Event Specie | |
796c8b58 | 753 | if(!GetESDsData(0)) InitESDs() ; |
eca4fa66 | 754 | |
075a0e70 | 755 | AliESDZDC * zdcESD = esd->GetESDZDC(); |
756 | // | |
92664bc8 | 757 | /*TString beamType = esd->GetBeamType(); |
789b8a8d | 758 | Double_t centr_ZNC[2]={999.,999}, centr_ZNA[2]={999.,999}; |
b72460a5 | 759 | if(((beamType.CompareTo("pp"))==0) || ((beamType.CompareTo("p-p"))==0) |
760 | ||((beamType.CompareTo("PP"))==0) || ((beamType.CompareTo("P-P"))==0)){ | |
789b8a8d | 761 | zdcESD->GetZNCentroidInpp(centr_ZNC, centr_ZNA); |
b72460a5 | 762 | } |
2d9c70ab | 763 | else if((beamType.CompareTo("A-A")) == 0 || (beamType.CompareTo("Pb-Pb")) == 0){ |
789b8a8d | 764 | Float_t beamEne = esd->GetBeamEnergy(); |
765 | zdcESD->GetZNCentroidInPbPb(beamEne, centr_ZNC, centr_ZNA); | |
b72460a5 | 766 | } |
c473b43d | 767 | else printf("\n WARNING!!! AliZDCQADataMakerRec::MakeESDs: can't calculate centroids for beam type: %s\n\n",beamType.Data()); |
92664bc8 | 768 | FillESDsData(0,centr_ZNC[0], centr_ZNC[1]); |
769 | FillESDsData(1,centr_ZNA[0], centr_ZNA[1]);*/ | |
770 | ||
771 | FillESDsData(0,esd->GetZDCN1Energy()); | |
772 | FillESDsData(1,esd->GetZDCN2Energy()); | |
773 | FillESDsData(2,esd->GetZDCP1Energy()); | |
774 | FillESDsData(3,esd->GetZDCP2Energy()); | |
775 | FillESDsData(4,esd->GetZDCEMEnergy(0)); | |
776 | FillESDsData(5,esd->GetZDCEMEnergy(1)); | |
075a0e70 | 777 | // |
fdc38bb2 | 778 | Double_t sumQZNC=0., sumQZPC=0., sumQZNA=0., sumQZPA=0.; |
92664bc8 | 779 | //Double_t sumQZNC_lg=0., sumQZPC_lg=0., sumQZNA_lg=0., sumQZPA_lg=0.; |
075a0e70 | 780 | // |
fdc38bb2 | 781 | const Double_t *towZNC, *towZPC, *towZNA, *towZPA; |
92664bc8 | 782 | //const Double_t *towZNC_lg, *towZPC_lg, *towZNA_lg, *towZPA_lg; |
075a0e70 | 783 | // |
fdc38bb2 | 784 | towZNC = zdcESD->GetZN1TowerEnergy(); |
785 | towZPC = zdcESD->GetZP1TowerEnergy(); | |
786 | towZNA = zdcESD->GetZN2TowerEnergy(); | |
787 | towZPA = zdcESD->GetZP2TowerEnergy(); | |
075a0e70 | 788 | // |
92664bc8 | 789 | /*towZNC_lg = zdcESD->GetZN1TowerEnergyLR(); |
fdc38bb2 | 790 | towZPC_lg = zdcESD->GetZP1TowerEnergyLR(); |
791 | towZNA_lg = zdcESD->GetZN2TowerEnergyLR(); | |
92664bc8 | 792 | towZPA_lg = zdcESD->GetZP2TowerEnergyLR();*/ |
075a0e70 | 793 | // |
794 | for(Int_t i=0; i<5; i++){ | |
795 | if(i==0){ | |
92664bc8 | 796 | FillESDsData(10,towZNC[i]); |
797 | FillESDsData(11,towZNA[i]); | |
798 | FillESDsData(12,towZPC[i]); | |
799 | FillESDsData(13,towZPA[i]); | |
075a0e70 | 800 | } |
801 | else{ | |
fdc38bb2 | 802 | sumQZNC += towZNC[i]; |
803 | sumQZPC += towZPC[i]; | |
804 | sumQZNA += towZNA[i]; | |
805 | sumQZPA += towZPA[i]; | |
075a0e70 | 806 | } |
807 | } | |
92664bc8 | 808 | FillESDsData(6,sumQZNC); |
809 | FillESDsData(7,sumQZNA); | |
810 | FillESDsData(8,sumQZPC); | |
811 | FillESDsData(9,sumQZPA); | |
812 | // | |
813 | IncEvCountCycleESDs(); | |
814 | IncEvCountTotalESDs(); | |
075a0e70 | 815 | // |
075a0e70 | 816 | } |
817 | ||
818 | //____________________________________________________________________________ | |
819 | void AliZDCQADataMakerRec::StartOfDetectorCycle() | |
820 | { | |
821 | //Detector specific actions at start of cycle | |
796c8b58 | 822 | |
823 | fPedCalibData = GetPedCalibData(); | |
075a0e70 | 824 | |
825 | } | |
826 | ||
827 | //____________________________________________________________________________ | |
4e25ac79 | 828 | void AliZDCQADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray ** list) |
075a0e70 | 829 | { |
830 | //Detector specific actions at end of cycle | |
831 | // do the QA checking | |
92664bc8 | 832 | // |
833 | ResetEventTrigClasses(); | |
834 | for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { // RS: loop over event types | |
835 | // | |
836 | if (!IsValidEventSpecie(specie, list)) continue; | |
837 | SetEventSpecie(AliRecoParam::ConvertIndex(specie)); | |
838 | // | |
839 | for (int itc=-1;itc<GetNTrigClasses();itc++) { // RS: loop over eventual clones per trigger class | |
840 | // | |
841 | if( task == AliQAv1::kRAWS) { | |
d992ff39 | 842 | TProfile* h16 = dynamic_cast<TProfile*> (GetRawsData(16, itc)); |
843 | TProfile* h17 = dynamic_cast<TProfile*> (GetRawsData(17, itc)); | |
844 | TH1F* h18 = dynamic_cast<TH1F*> (GetRawsData(18, itc)); | |
845 | TH1F* h19 = dynamic_cast<TH1F*> (GetRawsData(19, itc)); | |
846 | TH2F* h20 = dynamic_cast<TH2F*> (GetRawsData(20, itc)); | |
847 | TH2F* h21 = dynamic_cast<TH2F*> (GetRawsData(21, itc)); | |
848 | TH2F* h22 = dynamic_cast<TH2F*> (GetRawsData(22, itc)); | |
4998d47e | 849 | if (!h16 || !h17 || !h18 || !h19){ |
850 | AliWarning("AliZDCQADataMakerRec -> RAW histos 16||17||18||19 not found!"); | |
92664bc8 | 851 | AliWarning(Form("for specie %s and trigger class %s", |
852 | AliRecoParam::GetEventSpecieName(specie), AliQADataMaker::GetTrigClassName(itc))); | |
853 | } | |
854 | else{ | |
4998d47e | 855 | //h16->Draw(""); |
92664bc8 | 856 | for(Int_t ibin=1; ibin<=h16->GetNbinsX(); ibin++){ |
857 | h18->SetBinContent(ibin, h16->GetBinContent(ibin)); | |
858 | h18->SetBinError(ibin, h16->GetBinError(ibin)); | |
859 | } | |
860 | for(Int_t ibin=1; ibin<=h17->GetNbinsX(); ibin++){ | |
861 | h19->SetBinContent(ibin, h17->GetBinContent(ibin)); | |
862 | h19->SetBinError(ibin, h17->GetBinError(ibin)); | |
863 | } | |
864 | h18->SetLineColor(kBlue); h18->SetLineWidth(2); | |
865 | h19->SetLineColor(kAzure-3); h19->SetLineWidth(2); | |
4998d47e | 866 | } |
4dbf0196 | 867 | if(!h20 || !h21){ |
4998d47e | 868 | AliWarning("AliZDCQADataMakerRec -> RAW histos 20||21 not found!"); |
869 | AliWarning(Form("for specie %s and trigger class %s", | |
870 | AliRecoParam::GetEventSpecieName(specie), AliQADataMaker::GetTrigClassName(itc))); | |
871 | } | |
872 | else{ | |
873 | h20->SetMarkerColor(kPink+7); | |
874 | h21->SetMarkerColor(kBlue+2); | |
875 | } | |
876 | if(!h22) { | |
877 | AliWarning("AliZDCQADataMakerRec -> RAW histo 22 not found!"); | |
878 | AliWarning(Form("for specie %s and trigger class %s", | |
879 | AliRecoParam::GetEventSpecieName(specie), AliQADataMaker::GetTrigClassName(itc))); | |
92664bc8 | 880 | } |
4998d47e | 881 | else h22->SetMarkerColor(kAzure+7); |
92664bc8 | 882 | } |
883 | } // loop over t | |
884 | } // loop over species | |
d8fa3de2 | 885 | |
4e25ac79 | 886 | AliQAChecker::Instance()->Run(AliQAv1::kZDC, task, list) ; |
075a0e70 | 887 | } |