Reco Param with Latency window, L1 latency & vertex shift
[u/mrichter/AliRoot.git] / ZDC / AliZDCRawStream.cxx
CommitLineData
8309c1ab 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/* $Id$ */
17
18///////////////////////////////////////////////////////////////////////////////
83347831 19// //
20// This class provides access to ZDC digits in raw data. //
21// //
22// It loops over all ZDC digits in the raw data given by the AliRawReader. //
23// The Next method goes to the next digit. If there are no digits left //
24// it returns kFALSE. //
25// Getters provide information about the current digit. //
26// //
8309c1ab 27///////////////////////////////////////////////////////////////////////////////
28
11b06725 29#include <TSystem.h>
8309c1ab 30#include "AliZDCRawStream.h"
31#include "AliRawReader.h"
1ee299a5 32#include "AliRawDataHeader.h"
33#include "AliRawEventHeaderBase.h"
cc2abffd 34#include "AliLog.h"
8309c1ab 35
36ClassImp(AliZDCRawStream)
37
38
39//_____________________________________________________________________________
40AliZDCRawStream::AliZDCRawStream(AliRawReader* rawReader) :
41 fRawReader(rawReader),
1ee299a5 42 fBuffer(0),
44455047 43 fReadOutCard(-1),
1ee299a5 44 fEvType(0),
45 fPosition(0),
46 fIsCalib(kFALSE),
47 fIsDARCHeader(kFALSE),
c3986754 48 fIsHeaderMapping(kFALSE),
1ee299a5 49 fIsChMapping(kFALSE),
50 fIsADCDataWord(kFALSE),
51 fIsADCHeader(kFALSE),
52 fIsADCEOB(kFALSE),
fee50699 53 fSODReading(kFALSE),
54 fIsMapRead(kFALSE),
44455047 55 fDeadfaceOffset(-1),
56 fDeadbeefOffset(-1),
1ee299a5 57 fDataOffset(0),
58 fModType(-1),
59 fADCModule(-1),
60 fADCNChannels(-1),
786b72f5 61 fADCChannel(-1),
cc2abffd 62 fADCValue(-1),
1ee299a5 63 fADCGain(-1),
c33b6ca6 64 fIsUnderflow(kFALSE),
65 fIsOverflow(kFALSE),
fee50699 66 fScGeo(0),
c083685e 67 fScNWords(0),
68 fScTriggerSource(0),
e42bdf10 69 fScTriggerNumber(0),
c083685e 70 fIsScEventGood(kTRUE),
71 fIsScHeaderRead(kFALSE),
72 fScStartCounter(0),
73 fScEvCounter(0),
ad3a602e 74 fIsScalerWord(kFALSE),
da090841 75 fDetPattern(0),
76 fTrigCountNWords(0),
f70a5526 77 fIsTriggerScaler(kFALSE),
da090841 78 fTrigCountStart(0),
79 fMBTrigInput(0),
80 fCentralTrigInput(0),
81 fSCentralTrigInput(0),
82 fEMDTrigInput(0),
83 fL0Received(0),
84 fMBtrig2CTP(0),
85 fCentralTrig2CTP(0),
86 fSCentralTrig2CTP(0),
87 fEMDTrig2CTP(0),
88 fTrigHistNWords(0),
f70a5526 89 fIsTriggerHistory(kFALSE),
90 fTrigHistStart(0),
da090841 91 fPileUpBit1stWord(0),
92 fL0Bit1stWord(0),
93 fCentralTrigHist(0),
94 fMBTrigHist(0),
95 fPileUpBit2ndWord(0),
96 fL0Bit2ndWord(0),
97 fSCentralTrigHist(0),
98 fEMDTrigHist(0),
58671297 99 fNChannelsOn(0),
c3986754 100 fCurrentCh(-1),
101 fCabledSignal(-1),
102 fCurrScCh(-1),
da090841 103 fIsADCEventGood(kTRUE),
c3986754 104 fIsL0BitSet(kTRUE),
da090841 105 fIsPileUpEvent(kFALSE)
8309c1ab 106{
abf60186 107 // Create an object to read ZDC raw digits
1ee299a5 108 fRawReader->Reset();
362c9d61 109 fRawReader->Select("ZDC");
1ee299a5 110 //
58671297 111 const int kNch = 48;
112 for(Int_t i=0; i<kNch; i++){
c3986754 113 for(Int_t j=0; j<5; j++){
114 fMapADC[i][j]=-1;
115 if(i<32) fScalerMap[i][j]=-1;
116 }
1ee299a5 117 }
da090841 118
119 for(Int_t k=0; k<4; k++) fCPTInput[k] = 0;
1ee299a5 120
8309c1ab 121}
122
123//_____________________________________________________________________________
124AliZDCRawStream::AliZDCRawStream(const AliZDCRawStream& stream) :
a718c993 125 TObject(stream),
c61a7285 126 fRawReader(stream.fRawReader),
1ee299a5 127 fBuffer(stream.GetRawBuffer()),
44455047 128 fReadOutCard(stream.GetReadOutCard()),
1ee299a5 129 fEvType(stream.fEvType),
130 fPosition(stream.fPosition),
131 fIsCalib(stream.fIsCalib),
132 fIsDARCHeader(stream.fIsDARCHeader),
c3986754 133 fIsHeaderMapping(stream.fIsHeaderMapping),
1ee299a5 134 fIsChMapping(stream.fIsChMapping),
135 fIsADCDataWord(stream.fIsADCDataWord),
136 fIsADCHeader(stream.fIsADCHeader),
137 fIsADCEOB(stream.fIsADCEOB),
fee50699 138 fSODReading(stream.fSODReading),
139 fIsMapRead(stream.fIsMapRead),
1ee299a5 140 fDeadfaceOffset(stream.GetDeadfaceOffset()),
141 fDeadbeefOffset(stream.GetDeadbeefOffset()),
142 fDataOffset(stream.GetDataOffset()),
143 fModType(stream.GetModType()),
a718c993 144 fADCModule(stream.GetADCModule()),
1ee299a5 145 fADCNChannels(stream.GetADCNChannels()),
a718c993 146 fADCChannel(stream.GetADCChannel()),
147 fADCValue(stream.GetADCValue()),
148 fADCGain(stream.GetADCGain()),
c33b6ca6 149 fIsUnderflow(stream.fIsUnderflow),
150 fIsOverflow(stream.fIsOverflow),
e42bdf10 151 fScGeo(stream.GetScGeo()),
c083685e 152 fScNWords(stream.GetScNWords()),
153 fScTriggerSource(stream.GetScTriggerSource()),
22fe5e66 154 fScTriggerNumber(stream.fScTriggerNumber),
e42bdf10 155 fIsScEventGood(stream.fIsScEventGood),
c083685e 156 fIsScHeaderRead(stream.fIsScHeaderRead),
157 fScStartCounter(stream.fScStartCounter),
158 fScEvCounter(stream.fScEvCounter),
ad3a602e 159 fIsScalerWord(stream.fIsScalerWord),
da090841 160 fDetPattern(stream.fDetPattern),
161 fTrigCountNWords(stream.fTrigCountNWords),
f70a5526 162 fIsTriggerScaler(stream.fIsTriggerScaler),
da090841 163 fTrigCountStart(stream.fTrigCountStart),
164 fMBTrigInput(stream.fMBTrigInput),
165 fCentralTrigInput(stream.fCentralTrigInput),
166 fSCentralTrigInput(stream.fSCentralTrigInput),
167 fEMDTrigInput(stream.fEMDTrigInput),
168 fL0Received(stream.fL0Received),
169 fMBtrig2CTP(stream.fMBtrig2CTP),
170 fCentralTrig2CTP(stream.fCentralTrig2CTP),
171 fSCentralTrig2CTP(stream.fSCentralTrig2CTP),
172 fEMDTrig2CTP(stream.fEMDTrig2CTP),
173 fTrigHistNWords(stream.fTrigHistNWords),
f70a5526 174 fIsTriggerHistory(stream.fIsTriggerHistory),
175 fTrigHistStart(stream.fTrigHistStart),
da090841 176 fPileUpBit1stWord(stream.fPileUpBit1stWord),
177 fL0Bit1stWord(stream.fL0Bit1stWord),
178 fCentralTrigHist(stream.fCentralTrigHist),
179 fMBTrigHist(stream.fMBTrigHist),
180 fPileUpBit2ndWord(stream.fPileUpBit2ndWord),
181 fL0Bit2ndWord(stream.fL0Bit2ndWord),
182 fSCentralTrigHist(stream.fSCentralTrigHist),
183 fEMDTrigHist(stream.fEMDTrigHist),
9d0b658a 184 fNChannelsOn(stream.fNChannelsOn),
c3986754 185 fCurrentCh(stream.fCurrentCh),
186 fCabledSignal(stream.GetCabledSignal()),
187 fCurrScCh(stream.fCurrScCh),
da090841 188 fIsADCEventGood(stream.fIsADCEventGood),
c3986754 189 fIsL0BitSet(stream.fIsL0BitSet),
da090841 190 fIsPileUpEvent(stream.fIsPileUpEvent)
c3986754 191
8309c1ab 192{
abf60186 193 // Copy constructor
58671297 194 const int kNch = 48;
c0aec6f6 195 for(Int_t j=0; j<2; j++) fSector[j] = stream.GetSector(j);
58671297 196 for(Int_t i=0; i<kNch; i++){
c3986754 197 for(Int_t j=0; j<5; j++){
198 fMapADC[i][j] = stream.fMapADC[i][j];
199 if(i<32) fScalerMap[i][j] = stream.fMapADC[i][j];
200 }
1ee299a5 201 }
da090841 202
203 for(Int_t k=0; k<4; k++) fCPTInput[k] = stream.fCPTInput[k];
8309c1ab 204}
205
206//_____________________________________________________________________________
207AliZDCRawStream& AliZDCRawStream::operator = (const AliZDCRawStream&
208 /* stream */)
209{
abf60186 210 // Assignment operator
8309c1ab 211 Fatal("operator =", "assignment operator not implemented");
212 return *this;
213}
214
215//_____________________________________________________________________________
216AliZDCRawStream::~AliZDCRawStream()
217{
abf60186 218// Destructor
8309c1ab 219
220}
221
1ee299a5 222//_____________________________________________________________________________
c93c022b 223void AliZDCRawStream::ReadChMap()
224{
225 // Reading channel map
58671297 226 const int kNch = 48;
27afc0c8 227 AliDebug(2,"\t Reading ZDC ADC mapping from OCDB\n");
fee50699 228 AliZDCChMap * chMap = GetChMap();
6d653649 229 //chMap->Print("");
58671297 230 for(Int_t i=0; i<kNch; i++){
fee50699 231 fMapADC[i][0] = chMap->GetADCModule(i);
232 fMapADC[i][1] = chMap->GetADCChannel(i);
233 fMapADC[i][2] = -1;
234 fMapADC[i][3] = chMap->GetDetector(i);
235 fMapADC[i][4] = chMap->GetSector(i);
236 }
237 fIsMapRead = kTRUE;
c93c022b 238}
239
240//_____________________________________________________________________________
1ee299a5 241void AliZDCRawStream::ReadCDHHeader()
242{
243 // Reading CDH
244 const AliRawDataHeader* header = fRawReader->GetDataHeader();
245 if(!header) {
9d0b658a 246 AliError(" No CDH in raw data streaming");
1ee299a5 247 fRawReader->AddMajorErrorLog(kCDHError);
fee50699 248 return;
1ee299a5 249 }
250 else{
27afc0c8 251 //printf("\t AliZDCRawStream::ReadCDHHeader -> Data Size = %x\n",fRawReader->GetDataSize());
1ee299a5 252
ac84d2fc 253 UChar_t message = header->GetAttributes();
27afc0c8 254 //printf("\t AliZDCRawStream::ReadCDHHeader -> Attributes %x\n",message);
1ee299a5 255
910216a3 256 if((message & 0xf0) == 0x0){ // PHYSICS RUN
58671297 257 //printf("\t PHYSICS RUN raw data found\n");
258 }
910216a3 259 else if((message & 0xf0) == 0x10){ // COSMIC RUN
65448375 260 //printf("\t STANDALONE_COSMIC RUN raw data found\n");
1ee299a5 261 }
910216a3 262 else if((message & 0xf0) == 0x20){ // PEDESTAL RUN
65448375 263 //printf("\t STANDALONE_PEDESTAL RUN raw data found\n");
1ee299a5 264 }
910216a3 265 else if((message & 0xf0) == 0x30){ // LASER RUN
65448375 266 //printf("\t STANDALONE_LASER RUN raw data found\n");
ac84d2fc 267 }
910216a3 268 else if((message & 0xf0) == 0x40){ // CALIBRATION_CENTRAL RUN
58671297 269 //printf("\t CALIBRATION_CENTRAL RUN raw data found\n");
270 }
910216a3 271 else if((message & 0xf0) == 0x50){ // CALIBRATION_SEMICENTRAL
58671297 272 //printf("\t CALIBRATION_SEMICENTRAL RUN raw data found\n");
273 }
910216a3 274 else if((message & 0xf0) == 0x60){ // CALIBRATION_MB
58671297 275 //printf("\t CALIBRATION_MB RUN raw data found\n");
276 }
910216a3 277 else if((message & 0xf0) == 0x70){ // CALIBRATION_EMD
58671297 278 //printf("\t CALIBRATION_EMD RUN raw data found\n");
279 }
44455047 280 // *** Checking the bit indicating the used readout card
281 // (the payload is different in the 2 cases!)
282 if((message & 0x08) == 0){ // ** DARC card
283 fReadOutCard = 0;
284 fIsDARCHeader = kTRUE;
27afc0c8 285 AliInfo("\t ZDC readout card used: DARC");
44455047 286 }
13390187 287 else if((message & 0x08) == 0x08){ // ** ZRC card
44455047 288 fReadOutCard = 1;
27afc0c8 289 AliInfo("\t ZDC readout card used: ZRC");
44455047 290 }
291
1ee299a5 292 if(header->GetL1TriggerMessage() & 0x1){ // Calibration bit set in CDH
293 fIsCalib = kTRUE;
294 }
27afc0c8 295 //printf("\t AliZDCRawStream::ReadCDHHeader -> L1TriggerMessage %x\n",header->GetL1TriggerMessage());
296 //printf("\t AliZDCRawStream::ReadCDHHeader -> Calibration bit = %d\n",fIsCalib);
1ee299a5 297
298 UInt_t status = header->GetStatus();
299 //printf("\t AliZDCRawStream::ReadCDHHeader -> status = %d\n",status);
f9f99efb 300 if((status & 0x000f) == 0x0001){
c083685e 301 AliDebug(2,"CDH -> DARC trg0 overlap error");
1ee299a5 302 fRawReader->AddMajorErrorLog(kDARCError);
303 }
f9f99efb 304 if((status & 0x000f) == 0x0002){
c083685e 305 AliDebug(2,"CDH -> DARC trg0 missing error");
1ee299a5 306 fRawReader->AddMajorErrorLog(kDARCError);
307 }
f9f99efb 308 if((status & 0x000f) == 0x0004){
c083685e 309 AliDebug(2,"CDH -> DARC data parity error");
1ee299a5 310 fRawReader->AddMajorErrorLog(kDARCError);
311 }
f9f99efb 312 if((status & 0x000f) == 0x0008){
c083685e 313 AliDebug(2,"CDH -> DARC ctrl parity error");
1ee299a5 314 fRawReader->AddMajorErrorLog(kDARCError);
315 }
316 //
f9f99efb 317 if((status & 0x00f0) == 0x0010){
c083685e 318 AliDebug(2,"CDH -> DARC trg unavailable");
1ee299a5 319 fRawReader->AddMajorErrorLog(kDARCError);
320 }
f9f99efb 321 if((status & 0x00f0) == 0x0020){
c3986754 322 AliDebug(2,"CDH -> DARC FEE error");
1ee299a5 323 fRawReader->AddMajorErrorLog(kDARCError);
324 }
325 //
f9f99efb 326 if((status & 0x0f00) == 0x0200){
c083685e 327 AliDebug(2,"CDH -> DARC L1 time violation");
1ee299a5 328 fRawReader->AddMajorErrorLog(kDARCError);
329 }
f9f99efb 330 if((status & 0x0f00) == 0x0400){
c3986754 331 AliDebug(2,"CDH -> DARC L2 time-out");
1ee299a5 332 fRawReader->AddMajorErrorLog(kDARCError);
333 }
f9f99efb 334 if((status & 0x0f00) == 0x0800){
c3986754 335 AliDebug(2,"CDH -> DARC prepulse time violation");
1ee299a5 336 fRawReader->AddMajorErrorLog(kDARCError);
337 }
338 //
f9f99efb 339 if((status & 0xf000) == 0x1000){
c083685e 340 AliDebug(2,"CDH -> DARC other error");
1ee299a5 341 fRawReader->AddMajorErrorLog(kDARCError);
342 }
343 }
44455047 344
1ee299a5 345}
346
8309c1ab 347//_____________________________________________________________________________
348Bool_t AliZDCRawStream::Next()
349{
abf60186 350 // Read the next raw digit
351 // Returns kFALSE if there is no digit left
8309c1ab 352
1ee299a5 353 if(!fRawReader->ReadNextInt((UInt_t&) fBuffer)) return kFALSE;
58671297 354 const int kNch = 48;
25930b52 355 Int_t kFirstADCGeo=0, kLastADCGeo=3, kAddADCGeo=4;
356 Int_t kScalerGeo=8, kPUGeo=29, kTrigScales=30, kTrigHistory=31;
c3986754 357 fIsHeaderMapping = kFALSE; fIsChMapping = kFALSE;
358 fIsADCHeader = kFALSE; fIsADCDataWord = kFALSE; fIsADCEOB = kFALSE;
ad3a602e 359 fIsUnderflow = kFALSE; fIsOverflow = kFALSE; fIsScalerWord = kFALSE;
58671297 360 fSector[0] = fSector[1] = -1;
f70a5526 361// fTrigCountNWords = 9; fTrigHistNWords = 2;
da090841 362 for(Int_t kl=0; kl<4; kl++) fCPTInput[kl] = 0;
363
1ee299a5 364 fEvType = fRawReader->GetType();
1ee299a5 365 if(fPosition==0){
366 //if(fEvType==7 || fEvType ==8){ //Physics or calibration event
1ee299a5 367 ReadCDHHeader();
368 //}
c3986754 369 fCurrentCh=0; fCurrScCh=0; fNChannelsOn=0;
370 // Ch. debug
371 //printf("\n AliZDCRawStream::Next() - ev. type %d",fEvType);
1ee299a5 372 }
ac84d2fc 373
c3986754 374 // Ch. debug
375 //printf("\n AliZDCRawStream::Next() - fBuffer[%d] = %x\n",fPosition, fBuffer);
376
9d0b658a 377 // *** End of ZDC event
ac84d2fc 378 if(fBuffer == 0xcafefade){
27afc0c8 379 //printf("\n AliZDCRawStream::Next() ***** End of ZDC event *****\n\n");
ac84d2fc 380 return kFALSE;
381 }
1ee299a5 382
383 // -------------------------------------------
1069e28d 384 // --- DARC header
1ee299a5 385 // -------------------------------------------
fee50699 386 // If the CDH has been read then
387 // the DARC header must follow
44455047 388 if(fReadOutCard==0 && fIsDARCHeader){
84d2abc2 389 //printf("\t ---- DARC header ----\n");
1ee299a5 390 if(fIsCalib){
391 fDeadfaceOffset = 9;
392 fDeadbeefOffset = 25;
393 }
394 else{
395 fDeadfaceOffset = 1;
396 fDeadbeefOffset = 7;
397 }
398 fDataOffset = 1+fDeadbeefOffset;
399 fIsDARCHeader = kFALSE;
abf60186 400 }
1ee299a5 401
44455047 402 // ---------------------------------------------
403 // --- Start of data event (SOD) ---
404 // --- decoding mapping of connected ADC ch. ---
405 // ---------------------------------------------
fee50699 406 // In the SOD event ADC ch. mapping is written
1e85619e 407 if(fEvType==10){
408 if(fSODReading){
fee50699 409
13390187 410 if(fPosition>=fDataOffset){
c3986754 411 if((fBuffer&0xff000001) == 0xff000001){ // ************** Mapping
8700404e 412 // DARC 1st datum @ fDataOffset+1 \ ZRC 1st valid datum @ fDataOffset=0
13390187 413 if((fPosition==fDataOffset+1) || (fPosition==fDataOffset)){
1e85619e 414 printf("\n\n ------ AliZDCRawStream -> Reading mapping from StartOfData event ------\n");
c3986754 415 fCurrentCh=0; fCurrScCh=0;
6006df88 416 }
1ee299a5 417 else{
1e85619e 418 printf(" ------ AliZDCRawStream -> End of ZDC StartOfData event ------\n\n");
419 fSODReading = kFALSE;
fee50699 420 return kFALSE;
1ee299a5 421 }
422 }
c3986754 423 else if((fBuffer&0xff000002) == 0xff000002){ // ************** Threshold settings
424 fPosition++;
27afc0c8 425 return kFALSE; // !!!!!!!!!!!!!!!!!!!!! For the moment thresholds are not read
c3986754 426 }
427 else if((fBuffer&0x80000000)>>31 == 1){ // --- Mapping header
428 fIsHeaderMapping = kTRUE;
429 fADCModule = ((fBuffer & 0x7f000000)>>24); // GEO address!!!
430 fModType = ((fBuffer & 0x7ff00)>>8);
431 fADCNChannels = (fBuffer & 0xff); // # of channels following the header
1ee299a5 432 //
c083685e 433 printf(" ******** GEO %d, mod. type %d, #ch. %d\n",fADCModule,fModType,fADCNChannels);
6006df88 434 }
c3986754 435 else if((fBuffer&0x80000000)>>31 == 0){ // --- Mapping channel
436 fADCChannel = ((fBuffer & 0x3fff0000)>>16);
437 fCabledSignal = (fBuffer&0xffff);
438 //
27afc0c8 439 if(fModType == kV965){ // ******** ADCs ********************************
480ac371 440 // Channel signal
441 if((fBuffer&0x40000000)>>30==0 && fADCModule<=kLastADCGeo){ // *ZDC* high range chain ADC
c3986754 442 fIsChMapping = kTRUE;
443 fMapADC[fCurrentCh][0] = fADCModule;
444 fMapADC[fCurrentCh][1] = fADCChannel;
445 fMapADC[fCurrentCh][2] = fCabledSignal;
446 // - No. of channels on
447 fNChannelsOn++;
448 //
449 // Determining detector and sector
450 // -----------------------------------------
451 // For the decoding of the following lines
452 // look the enum in AliZDCRawStream.h file
453 // -----------------------------------------
454 if((fCabledSignal>=2 && fCabledSignal<=6) || (fCabledSignal>=26 && fCabledSignal<=30)
455 || fCabledSignal==24 || fCabledSignal==48){
456 fMapADC[fCurrentCh][3] = 4; //ZNA
457 //
27afc0c8 458 if(fCabledSignal==kZNAC || fCabledSignal==kZNACoot) fMapADC[fCurrentCh][4]=0;
c3986754 459 else if(fCabledSignal==3 || fCabledSignal==27) fMapADC[fCurrentCh][4]=1;
460 else if(fCabledSignal==4 || fCabledSignal==28) fMapADC[fCurrentCh][4]=2;
461 else if(fCabledSignal==5 || fCabledSignal==29) fMapADC[fCurrentCh][4]=3;
462 else if(fCabledSignal==6 || fCabledSignal==30) fMapADC[fCurrentCh][4]=4;
463 else if(fCabledSignal==24 || fCabledSignal==48) fMapADC[fCurrentCh][4]=5; //Reference PTM
464 }
465 else if((fCabledSignal>=7 && fCabledSignal<=11) || (fCabledSignal>=31 && fCabledSignal<=35)){
466 fMapADC[fCurrentCh][3] = 5; //ZPA
467 //
468 if(fCabledSignal==7 || fCabledSignal==31) fMapADC[fCurrentCh][4]=0;
469 else if(fCabledSignal==8 || fCabledSignal==32) fMapADC[fCurrentCh][4]=1;
470 else if(fCabledSignal==9 || fCabledSignal==33) fMapADC[fCurrentCh][4]=2;
471 else if(fCabledSignal==10 || fCabledSignal==34) fMapADC[fCurrentCh][4]=3;
472 else if(fCabledSignal==11 || fCabledSignal==35) fMapADC[fCurrentCh][4]=4;
473 }
474 else if((fCabledSignal>=12 && fCabledSignal<=16) || (fCabledSignal>=36 && fCabledSignal<=40)
475 || fCabledSignal==25 || fCabledSignal==49){
476 fMapADC[fCurrentCh][3] = 1; //ZNC
477 //
478 if(fCabledSignal==12 || fCabledSignal==36) fMapADC[fCurrentCh][4]=0;
479 else if(fCabledSignal==13 || fCabledSignal==37) fMapADC[fCurrentCh][4]=1;
480 else if(fCabledSignal==14 || fCabledSignal==38) fMapADC[fCurrentCh][4]=2;
481 else if(fCabledSignal==15 || fCabledSignal==39) fMapADC[fCurrentCh][4]=3;
482 else if(fCabledSignal==16 || fCabledSignal==40) fMapADC[fCurrentCh][4]=4;
483 else if(fCabledSignal==25 || fCabledSignal==49) fMapADC[fCurrentCh][4]=5; //Reference PTM
484 }
485 else if((fCabledSignal>=17 && fCabledSignal<=21) || (fCabledSignal>=41 && fCabledSignal<=45)){
486 fMapADC[fCurrentCh][3] = 2; //ZPC
487 //
488 if(fCabledSignal==17 || fCabledSignal==41) fMapADC[fCurrentCh][4]=0;
489 else if(fCabledSignal==18 || fCabledSignal==42) fMapADC[fCurrentCh][4]=1;
490 else if(fCabledSignal==19 || fCabledSignal==43) fMapADC[fCurrentCh][4]=2;
491 else if(fCabledSignal==20 || fCabledSignal==44) fMapADC[fCurrentCh][4]=3;
492 else if(fCabledSignal==21 || fCabledSignal==45) fMapADC[fCurrentCh][4]=4;
493 }
494 else if(fCabledSignal==22 || fCabledSignal==23 || fCabledSignal==46 || fCabledSignal==47){
495 fMapADC[fCurrentCh][3] = 3; // ZEM
496 //
497 if(fCabledSignal==22 || fCabledSignal==46) fMapADC[fCurrentCh][4]=1;
498 else if(fCabledSignal==23 || fCabledSignal==47) fMapADC[fCurrentCh][4]=2;
499 }
500 //Ch. debug
501 //printf("\tADC mod. %d ch. %d signal %d ",fADCModule,fADCChannel,fCabledSignal);
502 //printf(" det. %d sec. %d\n",fMapADC[fCurrentCh][3],fMapADC[fCurrentCh][4]);
503 //
504 fCurrentCh++;
505 //
506 } // high range channels
507 }// ModType=1 (ADC mapping)
27afc0c8 508 else if(fModType == kV830){ // ******** VME scaler **************************
c3986754 509 fIsChMapping = kTRUE;
510 fScalerMap[fCurrScCh][0] = fADCModule;
511 fScalerMap[fCurrScCh][1] = fADCChannel;
512 fScalerMap[fCurrScCh][2] = fCabledSignal;
c93c022b 513 //
514 // Determining detector and sector
515 // -----------------------------------------
516 // For the decoding of the following lines
517 // look the enum in AliZDCRawStream.h file
518 // -----------------------------------------
c3986754 519 // NOT CONSIDERING OUT OF TIME OR REFERENCE SIGNALS FOR SCALER!!!!!
480ac371 520 if(fCabledSignal>=2 && fCabledSignal<=6 ||
521 fCabledSignal>=61 && fCabledSignal<=65){
c3986754 522 fScalerMap[fCurrScCh][3] = 4; //ZNA
c93c022b 523 //
480ac371 524 if(fCabledSignal==2 || fCabledSignal==61) fScalerMap[fCurrScCh][4]=0;
525 else if(fCabledSignal==3 || fCabledSignal==62) fScalerMap[fCurrScCh][4]=1;
526 else if(fCabledSignal==4 || fCabledSignal==63) fScalerMap[fCurrScCh][4]=2;
527 else if(fCabledSignal==5 || fCabledSignal==64) fScalerMap[fCurrScCh][4]=3;
528 else if(fCabledSignal==6 || fCabledSignal==65) fScalerMap[fCurrScCh][4]=4;
c93c022b 529 }
480ac371 530 else if(fCabledSignal>=7 && fCabledSignal<=11 ||
531 fCabledSignal>=66 && fCabledSignal<=70){
c3986754 532 fScalerMap[fCurrScCh][3] = 5; //ZPA
c93c022b 533 //
480ac371 534 if(fCabledSignal==7 || fCabledSignal==66) fScalerMap[fCurrScCh][4]=0;
535 else if(fCabledSignal==8 || fCabledSignal==67) fScalerMap[fCurrScCh][4]=1;
536 else if(fCabledSignal==9 || fCabledSignal==68) fScalerMap[fCurrScCh][4]=2;
537 else if(fCabledSignal==10 || fCabledSignal==69) fScalerMap[fCurrScCh][4]=3;
538 else if(fCabledSignal==11 || fCabledSignal==70) fScalerMap[fCurrScCh][4]=4;
c93c022b 539 }
480ac371 540 else if(fCabledSignal>=12 && fCabledSignal<=16 ||
541 fCabledSignal>=71 && fCabledSignal<=75){
c3986754 542 fScalerMap[fCurrScCh][3] = 1; //ZNC
c93c022b 543 //
480ac371 544 if(fCabledSignal==12 || fCabledSignal==71) fScalerMap[fCurrScCh][4]=0;
545 else if(fCabledSignal==13 || fCabledSignal==72) fScalerMap[fCurrScCh][4]=1;
546 else if(fCabledSignal==14 || fCabledSignal==73) fScalerMap[fCurrScCh][4]=2;
547 else if(fCabledSignal==15 || fCabledSignal==74) fScalerMap[fCurrScCh][4]=3;
548 else if(fCabledSignal==16 || fCabledSignal==75) fScalerMap[fCurrScCh][4]=4;
c93c022b 549 }
480ac371 550 else if(fCabledSignal>=17 && fCabledSignal<=21 ||
551 fCabledSignal>=76 && fCabledSignal<=80){
c3986754 552 fScalerMap[fCurrScCh][3] = 2; //ZPC
c93c022b 553 //
480ac371 554 if(fCabledSignal==17 || fCabledSignal==76) fScalerMap[fCurrScCh][4]=0;
555 else if(fCabledSignal==18 || fCabledSignal==77) fScalerMap[fCurrScCh][4]=1;
556 else if(fCabledSignal==19 || fCabledSignal==78) fScalerMap[fCurrScCh][4]=2;
557 else if(fCabledSignal==20 || fCabledSignal==79) fScalerMap[fCurrScCh][4]=3;
558 else if(fCabledSignal==21 || fCabledSignal==80) fScalerMap[fCurrScCh][4]=4;
c93c022b 559 }
480ac371 560 else if(fCabledSignal==22 || fCabledSignal==23 ||
561 fCabledSignal==81 || fCabledSignal==82){
c3986754 562 fScalerMap[fCurrScCh][3] = 3; // ZEM
c93c022b 563 //
480ac371 564 if(fCabledSignal==22 || fCabledSignal==81) fScalerMap[fCurrScCh][4]=1;
565 else if(fCabledSignal==23 || fCabledSignal==82) fScalerMap[fCurrScCh][4]=2;
c93c022b 566 }
c3986754 567 // Ch debug.
568 //printf("\t VME scaler mod. %d ch. %d, signal %d",fScalerMap[fCurrScCh][0],fADCChannel,fCabledSignal);
569 //if(fCabledSignal!=0 && fCabledSignal!=1) printf(" det. %d sec. %d\n",fScalerMap[fCurrScCh][3],fScalerMap[fCurrScCh][4]);
570 //else printf(" Signal void/not connected\n");
571
572 fCurrScCh++;
573 }
27afc0c8 574 /*else if(fModType == kTRG){ // **** scalers from trigger card
c3986754 575 //printf("\t Trigger scaler mod. %d ch. %d, signal %d\n",fADCModule,fADCChannel,fCabledSignal);
576 }
27afc0c8 577 else if(fModType == kTRGI){ // **** trigger history from trigger card
c3986754 578 //printf("\t Trigger card ch. %d, signal %d\n",fADCChannel,fCabledSignal);
579 }
27afc0c8 580 else if(fModType == kPU){ // **** pattern unit
c3986754 581 //printf("\t P.U. mod. %d ch. %d, signal %d\n",fADCModule,fADCChannel,fCabledSignal);
27afc0c8 582 }*/
c3986754 583 }//reading channel mapping
1ee299a5 584 }
1e85619e 585 } // if fSODREading
586 fPosition++;
587 return kTRUE;
44455047 588 } // ------------------------------- SOD event
1ee299a5 589
590 // -------------------------------------------
591 // --- DARC data
592 // -------------------------------------------
a5747d8f 593 if(fPosition<fDeadfaceOffset && fReadOutCard==0){
594 fPosition++;
595 return kTRUE;
596 }
597 else if(fPosition==fDeadfaceOffset && fReadOutCard==0){
598 if(fBuffer != 0xdeadface){
a44b6e36 599 //AliWarning(" NO deadface after DARC data");
a5747d8f 600 fRawReader->AddMajorErrorLog(kDARCError);
601 }
602 else{
1ee299a5 603 fPosition++;
604 return kTRUE;
605 }
a5747d8f 606 }
607 else if(fPosition>fDeadfaceOffset && fPosition<fDeadbeefOffset && fReadOutCard==0){
608 fPosition++;
609 return kTRUE;
610 }
611 else if(fPosition==fDeadbeefOffset && fReadOutCard==0){
612 if(fBuffer != 0xdeadbeef){
a44b6e36 613 //AliWarning(" NO deadbeef after DARC global data");
a5747d8f 614 fRawReader->AddMajorErrorLog(kDARCError);
615 fPosition++;
616 return kFALSE;
1ee299a5 617 }
a5747d8f 618 else{
1ee299a5 619 fPosition++;
620 return kTRUE;
621 }
1e85619e 622 } // ------------------------------- End of DARC data
44455047 623
1e85619e 624 // ---------------------------------------------
1ee299a5 625 // --- ZDC data
c3986754 626 // --- ADCs + VME scaler + trigger card + P.U.
1e85619e 627 // ---------------------------------------------
1ee299a5 628 else if(fPosition>=fDataOffset){
fee50699 629
630 //printf("AliZDCRawStream: fSODReading = %d\n", fSODReading);
631 if(!fSODReading && !fIsMapRead) ReadChMap();
632
44455047 633 // !!!!!!!!!!!!!!! DARC readout card only !!!!!!!!!!!
1ee299a5 634 // Not valid datum before the event
635 // there MUST be a NOT valid datum before the event!!!
44455047 636 if(fReadOutCard==0){
a5747d8f 637 if(fPosition==fDataOffset){
44455047 638 //printf("\t **** ZDC data begin ****\n");
639 if((fBuffer & 0x07000000) != 0x06000000){
640 fRawReader->AddMajorErrorLog(kZDCDataError);
641 }
642 else if((fBuffer & 0x07000000) == 0x06000001){ // Corrupted event!!!
643 fIsADCEventGood = kFALSE;
644 }
c3986754 645 }
1ee299a5 646
44455047 647 // If the not valid datum isn't followed by the 1st ADC header
648 // the event is corrupted (i.e., 2 gates arrived before trigger)
a5747d8f 649 else if(fPosition==fDataOffset+1){
44455047 650 if((fBuffer & 0x07000000) != 0x02000000){
651 AliWarning("ZDC ADC -> The not valid datum is NOT followed by an ADC header!");
652 fRawReader->AddMajorErrorLog(kZDCDataError);
653 fIsADCEventGood = kFALSE;
654 fPosition++;
655 return kFALSE;
656 }
1ee299a5 657 }
658 }
659
c3986754 660 // Get geo address of current word
661 // - ADC GEO = 0, 1, 2, 3
662 // - VME scaler GEO = 8
663 // - PU GEO = 29
664 // - Trigger card scales GEO = 30
665 // - Trigger card history GEO = 31
c083685e 666 fADCModule = (Int_t) ((fBuffer & 0xf8000000)>>27);
c083685e 667
c3986754 668 // ************************************ ADC MODULES ************************************
669 if(fADCModule>=kFirstADCGeo && fADCModule<=kLastADCGeo){
1ee299a5 670 // *** ADC header
ac84d2fc 671 if((fBuffer & 0x07000000) == 0x02000000){
1ee299a5 672 fIsADCHeader = kTRUE;
673 fADCNChannels = ((fBuffer & 0x00003f00)>>8);
58671297 674 //printf(" AliZDCRawStream -> ADC HEADER: mod.%d has %d ch. \n",fADCModule,fADCNChannels);
1ee299a5 675 }
676 // *** ADC data word
677 else if((fBuffer & 0x07000000) == 0x00000000){
678 fIsADCDataWord = kTRUE;
679 fADCChannel = ((fBuffer & 0x1e0000) >> 17);
680 fADCGain = ((fBuffer & 0x10000) >> 16);
681 fADCValue = (fBuffer & 0xfff);
c3986754 682 //
683 //printf(" AliZDCRawStream -> ADC DATUM: mod. %d ch. %d gain %d value %d\n",
84d2abc2 684 // fADCModule,fADCChannel,fADCGain,fADCValue);
c93c022b 685
c33b6ca6 686 // Checking if the channel map for the ADCs has been provided/read
687 if(fMapADC[0][0]==-1){
688 printf("\t ATTENTION!!! No ADC mapping has been found/provided!!!\n");
689 return kFALSE;
690 }
691 //
58671297 692 /*for(Int_t ci=0; ci<kNch; ci++){
9d0b658a 693 printf(" %d mod %d ch %d det %d sec %d\n",ci,fMapADC[ci][0],
c33b6ca6 694 fMapADC[ci][1], fMapADC[ci][3], fMapADC[ci][4]);
695 }*/
696
697 // Scan of the map to assign the correct volumes
698 Int_t foundMapEntry = kFALSE;
58671297 699 for(Int_t k=0; k<kNch; k++){
c33b6ca6 700 if(fADCModule==fMapADC[k][0] && fADCChannel==fMapADC[k][1]){
701 fSector[0] = fMapADC[k][3];
702 fSector[1] = fMapADC[k][4];
703 foundMapEntry = kTRUE;
704 break;
705 }
706 }
707 if(foundMapEntry==kFALSE){
c3986754 708 AliWarning(Form(" No valid entry in ADC mapping for raw data %d ADCmod. %d ch. %d\n",
709 fPosition,fADCModule,fADCChannel));
c33b6ca6 710 }
711 //
c3986754 712 //printf("AliZDCRawStream -> ADCmod. %d ch. %d -> det %d sec %d\n",
713 // fADCModule,fADCChannel,fSector[0],fSector[1]);
c33b6ca6 714
715 // Final checks
6d653649 716 if(foundMapEntry==kTRUE){
717 if(fSector[0]<1 || fSector[0]>5){
718 AliWarning(Form(" No valid detector assignment: %d",fSector[0]));
719 fRawReader->AddMajorErrorLog(kInvalidSector);
720 }
721 //
722 if(fSector[1]<0 || fSector[1]>5){
723 AliWarning(Form(" No valid sector assignment: %d",fSector[1]));
724 fRawReader->AddMajorErrorLog(kInvalidSector);
725 }
726 //
727 if(fADCModule<0 || fADCModule>3){
728 AliError(Form(" No valid ADC module: %d",fADCModule));
729 fRawReader->AddMajorErrorLog(kInvalidADCModule);
730 }
c33b6ca6 731 }
1ee299a5 732
c33b6ca6 733 // Checking the underflow and overflow bits
734 if(fBuffer & 0x1000) fIsUnderflow = kTRUE;
735 else if (fBuffer & 0x2000) fIsOverflow = kTRUE;
736
1ee299a5 737 }//ADC data word
738 // *** ADC EOB
739 else if((fBuffer & 0x07000000) == 0x04000000){
740 fIsADCEOB = kTRUE;
741 //printf(" AliZDCRawStream -> EOB --------------------------\n");
742 }
c083685e 743 }//ADC module
25930b52 744 // ********************************* ADD ADC *********************************
745 else if(fADCModule == kAddADCGeo){
746 // *** ADC header
747 if((fBuffer & 0x07000000) == 0x02000000){
748 fIsADCHeader = kTRUE;
749 fADCNChannels = ((fBuffer & 0x00003f00)>>8);
750 //printf(" AliZDCRawStream -> ADC HEADER: mod.%d has %d ch. \n",fADCModule,fADCNChannels);
751 }
752 // *** ADC data word
753 else if((fBuffer & 0x07000000) == 0x00000000){
754 fIsADCDataWord = kTRUE;
755 fADCChannel = ((fBuffer & 0x1e0000) >> 17);
756 fADCGain = ((fBuffer & 0x10000) >> 16);
757 fADCValue = (fBuffer & 0xfff);
758 //
759 //printf(" ADD ADC DATUM -> mod. %d ch. %d gain %d value %d\n",
760 // fADCModule,fADCChannel,fADCGain,fADCValue);
761 }
762 }
da090841 763 // ********************************* VME SCALER HEADER *********************************
c3986754 764 else if(fADCModule == kScalerGeo){
c083685e 765 if(fBuffer & 0x04000000 && fIsScHeaderRead==kFALSE){ // *** Scaler header
766 fScGeo = (fBuffer & 0xf8000000)>>27;
767 fScNWords = (fBuffer & 0x00fc0000)>>18;
768 fScTriggerSource = (fBuffer & 0x00030000)>>16;
769 fScTriggerNumber = (fBuffer & 0x0000ffff);
770 fIsScHeaderRead = kTRUE;
f70a5526 771 fScStartCounter = fPosition;
c083685e 772 //Ch. debug
f70a5526 773 //printf(" AliZDCRawStream -> VME SCALER HEADER: geo %d Nwords %d TrigSource %d TrigNo. %d\n",
c083685e 774 // fScGeo,fScNWords,fScTriggerSource,fScTriggerNumber);
775 }
776 else if(!(fBuffer & 0x04000000)){
777 fIsScEventGood = kFALSE;
778 }
c3986754 779 }
da090841 780 // *********************************** PATTERN UNIT ***********************************
c3986754 781 else if(fADCModule == kPUGeo){
782 // still to be implemented!!! Not yet in data!!!
da090841 783 fDetPattern = (fBuffer & 0x0000003f);
f70a5526 784 // Ch. debug
785 //printf(" AliZDCRawStream -> Pattern Unit\n");
786
c3986754 787 }
da090841 788 // ******************************** TRIGGER CARD COUNTS ********************************
c3986754 789 else if(fADCModule == kTrigScales){
f70a5526 790 if(fIsTriggerScaler == kFALSE){
791 fTrigCountNWords = (Int_t) ((fBuffer & 0xfc0000)>>17);
da090841 792 fTrigCountStart = fPosition;
f70a5526 793 fIsTriggerScaler = kTRUE;
da090841 794 }
f70a5526 795 // Ch. debug
796 //printf(" AliZDCRawStream -> Trigger Scaler header\n");
c3986754 797 }
da090841 798 // ********************************** TRIGGER HISTORY **********************************
c3986754 799 else if(fADCModule == kTrigHistory){
f70a5526 800 if(fIsTriggerHistory == kFALSE){
801 fTrigHistNWords = (Int_t) ((fBuffer & 0xfc0000)>>17);
802 fTrigHistStart = fPosition;
803 fIsTriggerHistory = kTRUE;
da090841 804 }
f70a5526 805 // Ch. debug
806 //printf(" AliZDCRawStream -> Trigger History header\n");
807
c3986754 808 }
da090841 809 // ********************************** VME SCALER DATA **********************************
c3986754 810 // Reading VME scaler data
c083685e 811 if(fIsScHeaderRead && fPosition>=fScStartCounter+1){ // *** Scaler word
ad3a602e 812 fADCModule=kScalerGeo; fIsADCDataWord=kFALSE; fIsScalerWord=kTRUE;
c083685e 813 fScEvCounter = fBuffer;
814 Int_t nWords = (Int_t) (fScNWords);
815 if(fPosition == fScStartCounter+nWords) fIsScHeaderRead = kFALSE;
816 //Ch. debug
817 //printf(" AliZDCRawStream -> scaler datum %d", fScEvCounter);
818 }
f70a5526 819 // ******************************** TRIGGER SCALER DATA ********************************
820 // Reading trigger scaler data
821 if(fIsTriggerScaler && fPosition>=fTrigCountStart+1){
8700404e 822 fADCModule = kTrigScales; fIsADCDataWord = kFALSE;
f70a5526 823 if(fPosition == fTrigCountStart+1) fMBTrigInput = fBuffer;
824 else if(fPosition == fTrigCountStart+2) fCentralTrigInput = fBuffer;
825 else if(fPosition == fTrigCountStart+3) fSCentralTrigInput = fBuffer;
826 else if(fPosition == fTrigCountStart+4) fEMDTrigInput = fBuffer;
827 else if(fPosition == fTrigCountStart+5) fL0Received = fBuffer;
828 else if(fPosition == fTrigCountStart+6) fMBtrig2CTP = fBuffer;
829 else if(fPosition == fTrigCountStart+7) fCentralTrig2CTP = fBuffer;
830 else if(fPosition == fTrigCountStart+8) fSCentralTrig2CTP = fBuffer;
831 else if(fPosition == fTrigCountStart+9){
832 fEMDTrig2CTP = fBuffer;
833 fIsTriggerScaler = kFALSE;
834 }
835 // Ch. debug
836 //printf(" AliZDCRawStream -> Trigger Scaler datum %d\n", fPosition-fTrigCountStart);
837 }
838 // ******************************* TRIGGER HISTORY WORDS ******************************
839 // Reading trigger history
840 if(fIsTriggerHistory && fPosition>=fTrigHistStart+1){
8700404e 841 fADCModule = kTrigHistory; fIsADCDataWord = kFALSE;
f70a5526 842 if(fPosition == fTrigHistStart+1){
843 fPileUpBit1stWord = (fBuffer & 0x80000000) >> 31;
844 fL0Bit1stWord = (fBuffer & 0x40000000) >> 30;
845 fCentralTrigHist = (fBuffer & 0x3fff8000) >> 14;
846 fMBTrigHist = (fBuffer & 0x00007fff);
847 //
848 fCPTInput[0] = (fBuffer & 0x00000080) >> 6; // MB bit
849 fCPTInput[1] = (fBuffer & 0x00400000) >> 21; // CENTRAL bit
850 }
851
852 else if(fPosition == fTrigHistStart+fTrigHistNWords){
853 fPileUpBit2ndWord = (fBuffer & 0x80000000) >> 31;
854 fL0Bit2ndWord = (fBuffer & 0x40000000) >> 30;
855 fSCentralTrigHist = (fBuffer & 0x3fff8000) >> 14;
856 fEMDTrigHist = (fBuffer & 0x00007fff);
857 //
858 fCPTInput[2] = (fBuffer & 0x00000080) >> 6; // SEMICENTRAL bit
859 fCPTInput[3] = (fBuffer & 0x00400000) >> 21; // EMD bit
860 //
861 fIsTriggerHistory = kFALSE;
862
863 // Checking if the event is good
864 // (1) both history word pile up bits must be = 0
865 if(fPileUpBit1stWord==0 && fPileUpBit2ndWord==0) fIsPileUpEvent = kFALSE;
866 else{
867 fIsPileUpEvent = kTRUE;
868 printf(" AliZDCRawStream -> PILE UP EVENT: bitPileUp0 %d bitPileUp1 %d\n",
13390187 869 fPileUpBit1stWord, fPileUpBit2ndWord);
f70a5526 870 }
871 // (2) both history word L0 bits must be = 1
872 if(fL0Bit1stWord==1 && fL0Bit2ndWord==1) fIsL0BitSet = kTRUE;
873 else{
874 fIsL0BitSet = kFALSE;
875 printf(" AliZDCRawStream -> L0 wrongly set: bitL0word0 %d bitL0word1 %d\n",
876 fL0Bit1stWord, fL0Bit2ndWord);
877 }
878 }
879 // Ch. debug
880 //printf(" AliZDCRawStream -> Trigger history word %d\n", fPosition-fTrigHistStart);
881 }
1ee299a5 882
883 }
f70a5526 884
1ee299a5 885 fPosition++;
83347831 886
8309c1ab 887 return kTRUE;
888}
e42bdf10 889
890//_____________________________________________________________________________
fee50699 891AliCDBStorage* AliZDCRawStream::SetStorage(const char *uri)
892{
893 // Setting the storage
894
895 AliCDBStorage *storage = AliCDBManager::Instance()->GetStorage(uri);
896
897 return storage;
898}
899
900
901//_____________________________________________________________________________
902AliZDCChMap* AliZDCRawStream::GetChMap() const
903{
904
905 // Getting calibration object for ZDC
906
907 AliCDBEntry *entry = AliCDBManager::Instance()->Get("ZDC/Calib/ChMap");
908 if(!entry) AliFatal("No calibration data loaded!");
909
910 AliZDCChMap *calibdata = dynamic_cast<AliZDCChMap*> (entry->GetObject());
911 if(!calibdata) AliFatal("Wrong calibration object in calibration file!");
912
913 return calibdata;
914}