3 #include <TClonesArray.h>
5 #include <TObjString.h>
6 #include <TTimeStamp.h>
8 #include "AliZDCPreprocessor.h"
9 #include "AliCDBManager.h"
10 #include "AliCDBEntry.h"
11 #include "AliCDBMetaData.h"
12 #include "AliDCSValue.h"
13 #include "AliAlignObj.h"
14 #include "AliAlignObjParams.h"
16 #include "AliZDCDataDCS.h"
17 #include "AliZDCChMap.h"
18 #include "AliZDCPedestals.h"
19 #include "AliZDCLaserCalib.h"
20 #include "AliZDCEnCalib.h"
21 #include "AliZDCTowerCalib.h"
23 /////////////////////////////////////////////////////////////////////
25 // Class implementing Shuttle ZDC pre-processor. //
26 // It takes data from DCS and DAQ and writes calibration objects //
27 // in the OCDB and reference values/histos in the ReferenceData. //
29 /////////////////////////////////////////////////////////////////////
31 // ******************************************************************
33 // return=0 : everything OK
34 // return=1 : no DCS input data Map
35 // return=2 : error when storing in RefData DCS processed data
36 // return=3 : error in storing alignment object in OCDB
37 // return=4 : error retrieving/reading data file from DAQ FXS
38 // return=5 : error when storing ADC ch. mapping in OCDB
39 // return=6 : error when storing energy calibration coefficients
40 // return=7 : error when storing tower inter-calibration coefficients
41 // return=8 : error when storing pedestal parameters in OCDB
42 // return=9 : error when storing pedestal histos in RefData
43 // return=10: error when storing laser coefficients in OCDB
44 // return=11: error when storing laser histos in RefData
45 // ******************************************************************
47 ClassImp(AliZDCPreprocessor)
49 //______________________________________________________________________________________________
50 AliZDCPreprocessor::AliZDCPreprocessor(AliShuttleInterface* shuttle) :
51 AliPreprocessor("ZDC", shuttle),
55 // May 2009 - run types updated according to
56 // http://alice-ecs.web.cern.ch/alice-ecs/runtypes_3.36.html
57 AddRunType("STANDALONE_PEDESTAL");
58 AddRunType("STANDALONE_LASER");
59 AddRunType("STANDALONE_COSMIC");
60 AddRunType("CALIBRATION_EMD");
61 AddRunType("CALIBRATION_MB");
62 AddRunType("CALIBRATION_CENTRAL");
63 AddRunType("CALIBRATION_SEMICENTRAL");
64 AddRunType("CALIBRATION_BC");
65 AddRunType("PHYSICS");
69 //______________________________________________________________________________________________
70 AliZDCPreprocessor::~AliZDCPreprocessor()
76 //______________________________________________________________________________________________
77 void AliZDCPreprocessor::Initialize(Int_t run, UInt_t startTime,
80 // Creates AliZDCDataDCS object
82 AliPreprocessor::Initialize(run, startTime, endTime);
84 AliInfo(Form("\n\tRun %d \n\tStartTime %s \n\tEndTime %s \n\tStartTime DCS Query %s \n\tEndTime DCS Query %s", run,
85 TTimeStamp(startTime).AsString(),
86 TTimeStamp(endTime).AsString(), ((TTimeStamp)GetStartTimeDCSQuery()).AsString(), ((TTimeStamp)GetEndTimeDCSQuery()).AsString()));
89 fStartTime = startTime;
92 fData = new AliZDCDataDCS(fRun, fStartTime, fEndTime, GetStartTimeDCSQuery(), GetEndTimeDCSQuery());
95 //_____________________________________________________________________________
96 Bool_t AliZDCPreprocessor::ProcessDCS(){
98 // tells whether DCS should be processed or not
100 TString runType = GetRunType();
101 Log(Form("RunType %s",runType.Data()));
103 if (runType=="STANDALONE_COSMIC" || runType=="STANDALONE_PEDESTAL"){
110 //______________________________________________________________________________________________
111 UInt_t AliZDCPreprocessor::ProcessDCSData(TMap* dcsAliasMap)
114 // Fills data into a AliZDCDataDCS object
115 if(!dcsAliasMap) return 1;
116 Log(Form("Processing data from DCS"));
118 // The processing of the DCS input data is forwarded to AliZDCDataDCS
119 Float_t dcsValues[28]; // DCSAliases=28
120 fData->SetCalibData(dcsValues);
121 Bool_t resDCSProcess = fData->ProcessData(*dcsAliasMap);
122 //dcsAliasMap->Print("");
123 if(resDCSProcess==kFALSE) Log(" Problems in processing DCS DP");
125 // Store DCS data for reference
126 AliCDBMetaData metadata;
127 metadata.SetResponsible("Chiara Oppedisano");
128 metadata.SetComment("DCS data for ZDC");
129 Bool_t resDCSRef = kTRUE;
130 resDCSRef = StoreReferenceData("DCS","Data",fData,&metadata);
132 if(resDCSRef==kFALSE) return 2;
134 // --- Writing ZDC table positions into alignment object
135 TClonesArray *array = new TClonesArray("AliAlignObjParams",10);
136 TClonesArray &alobj = *array;
138 Double_t dx=0., dz=0., dpsi=0., dtheta=0., dphi=0.;
139 // Vertical table position in mm from DCS
140 Double_t dyZN1 = (Double_t) (dcsValues[0]/10.);
141 Double_t dyZP1 = (Double_t) (dcsValues[1]/10.);
142 Double_t dyZN2 = (Double_t) (dcsValues[2]/10.);
143 Double_t dyZP2 = (Double_t) (dcsValues[3]/10.);
145 const char *n1ZDC="ZDC/NeutronZDC_C";
146 const char *p1ZDC="ZDC/ProtonZDC_C";
147 const char *n2ZDC="ZDC/NeutronZDC_A";
148 const char *p2ZDC="ZDC/ProtonZDC_A";
151 AliGeomManager::ELayerID iLayer = AliGeomManager::kInvalidLayer;
152 UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iIndex);
154 new(alobj[0]) AliAlignObjParams(n1ZDC, volid, dx, dyZN1, dz, dpsi, dtheta, dphi, kTRUE);
155 new(alobj[1]) AliAlignObjParams(p1ZDC, volid, dx, dyZP1, dz, dpsi, dtheta, dphi, kTRUE);
156 new(alobj[2]) AliAlignObjParams(n2ZDC, volid, dx, dyZN2, dz, dpsi, dtheta, dphi, kTRUE);
157 new(alobj[3]) AliAlignObjParams(p2ZDC, volid, dx, dyZP2, dz, dpsi, dtheta, dphi, kTRUE);
159 // save in CDB storage
160 AliCDBMetaData mdDCS;
161 mdDCS.SetResponsible("Chiara Oppedisano");
162 mdDCS.SetComment("Alignment object for ZDC");
163 Bool_t resultAl = Store("Align","Data", array, &mdDCS, 0, 0);
164 if(resultAl==kFALSE) return 3;
169 //______________________________________________________________________________________________
170 UInt_t AliZDCPreprocessor::ProcessChMap(TString runType)
174 // Reading the file for mapping from FXS
175 TList* daqSource = GetFileSources(kDAQ, runType.Data());
177 AliError(Form("No sources run %d for run type %s!", fRun, runType.Data()));
180 Log("\t List of DAQ sources for mapping "); daqSource->Print();
182 TIter iter(daqSource);
183 TObjString* source = 0;
185 Int_t readMap[kNch][6];
187 while((source = dynamic_cast<TObjString*> (iter.Next()))){
188 Log(Form("\n\t Getting file #%d\n",++isou));
189 TString fileName = "ZDCChMapping.dat";
191 if(fileName.Length() <= 0){
192 Log(Form("No file from source %s!", source->GetName()));
195 // --- Reading file with calibration data
196 //const char* fname = fileName.Data();
199 if((file = fopen(fileName,"r")) == NULL){
200 printf("Cannot open file %s \n",fileName.Data());
203 Log(Form("File %s connected to process data for ADC mapping", fileName.Data()));
205 for(Int_t j=0; j<kNch; j++){
206 for(Int_t k=0; k<6; k++){
207 int read = fscanf(file,"%d",&readMap[j][k]);
208 if(read == 0) AliDebug(3," Failing in reading data from mapping file");
214 Log(Form("File %s not found", fileName.Data()));
218 delete daqSource; daqSource=0;
220 // Store the currently read map ONLY IF it is different
221 // from the entry in the OCDB
222 Bool_t updateOCDB = kFALSE;
224 AliCDBEntry *cdbEntry = GetFromOCDB("Calib","ChMap");
226 Log(" No existing CDB entry for ADC mapping");
230 AliZDCChMap *chMap = (AliZDCChMap*) cdbEntry->GetObject();
231 for(Int_t i=0; i<kNch; i++){
232 if( (readMap[i][1] == chMap->GetADCModule(i))
233 && (readMap[i][2] == chMap->GetADCChannel(i))
234 && (readMap[i][4] == chMap->GetDetector(i))
235 && (readMap[i][5] == chMap->GetSector(i))){
238 else updateOCDB = kTRUE;
242 Bool_t resChMapStore = kTRUE;
243 if(updateOCDB==kTRUE){
244 Log(" A new entry ZDC/Calib/ChMap will be created");
246 // --- Initializing mapping calibration object
247 AliZDCChMap *mapCalib = new AliZDCChMap("ZDC");
248 // Writing channel map in the OCDB
249 for(Int_t k=0; k<kNch; k++){
250 mapCalib->SetADCModule(k,readMap[k][1]);
251 mapCalib->SetADCChannel(k,readMap[k][2]);
252 mapCalib->SetDetector(k,readMap[k][4]);
253 mapCalib->SetSector(k,readMap[k][5]);
255 //mapCalib->Print("");
257 AliCDBMetaData metaData;
258 metaData.SetBeamPeriod(0);
259 metaData.SetResponsible("Chiara Oppedisano");
260 metaData.SetComment("Filling AliZDCChMap object");
262 resChMapStore = Store("Calib","ChMap",mapCalib, &metaData, 0, 1);
265 Log(" ZDC/Calib/ChMap entry in OCDB is valid and won't be updated");
266 resChMapStore = kTRUE;
269 if(resChMapStore==kFALSE) return 5;
275 //______________________________________________________________________________________________
276 UInt_t AliZDCPreprocessor::ProcessppData()
278 Bool_t resEnCal=kTRUE, resTowCal=kTRUE;
280 // *********** Energy calibration
281 // --- Cheking if there is already the entry in the OCDB
282 AliCDBEntry *cdbEnEntry = GetFromOCDB("Calib", "EnergyCalib");
284 Log(Form(" ZDC/Calib/EnergyCalib entry will be created"));
285 // --- Initializing calibration object
286 AliCDBMetaData metaData;
287 metaData.SetBeamPeriod(0);
288 metaData.SetResponsible("Chiara Oppedisano");
290 AliZDCEnCalib *eCalib = new AliZDCEnCalib("ZDC");
291 for(Int_t j=0; j<6; j++) eCalib->SetEnCalib(j,1.);
292 metaData.SetComment("AliZDCEnCalib object");
294 resEnCal = Store("Calib", "EnergyCalib", eCalib, &metaData, 0, 1);
297 // if entry exists it is still valid (=1 for all runs!)
298 Log(Form(" Valid ZDC/Calib/EnergyCalib object already existing in OCDB!!!"));
302 if(resEnCal==kFALSE) return 6;
305 // *********** Tower inter-calibration
306 // --- Cheking if there is already the entry in the OCDB
307 AliCDBEntry *cdbTowEntry = GetFromOCDB("Calib", "TowerCalib");
309 AliZDCTowerCalib *towCalib = new AliZDCTowerCalib("ZDC");
310 for(Int_t j=0; j<5; j++){
311 towCalib->SetZN1EqualCoeff(j, 1.);
312 towCalib->SetZP1EqualCoeff(j, 1.);
313 towCalib->SetZN2EqualCoeff(j, 1.);
314 towCalib->SetZP2EqualCoeff(j, 1.);
316 //towCalib->Print("");
318 AliCDBMetaData metaData;
319 metaData.SetBeamPeriod(0);
320 metaData.SetResponsible("Chiara Oppedisano");
321 metaData.SetComment("AliZDCTowerCalib object");
323 resTowCal = Store("Calib", "TowerCalib", towCalib, &metaData, 0, 1);
326 // if entry exists it is still valid (=1 for all runs!)
327 Log(Form(" Valid ZDC/Calib/TowerCalib object already existing in OCDB!!!"));
331 if(resTowCal==kFALSE) return 7;
336 //______________________________________________________________________________________________
337 UInt_t AliZDCPreprocessor::ProcessCalibData()
339 TList* daqSources = GetFileSources(kDAQ, "ENERGYCALIB");
341 AliError(Form("No sources for CALIBRATION_EMD run %d !", fRun));
344 Log("\t List of DAQ sources for CALIBRATION_EMD run");
347 TIter iter2(daqSources);
348 TObjString* source = 0;
350 Bool_t resEnCal=kTRUE;
351 while((source = dynamic_cast<TObjString*> (iter2.Next()))){
352 Log(Form("\n\t Getting file #%d\n",++i));
353 TString stringEMDFileName = GetFile(kDAQ, "ENERGYCALIB", source->GetName());
354 if(stringEMDFileName.Length() <= 0){
355 Log(Form("No file from source %s!", source->GetName()));
358 // --- Initializing energy calibration object
359 AliZDCEnCalib *eCalib = new AliZDCEnCalib("ZDC");
360 // --- Reading file with pedestal calibration data
361 const char* emdFileName = stringEMDFileName.Data();
364 if((file = fopen(emdFileName,"r")) == NULL){
365 printf("Cannot open file %s \n",emdFileName);
368 Log(Form("File %s connected to process data from EM dissociation events", emdFileName));
370 Float_t fitValEMD[6];
371 for(Int_t j=0; j<6; j++){
373 int iread = fscanf(file,"%f",&fitValEMD[j]);
374 if(iread==0) AliDebug(3," Failing reading daa from EMD calibration data file");
375 eCalib->SetEnCalib(j,fitValEMD[j]);
382 Log(Form("File %s not found", emdFileName));
387 AliCDBMetaData metaData;
388 metaData.SetBeamPeriod(0);
389 metaData.SetResponsible("Chiara Oppedisano");
390 metaData.SetComment("Filling AliZDCEnCalib object");
392 resEnCal = Store("Calib","EnergyCalib",eCalib, &metaData, 0, 1);
393 if(resEnCal==kFALSE) return 6;
395 delete daqSources; daqSources = 0;
398 TList* daqSourcesH = GetFileSources(kDAQ, "TOWERCALIB");
400 AliError(Form("No sources for CALIBRATION_EMD run %d !", fRun));
403 Log("\t List of DAQ sources for CALIBRATION_EMD run");
404 daqSourcesH->Print();
406 TIter iter2H(daqSourcesH);
407 TObjString* sourceH = 0;
409 Bool_t resTowCal=kTRUE;
410 while((sourceH = dynamic_cast<TObjString*> (iter2H.Next()))){
411 Log(Form("\n\t Getting file #%d\n",++iH));
412 TString stringEMDFileName = GetFile(kDAQ, "TOWERCALIB", sourceH->GetName());
413 if(stringEMDFileName.Length() <= 0){
414 Log(Form("No file from source %s!", sourceH->GetName()));
417 // --- Initializing energy calibration object
418 AliZDCTowerCalib *towCalib = new AliZDCTowerCalib("ZDC");
419 // --- Reading file with pedestal calibration data
420 const char* emdFileName = stringEMDFileName.Data();
423 if((file = fopen(emdFileName,"r")) == NULL){
424 printf("Cannot open file %s \n",emdFileName);
427 Log(Form("File %s connected to process data from EM dissociation events", emdFileName));
429 Float_t equalCoeff[4][5];
430 for(Int_t j=0; j<4; j++){
431 for(Int_t k=0; k<5; k++){
432 int leggi = fscanf(file,"%f",&equalCoeff[j][k]);
433 if(leggi==0) AliDebug(3," Failing reading data from EMD calibration file");
434 if(j==0) towCalib->SetZN1EqualCoeff(k, equalCoeff[j][k]);
435 else if(j==1) towCalib->SetZP1EqualCoeff(k, equalCoeff[j][k]);
436 else if(j==2) towCalib->SetZN2EqualCoeff(k, equalCoeff[j][k]);
437 else if(j==3) towCalib->SetZP2EqualCoeff(k, equalCoeff[j][k]);
444 Log(Form("File %s not found", emdFileName));
447 //towCalib->Print("");
449 AliCDBMetaData metaData;
450 metaData.SetBeamPeriod(0);
451 metaData.SetResponsible("Chiara Oppedisano");
452 metaData.SetComment("Filling AliZDCTowerCalib object");
454 resTowCal = Store("Calib","TowerCalib",towCalib, &metaData, 0, 1);
455 if(resTowCal==kFALSE) return 7;
457 delete daqSources; daqSources = 0;
462 //______________________________________________________________________________________________
463 UInt_t AliZDCPreprocessor::ProcessPedestalData()
465 TList* daqSources = GetFileSources(kDAQ, "PEDESTALDATA");
467 Log(Form("No source for STANDALONE_PEDESTAL run %d !", fRun));
470 Log("\t List of DAQ sources for STANDALONE_PEDESTAL run");
473 TIter iter(daqSources);
474 TObjString* source = 0;
476 Bool_t resPedCal=kTRUE;
477 while((source = dynamic_cast<TObjString*> (iter.Next()))){
478 Log(Form("\n\t Getting file #%d\n",++i));
479 TString stringPedFileName = GetFile(kDAQ, "PEDESTALDATA", source->GetName());
480 if(stringPedFileName.Length() <= 0){
481 Log(Form("No PEDESTAL file from source %s!", source->GetName()));
485 // --- Initializing pedestal calibration object
486 AliZDCPedestals *pedCalib = new AliZDCPedestals("ZDC");
487 // --- Reading file with pedestal calibration data
488 const char* pedFileName = stringPedFileName.Data();
489 // no. ADCch = (22 signal ch. + 2 reference PMs) * 2 gain chain = 48
490 const Int_t knZDCch = 48;
493 if((file = fopen(pedFileName,"r")) == NULL){
494 printf("Cannot open file %s \n",pedFileName);
497 Log(Form("File %s connected to process pedestal data", pedFileName));
498 Float_t pedVal[(2*knZDCch)][2];
499 for(Int_t k=0; k<(2*knZDCch); k++){
500 for(Int_t j=0; j<2; j++){
501 int aleggi = fscanf(file,"%f",&pedVal[k][j]);
502 if(aleggi==0) AliDebug(3," Failing reading data from pedestal file");
503 //if(j==1) printf("pedVal[%d] -> %f, %f \n",k,pedVal[k][0],pedVal[k][1]);
506 pedCalib->SetMeanPed(k,pedVal[k][0]);
507 pedCalib->SetMeanPedWidth(k,pedVal[k][1]);
509 else if(k>=knZDCch && k<(2*knZDCch)){
510 pedCalib->SetOOTPed(k-knZDCch,pedVal[k][0]);
511 pedCalib->SetOOTPedWidth(k-knZDCch,pedVal[k][1]);
513 else if(k>=(2*knZDCch) && k<(3*knZDCch)){
514 pedCalib->SetPedCorrCoeff(k-(2*knZDCch),pedVal[k][0],pedVal[k][1]);
518 //pedCalib->Print("");
520 AliCDBMetaData metaData;
521 metaData.SetBeamPeriod(0);
522 metaData.SetResponsible("Chiara Oppedisano");
523 metaData.SetComment("Filling AliZDCPedestals object");
525 resPedCal = Store("Calib","Pedestals",pedCalib, &metaData, 0, 1);
526 if(resPedCal==kFALSE) return 8;
528 delete daqSources; daqSources = 0;
531 Bool_t resPedHist=kTRUE;
532 TList* daqSourceH = GetFileSources(kDAQ, "PEDHISTOS");
534 Log(Form("No source for STANDALONE_PEDESTAL run %d !", fRun));
537 Log("\t List of DAQ sources for STANDALONE_PEDESTAL run");
540 TIter iterH(daqSourceH);
541 TObjString* sourceH = 0;
543 while((sourceH = dynamic_cast<TObjString*> (iterH.Next()))){
544 Log(Form("\n\t Getting file #%d\n",++iH));
545 TString stringPedFileName = GetFile(kDAQ, "PEDHISTOS", sourceH->GetName());
546 if(stringPedFileName.Length() <= 0){
547 Log(Form("No PEDESTAL file from source %s!", sourceH->GetName()));
550 TFile *histoFile = TFile::Open(stringPedFileName.Data());
552 AliCDBMetaData metadata1;
553 metadata1.SetResponsible("Chiara Oppedisano");
554 metadata1.SetComment("Pedestal histos");
555 resPedHist = StoreReferenceData("Histos","Pedestal", histoFile, &metadata1);
556 if(resPedHist==kFALSE) return 9;
558 delete daqSourceH; daqSourceH = 0;
564 //______________________________________________________________________________________________
565 UInt_t AliZDCPreprocessor::ProcessLaserData()
567 TList* daqSources = GetFileSources(kDAQ, "LASERDATA");
569 AliError(Form("No sources for STANDALONE_LASER run %d !", fRun));
572 Log("\t List of DAQ sources for STANDALONE_LASER run");
575 TIter iter2(daqSources);
576 TObjString* source = 0;
578 Bool_t resLaserCal=kTRUE;
579 while((source = dynamic_cast<TObjString*> (iter2.Next()))){
580 Log(Form("\n\t Getting file #%d\n",++i));
581 TString stringLASERFileName = GetFile(kDAQ, "LASERDATA", source->GetName());
582 if(stringLASERFileName.Length() <= 0){
583 Log(Form("No LASER file from source %s!", source->GetName()));
586 // --- Initializing pedestal calibration object
587 AliZDCLaserCalib *lCalib = new AliZDCLaserCalib("ZDC");
588 // --- Reading file with pedestal calibration data
589 const char* laserFileName = stringLASERFileName.Data();
592 if((file = fopen(laserFileName,"r")) == NULL){
593 printf("Cannot open file %s \n",laserFileName);
596 Log(Form("File %s connected to process data from LASER events", laserFileName));
598 Float_t ivalRead[22][4];
599 for(Int_t j=0; j<22; j++){
600 for(Int_t k=0; k<4; k++){
601 int aleggi = fscanf(file,"%f",&ivalRead[j][k]);
602 if(aleggi==0) AliDebug(3," Failng reading data from laser file");
603 //printf(" %d %1.0f ",k, ivalRead[j][k]);
605 lCalib->SetDetector(j, (Int_t) ivalRead[j][0]);
606 lCalib->SetSector(j, (Int_t) ivalRead[j][1]);
607 lCalib->SetfPMValue(j, ivalRead[j][2]);
608 lCalib->SetfPMWidth(j, ivalRead[j][3]);
613 Log(Form("File %s not found", laserFileName));
618 AliCDBMetaData metaData;
619 metaData.SetBeamPeriod(0);
620 metaData.SetResponsible("Chiara Oppedisano");
621 metaData.SetComment("Filling AliZDCLaserCalib object");
623 resLaserCal = Store("Calib","LaserCalib",lCalib, &metaData, 0, 1);
624 if(resLaserCal==kFALSE) return 10;
626 delete daqSources; daqSources = 0;
629 TList* daqSourceH = GetFileSources(kDAQ, "LASERHISTOS");
631 AliError(Form("No sources for STANDALONE_LASER run %d !", fRun));
634 Log("\t List of DAQ sources for STANDALONE_LASER run");
637 TIter iter2H(daqSourceH);
638 TObjString* sourceH = 0;
640 Bool_t resPedHist = kTRUE;
641 while((sourceH = dynamic_cast<TObjString*> (iter2H.Next()))){
642 Log(Form("\n\t Getting file #%d\n",++iH));
643 TString stringLASERFileName = GetFile(kDAQ, "LASERHISTOS", sourceH->GetName());
644 if(stringLASERFileName.Length() <= 0){
645 Log(Form("No LASER file from source %s!", sourceH->GetName()));
648 TFile *histoFile = TFile::Open(stringLASERFileName.Data());
650 AliCDBMetaData metadata2;
651 metadata2.SetResponsible("Chiara Oppedisano");
652 metadata2.SetComment("Laser run histos");
653 resPedHist = StoreReferenceData("Histos", "Laser", histoFile, &metadata2);
655 if(resPedHist==kFALSE) return 11;
657 delete daqSourceH; daqSourceH = 0;
662 //______________________________________________________________________________________________
663 UInt_t AliZDCPreprocessor::Process(TMap* dcsAliasMap)
667 UInt_t resEnergyCalib=0, resPedestalCalib=0, resLaserCalib=0;
669 // ************************* Process DCS data ****************************
670 if(ProcessDCS()) resDCS = ProcessDCSData(dcsAliasMap);
672 // ********************************* From DAQ ************************************
674 const char* beamType = GetRunParameter("beamType");
675 TString runType = GetRunType();
676 printf("\n\t AliZDCPreprocessor -> beamType %s, runType %s\n",beamType,runType.Data());
678 // ******************************************
679 // ADC channel mapping
680 // ******************************************
681 resChMap = ProcessChMap(runType);
683 // ******************************************
684 // Calibration param. for p-p data (all = 1)
685 // ******************************************
686 // NO ENERGY CALIBRATION -> coefficients set to 1.
687 // Temp -> also inter-calibration coefficients are set to 1.
688 if(strcmp(beamType,"P-P")==0) resEnergyCalib = ProcessppData();
690 // *****************************************************
691 // EMD EVENTS -> Energy calibration and equalization
692 // *****************************************************
693 if(runType=="CALIBRATION_EMD" && strcmp(beamType,"A-A")==0)
694 resEnergyCalib = ProcessCalibData();
696 // *****************************************************
697 // STANDALONE_PEDESTALS -> Pedestal subtraction
698 // *****************************************************
699 if(runType=="STANDALONE_PEDESTAL") resPedestalCalib = ProcessPedestalData();
701 // *****************************************************
702 // STANDALONE_LASER -> Signal stability and ageing
703 // *****************************************************
704 if(runType=="STANDALONE_LASER") resLaserCalib = ProcessLaserData();
707 if(resDCS!=0) return resDCS;
708 else if(resChMap!=0) return resChMap;
709 else if(resEnergyCalib!=0) return resEnergyCalib;
710 else if(resPedestalCalib!=0) return resPedestalCalib;
711 else if(resLaserCalib!=0) return resLaserCalib;