Forgotten removal of default ExB field
[u/mrichter/AliRoot.git] / VZERO / AliVZEROQADataMakerRec.cxx
CommitLineData
508b9fc0 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 **************************************************************************/
15
16
6bec7c7c 17// Produces the data needed to calculate the quality assurance
18// All data must be mergeable objects
19// Handles ESDs and Raws
20// Histos defined will be used for Raw Data control and monitoring
508b9fc0 21
22// --- ROOT system ---
23#include <TClonesArray.h>
24#include <TFile.h>
25#include <TH1F.h>
26#include <TH1I.h>
4da80b8c 27#include <TH2I.h>
9bd82f77 28#include <TH2D.h>
29#include <TGraph.h>
f81355e3 30#include <TParameter.h>
a8e23456 31#include <TTimeStamp.h>
508b9fc0 32
33// --- Standard library ---
34
35// --- AliRoot header files ---
36#include "AliESDEvent.h"
37#include "AliLog.h"
1e376713 38#include "AliCDBManager.h"
39#include "AliCDBStorage.h"
40#include "AliCDBEntry.h"
508b9fc0 41#include "AliVZEROQADataMakerRec.h"
42#include "AliQAChecker.h"
4da80b8c 43#include "AliRawReader.h"
508b9fc0 44#include "AliVZERORawStream.h"
5192f264 45#include "AliVZEROdigit.h"
508b9fc0 46#include "AliVZEROReconstructor.h"
a8e23456 47#include "AliVZEROTrending.h"
9bd82f77 48#include "event.h"
508b9fc0 49
50
51ClassImp(AliVZEROQADataMakerRec)
52
53//____________________________________________________________________________
54 AliVZEROQADataMakerRec::AliVZEROQADataMakerRec() :
4e25ac79 55 AliQADataMakerRec(AliQAv1::GetDetName(AliQAv1::kVZERO), "VZERO Quality Assurance Data Maker"),
9bd82f77 56 fCalibData(0x0),
a8e23456 57 fEvent(0), fNTotEvents(0), fNSubEvents(0), fTrendingUpdateEvent(0), fTrendingUpdateTime(0), fCycleStartTime(0), fCycleStopTime(0), fMonitorRate(0.)
1e376713 58
508b9fc0 59{
6bec7c7c 60 // Constructor
61
5379c4a3 62 AliDebug(AliQAv1::GetQADebugLevel(), "Construct VZERO QA Object");
a8e23456 63 for(Int_t i=0;i<8;i++){
64 fChargePerRing[i] = 0.;
65 fFlagPerRing[i] = 0.;
66 }
1e376713 67 for(Int_t i=0; i<64; i++){
68 fEven[i] = 0;
69 fOdd[i] = 0; }
70
71 for(Int_t i=0; i<128; i++){
6bec7c7c 72 fADCmean[i] = 0.0; }
508b9fc0 73}
74
75//____________________________________________________________________________
1e376713 76 AliVZEROQADataMakerRec::AliVZEROQADataMakerRec(const AliVZEROQADataMakerRec& qadm) :
77 AliQADataMakerRec(),
9bd82f77 78 fCalibData(0x0),
a8e23456 79 fEvent(0), fNTotEvents(0), fNSubEvents(0), fTrendingUpdateEvent(0), fTrendingUpdateTime(0), fCycleStartTime(0), fCycleStopTime(0), fMonitorRate(0.)
1e376713 80
508b9fc0 81{
6bec7c7c 82 // Copy constructor
83
1e376713 84 SetName((const char*)qadm.GetName()) ;
85 SetTitle((const char*)qadm.GetTitle());
508b9fc0 86}
87
88//__________________________________________________________________
89AliVZEROQADataMakerRec& AliVZEROQADataMakerRec::operator = (const AliVZEROQADataMakerRec& qadm )
90{
91 // Equal operator
6bec7c7c 92
508b9fc0 93 this->~AliVZEROQADataMakerRec();
94 new(this) AliVZEROQADataMakerRec(qadm);
95 return *this;
96}
1e376713 97
98//____________________________________________________________________________
99AliVZEROCalibData* AliVZEROQADataMakerRec::GetCalibData() const
100
101{
5f650de8 102 AliCDBManager *man = AliCDBManager::Instance();
6bec7c7c 103
5f650de8 104 AliCDBEntry *entry=0;
1e376713 105
5f650de8 106 entry = man->Get("VZERO/Calib/Data",fRun);
107 if(!entry){
108 AliWarning("Load of calibration data from default storage failed!");
109 AliWarning("Calibration data will be loaded from local storage ($ALICE_ROOT)");
110
111 man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
112 entry = man->Get("VZERO/Calib/Data",fRun);
113 }
114 // Retrieval of data in directory VZERO/Calib/Data:
1e376713 115
5f650de8 116 AliVZEROCalibData *calibdata = 0;
1e376713 117
5f650de8 118 if (entry) calibdata = (AliVZEROCalibData*) entry->GetObject();
119 if (!calibdata) AliFatal("No calibration data from calibration database !");
1e376713 120
5f650de8 121 return calibdata;
1e376713 122}
5f650de8 123
124
508b9fc0 125
126//____________________________________________________________________________
4e25ac79 127void AliVZEROQADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray ** list)
508b9fc0 128{
6bec7c7c 129 // Detector specific actions at end of cycle
130 // Does the QA checking
131
4e25ac79 132 AliQAChecker::Instance()->Run(AliQAv1::kVZERO, task, list) ;
a8e23456 133
134 if(task == AliQAv1::kRAWS){
135 TTimeStamp currentTime;
136 fCycleStopTime = currentTime.GetSec();
137 if(fCycleStopTime-fCycleStartTime>0.) fMonitorRate = fNTotEvents/(fCycleStopTime-fCycleStartTime);
138 //printf("%d event have been monitored -> Monitoring Rate = %f Hz\n",fNTotEvents,fMonitorRate);
139 Bool_t update = kFALSE;
140 if(!fTrendingUpdateEvent) {
141 update = kTRUE;
142 } else if ((TMath::Abs(fTrendingUpdateTime * fMonitorRate - fTrendingUpdateEvent) / fTrendingUpdateEvent) > 0.1){
143 update = kTRUE;
144 }
145 if(update) fTrendingUpdateEvent = fTrendingUpdateTime * fMonitorRate;
146 //printf("Update trending information every %d events\n",fTrendingUpdateEvent);
147
148 }
57acd2d2 149
150 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
6252ceeb 151 if (! IsValidEventSpecie(specie, list))
eca4fa66 152 continue ;
5e232cd6 153 SetEventSpecie(AliRecoParam::ConvertIndex(specie)) ;
4e25ac79 154 if(task == AliQAv1::kRAWS){
6bec7c7c 155 int nMaxBin = GetRawsData(kPedestalTimeInt0)->GetNbinsY();
57acd2d2 156 if(fCurrentCycle%nMaxBin==0) {
157 GetRawsData(kPedestalTimeInt0)->Reset();
158 GetRawsData(kPedestalTimeInt1)->Reset();
159 GetRawsData(kChargeEoITimeInt0)->Reset();
160 GetRawsData(kChargeEoITimeInt1)->Reset();
161 }
162 TH1D* hProj;
163 char name[50];
164 for(Int_t iChannel=0; iChannel<64; iChannel++) {
165 for(Int_t integrator=0;integrator<2;integrator++){
166 sprintf(name,"Ped_%d_%d",iChannel,integrator);
167 hProj = ((TH2I*)GetRawsData((integrator == 0 ? kPedestalCycleInt0 : kPedestalCycleInt1)))->ProjectionY(name,iChannel+1,iChannel+1);
168 ((TH2D*)GetRawsData((integrator == 0 ? kPedestalTimeInt0 : kPedestalTimeInt1)))->Fill((double)iChannel,(double)(fCurrentCycle%nMaxBin),(double)hProj->GetMean());
169 delete hProj;
170
171 sprintf(name,"Charge_%d_%d",iChannel,integrator);
172 hProj = ((TH2I*)GetRawsData((integrator == 0 ? kChargeEoICycleInt0 : kChargeEoICycleInt1)))->ProjectionY(name,iChannel+1,iChannel+1);
173 ((TH2D*)GetRawsData((integrator == 0 ? kChargeEoITimeInt0 : kChargeEoITimeInt1)))->Fill((double)iChannel,(double)(fCurrentCycle%nMaxBin),hProj->GetMean());
174 delete hProj;
175 }
176 }
4e25ac79 177 } else if (task == AliQAv1::kESDS) {
57acd2d2 178 }
9bd82f77 179 }
508b9fc0 180}
181
182//____________________________________________________________________________
183void AliVZEROQADataMakerRec::InitESDs()
184{
6bec7c7c 185 // Creates histograms to control ESDs
186
7d297381 187 const Bool_t expert = kTRUE ;
188 const Bool_t image = kTRUE ;
9bd82f77 189
6bec7c7c 190 TH2D * h2d;
191 TH1I * h1i;
192 TH1D * h1d;
9bd82f77 193
db72ff3b 194 h1i = new TH1I("H1I_Cell_Multiplicity_V0A", "Cell Multiplicity in V0A;Multiplicity (Nb of Cell);Counts", 35, 0, 35) ;
7d297381 195 Add2ESDsList(h1i, kCellMultiV0A, !expert, image) ;
4da80b8c 196
db72ff3b 197 h1i = new TH1I("H1I_Cell_Multiplicity_V0C", "Cell Multiplicity in V0;Multiplicity (Nb of Cell);Counts", 35, 0, 35) ;
7d297381 198 Add2ESDsList(h1i, kCellMultiV0C, !expert, image) ;
9bd82f77 199
db72ff3b 200 h1d = new TH1D("H1D_MIP_Multiplicity_V0A", "MIP Multiplicity in V0A;Multiplicity (Nb of MIP);Counts", 1000, 0, 1000) ;
7d297381 201 Add2ESDsList(h1d, kMIPMultiV0A, !expert, image) ;
9bd82f77 202
db72ff3b 203 h1d = new TH1D("H1D_MIP_Multiplicity_V0C", "MIP Multiplicity in V0C;Multiplicity (Nb of MIP);Counts", 1000, 0, 1000) ;
7d297381 204 Add2ESDsList(h1d, kMIPMultiV0C, !expert, image) ;
28fdf12c 205
db72ff3b 206 h2d = new TH2D("H2D_MIP_Multiplicity_Channel", "MIP Multiplicity per Channel;Channel;Multiplicity (Nb of MIP)",64, 0, 64, 100, 0, 100) ;
7d297381 207 Add2ESDsList(h2d, kMIPMultiChannel, !expert, image) ;
9bd82f77 208
db72ff3b 209 h1d = new TH1D("H1D_BBFlag_Counters", "BB Flag Counters;Channel;Counts",64, 0, 64) ;
7d297381 210 Add2ESDsList(h1d, kBBFlag, !expert, image) ;
9bd82f77 211
db72ff3b 212 h1d = new TH1D("H1D_BGFlag_Counters", "BG Flag Counters;Channel;Counts",64, 0, 64) ;
7d297381 213 Add2ESDsList(h1d, kBGFlag, !expert, image) ;
9bd82f77 214
db72ff3b 215 h2d = new TH2D("H2D_Charge_Channel", "ADC Charge per channel;Channel;Charge (ADC counts)",64, 0, 64, 1024, 0, 1024) ;
7d297381 216 Add2ESDsList(h2d, kChargeChannel, !expert, image) ;
9bd82f77 217
db72ff3b 218 h2d = new TH2D("H2D_Time_Channel", "Time per channel;Channel;Time (ns)",64, 0, 64, 820, 0, 410) ;
7d297381 219 Add2ESDsList(h2d, kTimeChannel, !expert, image) ;
9bd82f77 220
db72ff3b 221 h1d = new TH1D("H1D_V0A_Time", "Mean V0A Time;Time (ns);Counts",2048, 0., 409.6);
7d297381 222 Add2ESDsList(h1d,kESDV0ATime, !expert, image);
9bd82f77 223
db72ff3b 224 h1d = new TH1D("H1D_V0C_Time", "Mean V0C Time;Time (ns);Counts",2048, 0., 409.6);
7d297381 225 Add2ESDsList(h1d,kESDV0CTime, !expert, image);
9bd82f77 226
db72ff3b 227 h1d = new TH1D("H1D_Diff_Time", "Diff Time V0A - V0C;Diff Time V0A - V0C (ns);Counts",2*2048, -409.6, 409.6);
7d297381 228 Add2ESDsList(h1d,kESDDiffTime, !expert, image);
9bd82f77 229
28fdf12c 230}
508b9fc0 231
232//____________________________________________________________________________
4da80b8c 233 void AliVZEROQADataMakerRec::InitRaws()
234 {
6bec7c7c 235 // Creates RAW histograms in Raws subdir
236
7d297381 237 const Bool_t expert = kTRUE ;
238 const Bool_t saveCorr = kTRUE ;
239 const Bool_t image = kTRUE ;
9bd82f77 240
6bec7c7c 241 char name[50] , title[100];
242 const Int_t kNintegrator = 2;
9bd82f77 243
6bec7c7c 244 const Int_t kNTdcTimeBins = 2048;
245 const Int_t kTdcTimeMin = 0;
246 const Int_t kTdcTimeMax = 4096;
247 const Int_t kNTdcWidthBins = 128;
248 const Int_t kTdcWidthMin = 0;
249 const Int_t kTdcWidthMax = 128;
250 const Int_t kNChargeBins = 1024;
251 const Int_t kChargeMin = 0;
252 const Int_t kChargeMax = 1024;
253 const Int_t kNChannelBins = 64;
254 const Int_t kChannelMin = 0;
255 const Int_t kChannelMax = 64;
256 const Int_t kNPedestalBins = 200;
257 const Int_t kPedestalMin = 0;
258 const Int_t kPedestalMax = 200;
259 const Int_t kTimeMin = 0;
260 const Int_t kTimeMax = 100;
261 const Int_t kNMIPBins = 200;
262 const Int_t kMIPMin = 0;
263 const Int_t kMIPMax = 200;
264
265 TH2I * h2i;
266 TH2D * h2d;
267 TH1I * h1i;
268 TH1D * h1d;
a8e23456 269 AliVZEROTrending * trend;
6bec7c7c 270
271 int iHisto =0;
9bd82f77 272
6bec7c7c 273 // Creation of Cell Multiplicity Histograms
db72ff3b 274 h1i = new TH1I("H1I_Multiplicity_V0A", "Cell Multiplicity in V0A;# of Cells;Entries", 35, 0, 35) ;
7d297381 275 Add2RawsList(h1i,kMultiV0A, !expert, image, saveCorr); iHisto++;
db72ff3b 276 h1i = new TH1I("H1I_Multiplicity_V0C", "Cell Multiplicity in V0C;# of Cells;Entries", 35, 0, 35) ;
7d297381 277 Add2RawsList(h1i,kMultiV0C, !expert, image, saveCorr); iHisto++;
9bd82f77 278
6bec7c7c 279 // Creation of Total Charge Histograms
db72ff3b 280 h1d = new TH1D("H1D_Charge_V0A", "Total Charge in V0A;Charge [ADC counts];Counts", 2048, 0, 32768) ;
7d297381 281 Add2RawsList(h1d,kChargeV0A, !expert, image, saveCorr); iHisto++;
db72ff3b 282 h1d = new TH1D("H1D_Charge_V0C", "Total Charge in V0C;Charge [ADC counts];Counts", 2048, 0, 32768) ;
7d297381 283 Add2RawsList(h1d,kChargeV0C, !expert, image, saveCorr); iHisto++;
db72ff3b 284 h1d = new TH1D("H1D_Charge_V0", "Total Charge in V0;Charge [ADC counts];Counts", 2048, 0, 65536) ;
7d297381 285 Add2RawsList(h1d,kChargeV0, !expert, image, saveCorr); iHisto++;
9bd82f77 286
287 // Creation of MIP Histograms
db72ff3b 288 h1d = new TH1D("H1D_MIP_V0A", "Total MIP in V0A;Charge [MIP];Counts", 2*kNMIPBins,kMIPMin ,32*kMIPMax) ;
7d297381 289 Add2RawsList(h1d,kRawMIPV0A, !expert, image, saveCorr); iHisto++;
db72ff3b 290 h1d = new TH1D("H1D_MIP_V0C", "Total MIP in V0C;Charge [MIP];Counts", 2*kNMIPBins,kMIPMin ,32*kMIPMax) ;
7d297381 291 Add2RawsList(h1d,kRawMIPV0C, !expert, image, saveCorr); iHisto++;
db72ff3b 292 h1d = new TH1D("H1D_MIP_V0", "Total MIP in V0;Charge [MIP];Counts", 2*kNMIPBins,kMIPMin ,32*kMIPMax) ;
7d297381 293 Add2RawsList(h1d,kRawMIPV0, !expert, image, saveCorr); iHisto++;
db72ff3b 294 h2d = new TH2D("H2D_MIP_Channel", "Nb of MIP per channel;Channel;# of Mips", kNChannelBins, kChannelMin, kChannelMax,kNMIPBins,kMIPMin ,kMIPMax) ;
7d297381 295 Add2RawsList(h2d,kRawMIPChannel, expert, !image, !saveCorr); iHisto++;
9bd82f77 296
297
d62942e8 298 for(Int_t iInt=0;iInt<kNintegrator;iInt++){
9bd82f77 299 // Creation of Pedestal histograms
6bec7c7c 300 sprintf(name,"H2I_Pedestal_Int%d",iInt);
db72ff3b 301 sprintf(title,"Pedestal (Int%d);Pedestal [ADC counts];Counts",iInt);
6bec7c7c 302 h2i = new TH2I(name, title,kNChannelBins, kChannelMin, kChannelMax,kNPedestalBins,kPedestalMin ,kPedestalMax );
7d297381 303 Add2RawsList(h2i,(iInt == 0 ? kPedestalInt0 : kPedestalInt1), expert, !image, !saveCorr); iHisto++;
9bd82f77 304
6bec7c7c 305 // Creation of temporary Pedestal histo used for the mean versus time histogram. This histogram will be reset at the end of each cycle
306 sprintf(name,"H2I_Pedestal_CycleInt%d",iInt);
db72ff3b 307 sprintf(title,"One Cycle Pedestal (Int%d);Pedestal [ADC counts];Counts",iInt);
6bec7c7c 308 h2i = new TH2I(name, title,kNChannelBins, kChannelMin, kChannelMax,kNPedestalBins,kPedestalMin ,kPedestalMax );
7d297381 309 Add2RawsList(h2i,(iInt == 0 ? kPedestalCycleInt0 : kPedestalCycleInt1), expert, !image, !saveCorr); iHisto++;
9bd82f77 310
6bec7c7c 311 // Creation of Pedestal versus time graph.
312 sprintf(name,"H2D_Pedestal_Time_Int%d",iInt);
db72ff3b 313 sprintf(title,"Pedestal Versus Time (Int%d);Time [ns];Pedestal [ADC counts]",iInt);
6bec7c7c 314 h2d = new TH2D(name, title,kNChannelBins, kChannelMin, kChannelMax,kTimeMax,kTimeMin ,kTimeMax );
7d297381 315 Add2RawsList(h2d,(iInt == 0 ? kPedestalTimeInt0 : kPedestalTimeInt1), expert, !image, !saveCorr); iHisto++;
9bd82f77 316
317 // Creation of Charge EoI histograms
6bec7c7c 318 sprintf(name,"H2I_ChargeEoI_Int%d",iInt);
db72ff3b 319 sprintf(title,"Charge EoI (Int%d);Charge [ADC counts];Counts",iInt);
6bec7c7c 320 h2i = new TH2I(name, title,kNChannelBins, kChannelMin, kChannelMax, kNChargeBins, kChargeMin, kChargeMax);
7d297381 321 Add2RawsList(h2i,(iInt == 0 ? kChargeEoIInt0 : kChargeEoIInt1), !expert, image, !saveCorr); iHisto++;
9bd82f77 322
323 // Creation of temporary Charge EoI histograms used for the mean versus time histogram. This histogram will be reset at the end of each cycle
6bec7c7c 324 sprintf(name,"H2I_ChargeEoI_CycleInt%d",iInt);
db72ff3b 325 sprintf(title,"One Cycle Charge EoI (Int%d);Charge [ADC counts];Counts",iInt);
6bec7c7c 326 h2i = new TH2I(name, title,kNChannelBins, kChannelMin, kChannelMax, kNChargeBins, kChargeMin, kChargeMax);
7d297381 327 Add2RawsList(h2i,(iInt == 0 ? kChargeEoICycleInt0 : kChargeEoICycleInt1), expert, !image, !saveCorr); iHisto++;
9bd82f77 328
6bec7c7c 329 // Creation of Charge EoI versus time graphs
330 sprintf(name,"H2D_ChargeEoI_Time_Int%d",iInt);
db72ff3b 331 sprintf(title,"Charge EoI Versus Time (Int%d);Time [ns];Charge [ADC counts]",iInt);
6bec7c7c 332 h2d = new TH2D(name, title,kNChannelBins, kChannelMin, kChannelMax,kTimeMax,kTimeMin ,kTimeMax );
7d297381 333 Add2RawsList(h2d,(iInt == 0 ? kChargeEoITimeInt0 : kChargeEoITimeInt1), expert, !image, !saveCorr); iHisto++;
f81355e3 334
6bec7c7c 335 sprintf(name,"H2I_ChargeEoI_BB_Int%d",iInt);
db72ff3b 336 sprintf(title,"Charge EoI w/ BB Flag (Int%d);??;Charge [ADC counts]",iInt);
6bec7c7c 337 h2i = new TH2I(name, title,kNChannelBins, kChannelMin, kChannelMax, kNChargeBins, kChargeMin, kChargeMax);
7d297381 338 Add2RawsList(h2i,(iInt == 0 ? kChargeEoIBBInt0 : kChargeEoIBBInt1), expert, !image, !saveCorr); iHisto++;
f81355e3 339
6bec7c7c 340 sprintf(name,"H2I_ChargeEoI_BG_Int%d",iInt);
db72ff3b 341 sprintf(title,"Charge EoI w/ BG Flag (Int%d);??;Charge [ADC counts]",iInt);
6bec7c7c 342 h2i = new TH2I(name, title,kNChannelBins, kChannelMin, kChannelMax, kNChargeBins, kChargeMin, kChargeMax);
7d297381 343 Add2RawsList(h2i,(iInt == 0 ? kChargeEoIBGInt0: kChargeEoIBGInt1), expert, !image, !saveCorr); iHisto++;
9bd82f77 344
345 // Creation of Charge versus LHC Clock histograms
6bec7c7c 346 sprintf(name,"H2D_ChargeVsClock_Int%d",iInt);
db72ff3b 347 sprintf(title,"Charge Versus LHC-Clock (Int%d);Tine [ns];Charge [ADC counts]",iInt);
6bec7c7c 348 h2d = new TH2D(name, title,kNChannelBins, kChannelMin, kChannelMax,21, -10.5, 10.5 );
7d297381 349 Add2RawsList(h2d,(iInt == 0 ? kChargeVsClockInt0 : kChargeVsClockInt1 ), expert, !image, !saveCorr); iHisto++;
9bd82f77 350
6bec7c7c 351 // Creation of Minimum Bias Charge histograms
352 for(Int_t iBB=0;iBB<2;iBB++){
d62942e8 353 for(Int_t iBG=0;iBG<2;iBG++){
6bec7c7c 354 sprintf(name,"H2I_ChargeMB_BB%d_BG%d_Int%d",iBB,iBG,iInt);
db72ff3b 355 sprintf(title,"MB Charge (BB=%d, BG=%d, Int=%d);Charge [ADC counts];Counts",iBB,iBG,iInt);
6bec7c7c 356 h2i = new TH2I(name, title,kNChannelBins, kChannelMin, kChannelMax,kNChargeBins, kChargeMin, kChargeMax);
9bd82f77 357 int idx;
358 if(iInt==0){
359 if(iBB==0){
6bec7c7c 360 if(iBG==0) idx = kChargeMBBB0BG0Int0;
361 else idx = kChargeMBBB0BG1Int0;
9bd82f77 362 } else {
6bec7c7c 363 if(iBG==0) idx = kChargeMBBB1BG0Int0;
364 else idx = kChargeMBBB1BG1Int0;
9bd82f77 365 }
366 } else {
367 if(iBB==0){
6bec7c7c 368 if(iBG==0) idx = kChargeMBBB0BG0Int1;
369 else idx = kChargeMBBB0BG1Int1;
9bd82f77 370 } else {
6bec7c7c 371 if(iBG==0) idx = kChargeMBBB1BG0Int1;
372 else idx = kChargeMBBB1BG1Int1;
9bd82f77 373 }
374 }
7d297381 375 Add2RawsList(h2i,idx, expert, !image, !saveCorr); iHisto++;
9bd82f77 376 }
6bec7c7c 377 }
9bd82f77 378
379 }
380
6bec7c7c 381 // Creation of Time histograms
382 sprintf(name,"H2I_Width");
db72ff3b 383 sprintf(title,"HPTDC Width;Width [ns];Counts");
6bec7c7c 384 h2i = new TH2I(name, title,kNChannelBins, kChannelMin, kChannelMax, kNTdcWidthBins, kTdcWidthMin, kTdcWidthMax);
7d297381 385 Add2RawsList(h2i,kWidth, expert, !image, !saveCorr); iHisto++;
9bd82f77 386
6bec7c7c 387 sprintf(name,"H2I_Width_BB");
db72ff3b 388 sprintf(title,"HPTDC Width w/ BB Flag condition;??;Width [ns]");
6bec7c7c 389 h2i = new TH2I(name, title,kNChannelBins, kChannelMin, kChannelMax, kNTdcWidthBins, kTdcWidthMin, kTdcWidthMax);
7d297381 390 Add2RawsList(h2i,kWidthBB, expert, !image, !saveCorr); iHisto++;
9bd82f77 391
6bec7c7c 392 sprintf(name,"H2I_Width_BG");
db72ff3b 393 sprintf(title,"HPTDC Width w/ BG Flag condition??;Width [ns]");
6bec7c7c 394 h2i = new TH2I(name, title,kNChannelBins, kChannelMin, kChannelMax, kNTdcWidthBins, kTdcWidthMin, kTdcWidthMax);
7d297381 395 Add2RawsList(h2i,kWidthBG, expert, !image, !saveCorr); iHisto++;
9bd82f77 396
6bec7c7c 397 sprintf(name,"H2I_HPTDCTime");
db72ff3b 398 sprintf(title,"HPTDC Time;??;Width [ns]");
6bec7c7c 399 h2i = new TH2I(name, title,kNChannelBins, kChannelMin, kChannelMax, kNTdcTimeBins, kTdcTimeMin, kTdcTimeMax);
7d297381 400 Add2RawsList(h2i,kHPTDCTime, !expert, image, !saveCorr); iHisto++;
9bd82f77 401
6bec7c7c 402 sprintf(name,"H2I_HPTDCTime_BB");
db72ff3b 403 sprintf(title,"HPTDC Time w/ BB Flag condition;??;Width [ns]");
6bec7c7c 404 h2i = new TH2I(name, title,kNChannelBins, kChannelMin, kChannelMax, kNTdcTimeBins, kTdcTimeMin, kTdcTimeMax);
7d297381 405 Add2RawsList(h2i,kHPTDCTimeBB, expert, !image, !saveCorr); iHisto++;
9bd82f77 406
6bec7c7c 407 sprintf(name,"H2I_HPTDCTime_BG");
db72ff3b 408 sprintf(title,"HPTDC Time w/ BG Flag condition;??;Width [ns]");
6bec7c7c 409 h2i = new TH2I(name, title,kNChannelBins, kChannelMin, kChannelMax, kNTdcTimeBins, kTdcTimeMin, kTdcTimeMax);
7d297381 410 Add2RawsList(h2i,kHPTDCTimeBG, expert, !image, !saveCorr); iHisto++;
9bd82f77 411
6bec7c7c 412 sprintf(name,"H1D_V0A_Time");
db72ff3b 413 sprintf(title,"V0A Time;Time [ns];Counts");
6bec7c7c 414 h1d = new TH1D(name, title,kNTdcTimeBins, kTdcTimeMin/10, kTdcTimeMax/10);
7d297381 415 Add2RawsList(h1d,kV0ATime, !expert, !image, saveCorr); iHisto++;
9bd82f77 416
6bec7c7c 417 sprintf(name,"H1D_V0C_Time");
db72ff3b 418 sprintf(title,"V0C Time;Time [ns];Counts");
6bec7c7c 419 h1d = new TH1D(name, title,kNTdcTimeBins, kTdcTimeMin/10, kTdcTimeMax/10);
7d297381 420 Add2RawsList(h1d,kV0CTime, !expert, !image, saveCorr); iHisto++;
9bd82f77 421
6bec7c7c 422 sprintf(name,"H1D_Diff_Time");
db72ff3b 423 sprintf(title,"Diff V0A-V0C Time;Time [ns];Counts");
6bec7c7c 424 h1d = new TH1D(name, title,2*kNTdcTimeBins, -kTdcTimeMax/10, kTdcTimeMax/10);
7d297381 425 Add2RawsList(h1d,kDiffTime, !expert, !image, saveCorr); iHisto++;
9bd82f77 426
9bd82f77 427 // Creation of Flag versus LHC Clock histograms
6bec7c7c 428 sprintf(name,"H2D_BBFlagVsClock");
db72ff3b 429 sprintf(title,"BB-Flags Versus LHC-Clock;Time [ns];??");
6bec7c7c 430 h2d = new TH2D(name, title,kNChannelBins, kChannelMin, kChannelMax,21, -10.5, 10.5 );
7d297381 431 Add2RawsList(h2d,kBBFlagVsClock, expert, !image, !saveCorr); iHisto++;
9bd82f77 432
6bec7c7c 433 sprintf(name,"H2D_BGFlagVsClock");
db72ff3b 434 sprintf(title,"BG-Flags Versus LHC-Clock;Time [ns];??");
6bec7c7c 435 h2d = new TH2D(name, title,kNChannelBins, kChannelMin, kChannelMax,21, -10.5, 10.5 );
7d297381 436 Add2RawsList(h2d,kBGFlagVsClock, expert, !image, !saveCorr); iHisto++;
9bd82f77 437
a8e23456 438 sprintf(name,"TREND_MeanChargePerRing");
439 sprintf(title,"Mean Charge per Event and per Ring versus time ");
440 trend = new AliVZEROTrending(name, title);
441 Add2RawsList(trend,kRawMeanChargePerRing, !expert, !image, !saveCorr); iHisto++;
442
443 sprintf(name,"TREND_MeanFlagPerRing");
444 sprintf(title,"Mean Flag per Event and per Ring versus time ");
445 trend = new AliVZEROTrending(name, title);
446 Add2RawsList(trend,kRawMeanFlagPerRing, !expert, !image, !saveCorr); iHisto++;
447
5379c4a3 448 AliDebug(AliQAv1::GetQADebugLevel(), Form("%d Histograms has been added to the Raws List",iHisto));
4da80b8c 449 }
508b9fc0 450
44ed7a66 451//____________________________________________________________________________
452void AliVZEROQADataMakerRec::InitDigits()
453{
454 // create Digits histograms in Digits subdir
455 const Bool_t expert = kTRUE ;
456 const Bool_t image = kTRUE ;
457
458 char TDCname[100];
459 char ADCname[100];
460 TH1I *fhDigTDC[64];
461 TH1I *fhDigADC[64];
462 char texte[100];
463
464 // create Digits histograms in Digits subdir
db72ff3b 465 TH1I * h0 = new TH1I("hDigitMultiplicity", "Digits multiplicity distribution in VZERO;# of Digits;Entries", 100, 0, 99) ;
44ed7a66 466 h0->Sumw2() ;
467 Add2DigitsList(h0, 0, !expert, image) ;
468
469 for (Int_t i=0; i<64; i++)
470 {
471 sprintf(TDCname, "hDigitTDC%d", i);
db72ff3b 472 sprintf(texte,"Digit TDC in cell %d; TDC value;Entries",i);
44ed7a66 473 fhDigTDC[i] = new TH1I(TDCname,texte,300,0.,149.);
474
475 sprintf(ADCname,"hDigitADC%d",i);
db72ff3b 476 sprintf(texte,"Digit ADC in cell %d;ADC value;Entries",i);
44ed7a66 477 fhDigADC[i]= new TH1I(ADCname,texte,1024,0.,1023.);
478
479 Add2DigitsList(fhDigTDC[i],i+1, !expert, image);
480 Add2DigitsList(fhDigADC[i],i+1+64, !expert, image);
481 }
482}
483
484//____________________________________________________________________________
6252ceeb 485void AliVZEROQADataMakerRec::MakeDigits()
44ed7a66 486{
487 // makes data from Digits
eca4fa66 488
6252ceeb 489 GetDigitsData(0)->Fill(fDigitsArray->GetEntriesFast()) ;
490 TIter next(fDigitsArray) ;
44ed7a66 491 AliVZEROdigit *VZERODigit ;
492 while ( (VZERODigit = dynamic_cast<AliVZEROdigit *>(next())) ) {
493 Int_t PMNumber = VZERODigit->PMNumber();
494 GetDigitsData(PMNumber +1)->Fill( VZERODigit->Time()) ; // in 100 of picoseconds
495 GetDigitsData(PMNumber +1+64)->Fill( VZERODigit->ADC()) ;
496 }
497}
498
499
500//____________________________________________________________________________
501void AliVZEROQADataMakerRec::MakeDigits(TTree *digitTree)
502{
503 // makes data from Digit Tree
504
6252ceeb 505 if ( fDigitsArray )
506 fDigitsArray->Clear() ;
507 else
508 fDigitsArray = new TClonesArray("AliVZEROdigit", 1000) ;
44ed7a66 509
510 TBranch * branch = digitTree->GetBranch("VZERODigit") ;
511 if ( ! branch ) {
512 AliWarning("VZERO branch in Digit Tree not found") ;
513 } else {
6252ceeb 514 branch->SetAddress(&fDigitsArray) ;
44ed7a66 515 branch->GetEntry(0) ;
6252ceeb 516 MakeDigits() ;
44ed7a66 517 }
518}
519
520
508b9fc0 521//____________________________________________________________________________
522void AliVZEROQADataMakerRec::MakeESDs(AliESDEvent * esd)
523{
6bec7c7c 524 // Creates QA data from ESDs
525
526 UInt_t eventType = esd->GetEventType();
508b9fc0 527
6bec7c7c 528 switch (eventType){
9bd82f77 529 case PHYSICS_EVENT:
6bec7c7c 530 AliESDVZERO *esdVZERO=esd->GetVZEROData();
508b9fc0 531
6bec7c7c 532 if (!esdVZERO) break;
9bd82f77 533
534 GetESDsData(kCellMultiV0A)->Fill(esdVZERO->GetNbPMV0A());
535 GetESDsData(kCellMultiV0C)->Fill(esdVZERO->GetNbPMV0C());
536 GetESDsData(kMIPMultiV0A)->Fill(esdVZERO->GetMTotV0A());
537 GetESDsData(kMIPMultiV0C)->Fill(esdVZERO->GetMTotV0C());
538
6bec7c7c 539 Float_t timeV0A = 0., timeV0C = 0., diffTime;
540 Int_t iTimeV0A = 0, iTimeV0C = 0;
9bd82f77 541
6bec7c7c 542 for(Int_t i=0;i<64;i++) {
9bd82f77 543 GetESDsData(kMIPMultiChannel)->Fill((Float_t) i,(Float_t) esdVZERO->GetMultiplicity(i));
544 GetESDsData(kChargeChannel)->Fill((Float_t) i,(Float_t) esdVZERO->GetAdc(i));
545 if(esdVZERO->GetBBFlag(i)) GetESDsData(kBBFlag)->Fill((Float_t) i);
546 if(esdVZERO->GetBGFlag(i)) GetESDsData(kBGFlag)->Fill((Float_t) i);
547
6bec7c7c 548 Float_t time = (Float_t) esdVZERO->GetTime(i)/10.; //Convert in ns: 1 TDC channel = 100ps
549 GetESDsData(kTimeChannel)->Fill((Float_t) i,time);
9bd82f77 550
6bec7c7c 551 if(time>0.){
9bd82f77 552 if (i<32) {
553 iTimeV0C++;
6bec7c7c 554 timeV0C += time;
9bd82f77 555 }else{
556 iTimeV0A++;
6bec7c7c 557 timeV0A += time;
9bd82f77 558 }
559 }
560 }
6bec7c7c 561 if(iTimeV0A>0) timeV0A /= iTimeV0A;
562 else timeV0A = -1.;
563 if(iTimeV0C>0) timeV0C /= iTimeV0C;
564 else timeV0C = -1.;
565 if(timeV0A<0. || timeV0C<0.) diffTime = -10000.;
566 else diffTime = timeV0A - timeV0C;
9bd82f77 567
6bec7c7c 568 GetESDsData(kESDV0ATime)->Fill(timeV0A);
569 GetESDsData(kESDV0CTime)->Fill(timeV0C);
570 GetESDsData(kESDDiffTime)->Fill(diffTime);
9bd82f77 571
6bec7c7c 572 break;
9bd82f77 573 }
28fdf12c 574
508b9fc0 575}
576
577//____________________________________________________________________________
4da80b8c 578 void AliVZEROQADataMakerRec::MakeRaws(AliRawReader* rawReader)
579 {
6bec7c7c 580 // Fills histograms with Raws, computes average ADC values dynamically (pedestal subtracted)
1e376713 581
eca4fa66 582 // Check id histograms already created for this Event Specie
583 if ( ! GetRawsData(kPedestalInt0) )
584 InitRaws() ;
585
586 rawReader->Reset() ;
c75ba816 587 AliVZERORawStream rawStream(rawReader);
588 if(!(rawStream.Next())) return;
a8e23456 589
6bec7c7c 590 eventTypeType eventType = rawReader->GetType();
9bd82f77 591
6bec7c7c 592 Int_t mulV0A = 0 ;
593 Int_t mulV0C = 0 ;
594 Double_t timeV0A =0., timeV0C = 0.;
595 UInt_t itimeV0A=0, itimeV0C=0;
596 Double_t chargeV0A=0., chargeV0C=0.;
597 Double_t mipV0A=0., mipV0C=0.;
9bd82f77 598
6bec7c7c 599 Double_t diffTime=-100000.;
9bd82f77 600
601
6bec7c7c 602 switch (eventType){
603 case PHYSICS_EVENT:
a8e23456 604
605 fNTotEvents++;
606
607 if(fNSubEvents++>=fTrendingUpdateEvent && fTrendingUpdateEvent>0) {
608 fNSubEvents=0;
609 AddTrendingEntry();
610 }
6bec7c7c 611 Int_t iFlag=0;
612 Int_t pedestal;
613 Int_t integrator;
614 Bool_t BBFlag;
9bd82f77 615 Bool_t BGFlag;
6bec7c7c 616 UInt_t time, width;
a8e23456 617 Int_t MBCharge;
618 Float_t charge;
6bec7c7c 619 Int_t offlineCh;
620 TH1D * hProj;
9bd82f77 621
d62942e8 622 for(Int_t iChannel=0; iChannel<64; iChannel++) { // BEGIN : Loop over channels
9bd82f77 623
c75ba816 624 offlineCh = rawStream.GetOfflineChannel(iChannel);
9bd82f77 625
6bec7c7c 626 // Fill Pedestal histograms
627
628 for(Int_t j=15; j<21; j++) {
c75ba816 629 if((rawStream.GetBGFlag(iChannel,j) || rawStream.GetBBFlag(iChannel,j))) iFlag++;
6bec7c7c 630 }
9bd82f77 631
6bec7c7c 632 if(iFlag == 0){ //No Flag found
d62942e8 633 for(Int_t j=15; j<21; j++){
c75ba816 634 pedestal=rawStream.GetPedestal(iChannel, j);
635 integrator = rawStream.GetIntegratorFlag(iChannel, j);
9bd82f77 636
6bec7c7c 637 GetRawsData((integrator == 0 ? kPedestalInt0 : kPedestalInt1))->Fill(offlineCh,pedestal);
638 GetRawsData((integrator == 0 ? kPedestalCycleInt0 : kPedestalCycleInt1))->Fill(offlineCh,pedestal);
9bd82f77 639 }
6bec7c7c 640 }
9bd82f77 641
6bec7c7c 642 // Fill Charge EoI histograms
643
644 // Look for the maximum in the LHC clock train
645 charge = 0;
9bd82f77 646 Int_t iClock = 0;
a8e23456 647 Float_t iCharge = 0;
d62942e8 648 for(Int_t iEvent=0; iEvent<21; iEvent++){
c75ba816 649 iCharge = rawStream.GetPedestal(iChannel,iEvent);
6bec7c7c 650 if(iCharge>charge) {
651 charge = iCharge;
9bd82f77 652 iClock = iEvent;
653 }
654 } // End of maximum searching procedure
655
c75ba816 656 integrator = rawStream.GetIntegratorFlag(iChannel,iClock);
657 BBFlag = rawStream.GetBBFlag(iChannel, iClock);
658 BGFlag = rawStream.GetBGFlag(iChannel,iClock );
9bd82f77 659
6bec7c7c 660 GetRawsData((integrator == 0 ? kChargeEoIInt0 : kChargeEoIInt1))->Fill(offlineCh,charge);
661 if(BBFlag) GetRawsData((integrator == 0 ? kChargeEoIBBInt0 : kChargeEoIBBInt1))->Fill(offlineCh,charge);
662 if(BGFlag) GetRawsData((integrator == 0 ? kChargeEoIBGInt0 : kChargeEoIBGInt1))->Fill(offlineCh,charge);
9bd82f77 663
6bec7c7c 664 hProj = ((TH2I*)GetRawsData((integrator == 0 ? kPedestalInt0 : kPedestalInt1)))->ProjectionY("",offlineCh+1,offlineCh+1);
665 Double_t ped = hProj->GetMean();
666 Double_t sigma = hProj->GetRMS();
667 delete hProj;
9bd82f77 668
6bec7c7c 669 Double_t chargeEoI = charge - ped;
9bd82f77 670
6bec7c7c 671 // Calculation of the number of MIP
672 Double_t mipEoI = chargeEoI * fCalibData->GetMIPperADC(offlineCh);
9bd82f77 673
a8e23456 674 int side = offlineCh/32;
675 int ring = (offlineCh - 32*side) / 8;
676 if(BBFlag) fFlagPerRing[side*4 + ring] += 1;
677
6bec7c7c 678 if(charge<1023 && chargeEoI > 5.*sigma){
a8e23456 679 fChargePerRing[side*4 + ring] += chargeEoI;
6bec7c7c 680 ((TH2I*)GetRawsData((integrator == 0 ? kChargeEoICycleInt0 : kChargeEoICycleInt1)))->Fill(offlineCh,chargeEoI);
681 ((TH2D*)GetRawsData(kRawMIPChannel))->Fill(offlineCh,mipEoI);
682 if(offlineCh<32) {
9bd82f77 683 mulV0C++;
6bec7c7c 684 chargeV0C += chargeEoI;
685 mipV0C += mipEoI;
686 } else {
9bd82f77 687 mulV0A++;
6bec7c7c 688 chargeV0A += chargeEoI;
689 mipV0A += mipEoI;
9bd82f77 690 }
6bec7c7c 691 }
9bd82f77 692
6bec7c7c 693 // Fill Charge Minimum Bias Histograms
694
695 int idx;
696 for(Int_t iBunch=0; iBunch<10; iBunch++){
c75ba816 697 integrator = rawStream.GetIntMBFlag(iChannel, iBunch);
698 BBFlag = rawStream.GetBBMBFlag(iChannel, iBunch);
699 BGFlag = rawStream.GetBGMBFlag(iChannel, iBunch);
700 MBCharge = rawStream.GetChargeMB(iChannel, iBunch);
9bd82f77 701
702 if(integrator==0){
703 if(BBFlag==0){
6bec7c7c 704 if(BGFlag==0) idx = kChargeMBBB0BG0Int0;
705 else idx = kChargeMBBB0BG1Int0;
9bd82f77 706 } else {
6bec7c7c 707 if(BGFlag==0) idx = kChargeMBBB1BG0Int0;
708 else idx = kChargeMBBB1BG1Int0;
9bd82f77 709 }
710 } else {
711 if(BBFlag==0){
6bec7c7c 712 if(BGFlag==0) idx = kChargeMBBB0BG0Int1;
713 else idx = kChargeMBBB0BG1Int1;
9bd82f77 714 } else {
6bec7c7c 715 if(BGFlag==0) idx = kChargeMBBB1BG0Int1;
716 else idx = kChargeMBBB1BG1Int1;
9bd82f77 717 }
718 }
6bec7c7c 719 GetRawsData(idx)->Fill(offlineCh,MBCharge);
720 }
721
722 // Fill HPTDC Time Histograms
723
c75ba816 724 BBFlag = rawStream.GetBBFlag(iChannel, 10);
725 BGFlag = rawStream.GetBGFlag(iChannel, 10);
726 time = rawStream.GetTime(iChannel);
727 width = rawStream.GetWidth(iChannel);
6bec7c7c 728
729 if(time>0.){
730 if (offlineCh<32) {
731 itimeV0C++;
732 timeV0C += time;
733 }else{
734 itimeV0A++;
735 timeV0A += time;
736 }
737 }
738 GetRawsData(kHPTDCTime)->Fill(offlineCh,time);
739 GetRawsData(kWidth)->Fill(offlineCh,width);
9bd82f77 740 if(BBFlag) {
6bec7c7c 741 GetRawsData(kHPTDCTimeBB)->Fill(offlineCh,time);
742 GetRawsData(kWidthBB)->Fill(offlineCh,width);
9bd82f77 743 }
6bec7c7c 744 if(BGFlag) {
745 GetRawsData(kHPTDCTimeBG)->Fill(offlineCh,time);
746 GetRawsData(kWidthBG)->Fill(offlineCh,width);
9bd82f77 747 }
748
6bec7c7c 749 // Fill Flag and Charge Versus LHC-Clock histograms
750
d62942e8 751 for(Int_t iEvent=0; iEvent<21; iEvent++){
c75ba816 752 charge = rawStream.GetPedestal(iChannel,iEvent);
753 integrator = rawStream.GetIntegratorFlag(iChannel,iEvent);
754 BBFlag = rawStream.GetBBFlag(iChannel, iEvent);
755 BGFlag = rawStream.GetBGFlag(iChannel,iEvent );
6bec7c7c 756
757 ((TH2*) GetRawsData((integrator == 0 ? kChargeVsClockInt0 : kChargeVsClockInt1 )))->Fill(offlineCh,(float)iEvent-10,(float)charge);
758 ((TH2*) GetRawsData(kBBFlagVsClock))->Fill(offlineCh,(float)iEvent-10,(float)BBFlag);
759 ((TH2*) GetRawsData(kBGFlagVsClock))->Fill(offlineCh,(float)iEvent-10,(float)BGFlag);
9bd82f77 760 }
761
6bec7c7c 762 }// END of Loop over channels
9bd82f77 763
6bec7c7c 764 if(itimeV0A>0) timeV0A /= (itimeV0A * 10); // itimeV0A Channels and divide by 10 to have the result in ns because 1 TDC Channel = 100 ps
765 else timeV0A = -1.;
766 if(itimeV0C>0) timeV0C /= (itimeV0C * 10);
767 else timeV0C = -1.;
768 if(timeV0A<0. || timeV0C<0.) diffTime = -10000.;
769 else diffTime = timeV0A - timeV0C;
9bd82f77 770
6bec7c7c 771 GetRawsData(kV0ATime)->Fill(timeV0A);
772 GetRawsData(kV0CTime)->Fill(timeV0C);
773 GetRawsData(kDiffTime)->Fill(diffTime);
9bd82f77 774
6bec7c7c 775 GetRawsData(kMultiV0A)->Fill(mulV0A);
776 GetRawsData(kMultiV0C)->Fill(mulV0C);
9bd82f77 777
6bec7c7c 778 GetRawsData(kChargeV0A)->Fill(chargeV0A);
779 GetRawsData(kChargeV0C)->Fill(chargeV0C);
780 GetRawsData(kChargeV0)->Fill(chargeV0A + chargeV0C);
9bd82f77 781
6bec7c7c 782 GetRawsData(kRawMIPV0A)->Fill(mipV0A);
783 GetRawsData(kRawMIPV0C)->Fill(mipV0C);
784 GetRawsData(kRawMIPV0)->Fill(mipV0A + mipV0C);
785 break;
786
787 } // END of SWITCH : EVENT TYPE
9bd82f77 788
789 fEvent++;
4e25ac79 790 TParameter<double> * p = dynamic_cast<TParameter<double>*>(GetParameterList()->FindObject(Form("%s_%s_%s", GetName(), AliQAv1::GetTaskName(AliQAv1::kRAWS).Data(), GetRawsData(kMultiV0A)->GetName()))) ;
719e870c 791 if (p) p->SetVal((double)mulV0A) ;
9bd82f77 792
4e25ac79 793 p = dynamic_cast<TParameter<double>*>(GetParameterList()->FindObject(Form("%s_%s_%s", GetName(), AliQAv1::GetTaskName(AliQAv1::kRAWS).Data(), GetRawsData(kMultiV0C)->GetName()))) ;
719e870c 794 if (p) p->SetVal((double)mulV0C) ;
9bd82f77 795
4e25ac79 796 p = dynamic_cast<TParameter<double>*>(GetParameterList()->FindObject(Form("%s_%s_%s", GetName(), AliQAv1::GetTaskName(AliQAv1::kRAWS).Data(), GetRawsData(kChargeV0A)->GetName()))) ;
719e870c 797 if (p) p->SetVal((double)chargeV0A) ;
9bd82f77 798
4e25ac79 799 p = dynamic_cast<TParameter<double>*>(GetParameterList()->FindObject(Form("%s_%s_%s", GetName(), AliQAv1::GetTaskName(AliQAv1::kRAWS).Data(), GetRawsData(kChargeV0C)->GetName()))) ;
719e870c 800 if (p) p->SetVal((double)chargeV0C) ;
9bd82f77 801
4e25ac79 802 p = dynamic_cast<TParameter<double>*>(GetParameterList()->FindObject(Form("%s_%s_%s", GetName(), AliQAv1::GetTaskName(AliQAv1::kRAWS).Data(), GetRawsData(kChargeV0)->GetName()))) ;
719e870c 803 if (p) p->SetVal((double)(chargeV0A + chargeV0C)) ;
9bd82f77 804
4e25ac79 805 p = dynamic_cast<TParameter<double>*>(GetParameterList()->FindObject(Form("%s_%s_%s", GetName(), AliQAv1::GetTaskName(AliQAv1::kRAWS).Data(), GetRawsData(kRawMIPV0A)->GetName()))) ;
719e870c 806 if (p) p->SetVal((double)mipV0A) ;
9bd82f77 807
4e25ac79 808 p = dynamic_cast<TParameter<double>*>(GetParameterList()->FindObject(Form("%s_%s_%s", GetName(), AliQAv1::GetTaskName(AliQAv1::kRAWS).Data(), GetRawsData(kRawMIPV0C)->GetName()))) ;
719e870c 809 if (p) p->SetVal((double)mipV0C) ;
9bd82f77 810
4e25ac79 811 p = dynamic_cast<TParameter<double>*>(GetParameterList()->FindObject(Form("%s_%s_%s", GetName(), AliQAv1::GetTaskName(AliQAv1::kRAWS).Data(), GetRawsData(kRawMIPV0)->GetName()))) ;
719e870c 812 if (p) p->SetVal((double)(mipV0A + mipV0C)) ;
9bd82f77 813
4e25ac79 814 p = dynamic_cast<TParameter<double>*>(GetParameterList()->FindObject(Form("%s_%s_%s", GetName(), AliQAv1::GetTaskName(AliQAv1::kRAWS).Data(), GetRawsData(kV0ATime)->GetName()))) ;
719e870c 815 if (p) p->SetVal((double)timeV0A) ;
9bd82f77 816
4e25ac79 817 p = dynamic_cast<TParameter<double>*>(GetParameterList()->FindObject(Form("%s_%s_%s", GetName(), AliQAv1::GetTaskName(AliQAv1::kRAWS).Data(), GetRawsData(kV0CTime)->GetName()))) ;
719e870c 818 if (p) p->SetVal((double)timeV0C) ;
9bd82f77 819
4e25ac79 820 p = dynamic_cast<TParameter<double>*>(GetParameterList()->FindObject(Form("%s_%s_%s", GetName(), AliQAv1::GetTaskName(AliQAv1::kRAWS).Data(), GetRawsData(kDiffTime)->GetName()))) ;
719e870c 821 if (p) p->SetVal((double)diffTime) ;
9bd82f77 822
9bd82f77 823
4da80b8c 824 }
508b9fc0 825
826//____________________________________________________________________________
827void AliVZEROQADataMakerRec::StartOfDetectorCycle()
828{
829 // Detector specific actions at start of cycle
830
6bec7c7c 831 // Reset of the histogram used - to have the trend versus time -
e6d13307 832
833 fCalibData = GetCalibData();
6bec7c7c 834
9bd82f77 835 TH1* h;
6bec7c7c 836 h = GetRawsData(kPedestalCycleInt0);
9bd82f77 837 if(h) h->Reset();
6bec7c7c 838 h = GetRawsData(kPedestalCycleInt1);
9bd82f77 839 if(h) h->Reset();
6bec7c7c 840 h = GetRawsData(kChargeEoICycleInt0);
9bd82f77 841 if(h) h->Reset();
6bec7c7c 842 h = GetRawsData(kChargeEoICycleInt1);
9bd82f77 843 if(h) h->Reset();
a8e23456 844
845 TTimeStamp currentTime;
846 fCycleStartTime = currentTime.GetSec();
847
848 fNTotEvents = 0;
849}
9bd82f77 850
a8e23456 851//-------------------------------------------------------------------------------------------------
852void AliVZEROQADataMakerRec::AddTrendingEntry(){
853 printf("AddTrendingEntry\n");
854
855 // Normalize to the number of events
856 for(int i=0; i<8;i++){
857// fChargePerRing[i] *= TMath::Power(10.,i)/fTrendingUpdateEvent;
858// fFlagPerRing[i] *= TMath::Power(10.,i)/fTrendingUpdateEvent;
859 fChargePerRing[i] /= fTrendingUpdateEvent;
860 fFlagPerRing[i] /= fTrendingUpdateEvent;
861 }
862
863 TTimeStamp currentTime;
864 ((AliVZEROTrending*)GetRawsData(kRawMeanChargePerRing))->AddEntry(fChargePerRing, currentTime.GetSec());
865 ((AliVZEROTrending*)GetRawsData(kRawMeanFlagPerRing))->AddEntry(fFlagPerRing, currentTime.GetSec());
866 //moMeanFlagPerRing->AddEntry(fFlagPerRing, currentTime.GetSec());
867
868 // Put back counters to zero
869 for(int i=0; i<8;i++){
870 fChargePerRing[i] = 0.;
871 fFlagPerRing[i] = 0.;
872 }
873
508b9fc0 874}