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