1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 ///////////////////////////////////////////////////////////////////////////////
20 // ZDC digitizer class //
22 ///////////////////////////////////////////////////////////////////////////////
32 // --- AliRoot header files
35 #include "AliHeader.h"
36 #include "AliGenHijingEventHeader.h"
37 #include "AliRunDigitizer.h"
38 #include "AliRunLoader.h"
39 #include "AliGRPObject.h"
40 #include "AliCDBManager.h"
41 #include "AliCDBEntry.h"
42 #include "AliZDCSDigit.h"
43 #include "AliZDCDigit.h"
44 #include "AliZDCFragment.h"
46 #include "AliZDCDigitizer.h"
49 class AliZDCPedestals;
51 ClassImp(AliZDCDigitizer)
54 //____________________________________________________________________________
55 AliZDCDigitizer::AliZDCDigitizer() :
57 fIsSignalInADCGate(kFALSE),
60 fSpectators2Track(kFALSE),
63 // Default constructor
67 //____________________________________________________________________________
68 AliZDCDigitizer::AliZDCDigitizer(AliRunDigitizer* manager):
69 AliDigitizer(manager),
70 fIsCalibration(0), //By default the simulation doesn't create calib. data
71 fIsSignalInADCGate(kFALSE),
73 fPedData(GetPedData()),
74 fSpectators2Track(kFALSE),
77 // Get calibration data
78 if(fIsCalibration!=0) printf("\n\t AliZDCDigitizer -> Creating calibration data (pedestals)\n");
79 for(Int_t i=0; i<6; i++){
80 for(Int_t j=0; j<5; j++)
85 //____________________________________________________________________________
86 AliZDCDigitizer::~AliZDCDigitizer()
93 //____________________________________________________________________________
94 AliZDCDigitizer::AliZDCDigitizer(const AliZDCDigitizer &digitizer):
96 fIsCalibration(digitizer.fIsCalibration),
97 fIsSignalInADCGate(digitizer.fIsSignalInADCGate),
98 fFracLostSignal(digitizer.fFracLostSignal),
99 fPedData(digitizer.fPedData),
100 fSpectators2Track(digitizer.fSpectators2Track),
101 fBeamEnergy(digitizer.fBeamEnergy)
105 for(Int_t i=0; i<6; i++){
106 for(Int_t j=0; j<5; j++){
107 fPMGain[i][j] = digitizer.fPMGain[i][j];
110 for(Int_t i=0; i<2; i++) fADCRes[i] = digitizer.fADCRes[i];
115 //____________________________________________________________________________
116 Bool_t AliZDCDigitizer::Init()
118 // Initialize the digitizer
120 AliCDBEntry* entry = AliCDBManager::Instance()->Get("GRP/GRP/Data");
121 AliGRPObject* grpData = 0x0;
123 TMap* m = dynamic_cast<TMap*>(entry->GetObject()); // old GRP entry
126 grpData = new AliGRPObject();
127 grpData->ReadValuesFromMap(m);
130 grpData = dynamic_cast<AliGRPObject*>(entry->GetObject()); // new GRP entry
133 AliCDBManager::Instance()->UnloadFromCache("GRP/GRP/Data");
135 if(!grpData) AliError("No GRP entry found in OCDB!");
137 TString beamType = grpData->GetBeamType();
138 if(beamType==AliGRPObject::GetInvalidString()){
139 AliError("\t UNKNOWN beam type from GRP obj -> PMT gains not set in ZDC digitizer!!!\n");
142 fBeamEnergy = grpData->GetBeamEnergy();
143 if(fBeamEnergy==AliGRPObject::GetInvalidFloat()){
144 AliWarning("GRP/GRP/Data entry: missing value for the beam energy ! Using 0.");
145 AliError("\t UNKNOWN beam type from GRP obj -> PMT gains not set in ZDC digitizer!!!\n");
149 if((beamType.CompareTo("P-P")) == 0 || (beamType.CompareTo("p-p")) == 0){
150 //PTM gains rescaled to beam energy for p-p
151 if(fBeamEnergy != 0){
152 for(Int_t j = 0; j < 5; j++){
153 fPMGain[0][j] = (661.444/fBeamEnergy+0.000740671)*10000000;
154 fPMGain[1][j] = (864.350/fBeamEnergy+0.002344)*10000000;
155 fPMGain[2][j] = (1.32312-0.000101515*fBeamEnergy)*10000000;
156 fPMGain[3][j] = fPMGain[0][j];
157 fPMGain[4][j] = fPMGain[1][j] ;
159 AliInfo(Form(" PMT gains for p-p @ %1.0f+%1.0f GeV: ZN(%1.0f), ZP(%1.0f), ZEM(%1.0f)\n",
160 fBeamEnergy, fBeamEnergy, fPMGain[0][0], fPMGain[1][0], fPMGain[2][0]));
163 else if((beamType.CompareTo("A-A")) == 0){
164 // PTM gains for Pb-Pb @ 2.7+2.7 A TeV ***************
165 // rescaled for Pb-Pb @ 1.38+1.38 A TeV ***************
166 Float_t scalGainFactor = fBeamEnergy/2760.;
167 for(Int_t j = 0; j < 5; j++){
168 fPMGain[0][j] = 50000./scalGainFactor;
169 fPMGain[1][j] = 100000./scalGainFactor;
170 fPMGain[2][j] = 100000./scalGainFactor;
171 fPMGain[3][j] = 50000./scalGainFactor;
172 fPMGain[4][j] = 100000./scalGainFactor;
173 fPMGain[5][j] = 100000./scalGainFactor;
175 AliInfo(Form(" PMT gains for Pb-Pb @ %1.0f+%1.0f A GeV: ZN(%1.0f), ZP(%1.0f), ZEM(%1.0f)\n",
176 fBeamEnergy, fBeamEnergy, fPMGain[0][0], fPMGain[1][0], fPMGain[2][0]));
180 fADCRes[0] = 0.0000008; // ADC Resolution high gain: 200 fC/adcCh
181 fADCRes[1] = 0.0000064; // ADC Resolution low gain: 25 fC/adcCh
186 //____________________________________________________________________________
187 void AliZDCDigitizer::Exec(Option_t* /*option*/)
189 // Execute digitization
191 // ------------------------------------------------------------
192 // !!! 2nd ZDC set added
193 // *** 1st 3 arrays are digits from REAL (simulated) hits
194 // *** last 2 are copied from simulated digits
195 // --- pm[0][...] = light in ZN side C [C, Q1, Q2, Q3, Q4]
196 // --- pm[1][...] = light in ZP side C [C, Q1, Q2, Q3, Q4]
197 // --- pm[2][...] = light in ZEM [x, 1, 2, x, x]
198 // --- pm[3][...] = light in ZN side A [C, Q1, Q2, Q3, Q4] ->NEW!
199 // --- pm[4][...] = light in ZP side A [C, Q1, Q2, Q3, Q4] ->NEW!
200 // ------------------------------------------------------------
202 for(Int_t iSector1=0; iSector1<5; iSector1++)
203 for(Int_t iSector2=0; iSector2<5; iSector2++){
204 pm[iSector1][iSector2] = 0;
207 // ------------------------------------------------------------
208 // ### Out of time ADC added (22 channels)
209 // --- same codification as for signal PTMs (see above)
210 // ------------------------------------------------------------
212 for(Int_t iSector1=0; iSector1<5; iSector1++)
213 for(Int_t iSector2=0; iSector2<5; iSector2++){
214 pmoot[iSector1][iSector2] = 0;
217 // impact parameter and number of spectators
219 Int_t specNTarg = 0, specPTarg = 0;
220 Int_t specNProj = 0, specPProj = 0;
221 Float_t signalTime0 = 0.;
223 // loop over input streams
224 for(Int_t iInput = 0; iInput<fManager->GetNinputs(); iInput++){
226 // get run loader and ZDC loader
227 AliRunLoader* runLoader =
228 AliRunLoader::GetRunLoader(fManager->GetInputFolderName(iInput));
229 AliLoader* loader = runLoader->GetLoader("ZDCLoader");
230 if(!loader) continue;
233 loader->LoadSDigits();
234 TTree* treeS = loader->TreeS();
237 AliZDCSDigit* psdigit = &sdigit;
238 treeS->SetBranchAddress("ZDC", &psdigit);
241 for(Int_t iSDigit=0; iSDigit<treeS->GetEntries(); iSDigit++){
242 treeS->GetEntry(iSDigit);
244 if(!psdigit) continue;
245 if((sdigit.GetSector(1) < 0) || (sdigit.GetSector(1) > 4)){
246 AliError(Form("\nsector[0] = %d, sector[1] = %d\n",
247 sdigit.GetSector(0), sdigit.GetSector(1)));
250 // Checking if signal is inside ADC gate
251 if(iSDigit==0) signalTime0 = sdigit.GetTrackTime();
253 // Assuming a signal lenght of 20 ns, signal is in gate if
254 // signal ENDS in signalTime0+50. -> sdigit.GetTrackTime()+20<=signalTime0+50.
255 if(sdigit.GetTrackTime()<=signalTime0+30.) fIsSignalInADCGate = kTRUE;
256 if(sdigit.GetTrackTime()>signalTime0+30.){
257 fIsSignalInADCGate = kFALSE;
258 // Vedi quaderno per spiegazione approx. usata
259 // nel calcolo della fraz. di segnale perso
260 fFracLostSignal = (sdigit.GetTrackTime()-30)*(sdigit.GetTrackTime()-30)/280.;
264 Float_t sdSignal = sdigit.GetLightPM();
265 if(fIsSignalInADCGate == kFALSE){
266 AliDebug(2,Form("\t Signal time %f -> fraction %f of ZDC signal for det.(%d, %d) out of ADC gate\n",
267 sdigit.GetTrackTime(),fFracLostSignal,sdigit.GetSector(0),sdigit.GetSector(1)));
268 sdSignal = (1-fFracLostSignal)*sdSignal;
271 pm[(sdigit.GetSector(0))-1][sdigit.GetSector(1)] += sdigit.GetLightPM();
273 /*printf("\t Detector %d, Tower %d -> pm[%d][%d] = %.0f \n",
274 sdigit.GetSector(0), sdigit.GetSector(1),sdigit.GetSector(0)-1,
275 sdigit.GetSector(1), pm[sdigit.GetSector(0)-1][sdigit.GetSector(1)]);
280 loader->UnloadSDigits();
282 // get the impact parameter and the number of spectators in case of hijing
283 if(!runLoader->GetAliRun()) runLoader->LoadgAlice();
284 AliHeader* header = runLoader->GetHeader();
285 if(!header) continue;
286 AliGenEventHeader* genHeader = header->GenEventHeader();
287 if(!genHeader) continue;
288 if(!genHeader->InheritsFrom(AliGenHijingEventHeader::Class())) continue;
290 if(fSpectators2Track==kTRUE){
291 impPar = ((AliGenHijingEventHeader*) genHeader)->ImpactParameter();
292 specNProj = ((AliGenHijingEventHeader*) genHeader)->ProjSpectatorsn();
293 specPProj = ((AliGenHijingEventHeader*) genHeader)->ProjSpectatorsp();
294 specNTarg = ((AliGenHijingEventHeader*) genHeader)->TargSpectatorsn();
295 specPTarg = ((AliGenHijingEventHeader*) genHeader)->TargSpectatorsp();
296 printf("\n\t AliZDCDigitizer: b = %1.2f fm\n"
297 " \t PROJ.: #spectator n %d, #spectator p %d\n"
298 " \t TARG.: #spectator n %d, #spectator p %d\n\n",
299 impPar, specNProj, specPProj, specNTarg, specPTarg);
304 // Applying fragmentation algorithm and adding spectator signal
305 if(fSpectators2Track==kTRUE && impPar) {
306 Int_t freeSpecNProj, freeSpecPProj;
307 Fragmentation(impPar, specNProj, specPProj, freeSpecNProj, freeSpecPProj);
308 Int_t freeSpecNTarg, freeSpecPTarg;
309 Fragmentation(impPar, specNTarg, specPTarg, freeSpecNTarg, freeSpecPTarg);
310 SpectatorSignal(1, freeSpecNProj, pm);
311 //printf(" AliZDCDigitizer -> Signal for %d PROJ free spectator n",freeSpecNProj);
312 SpectatorSignal(2, freeSpecPProj, pm);
313 //printf(" and %d free spectator p added\n",freeSpecPProj);
314 SpectatorSignal(3, freeSpecNTarg, pm);
315 //printf(" AliZDCDigitizer -> Signal for %d TARG free spectator n",freeSpecNTarg);
316 SpectatorSignal(4, freeSpecPTarg, pm);
317 //printf("and %d free spectator p added\n",freeSpecPTarg);
321 // get the output run loader and loader
322 AliRunLoader* runLoader =
323 AliRunLoader::GetRunLoader(fManager->GetOutputFolderName());
324 AliLoader* loader = runLoader->GetLoader("ZDCLoader");
326 AliError("no ZDC loader found");
330 // create the output tree
331 const char* mode = "update";
332 if(runLoader->GetEventNumber() == 0) mode = "recreate";
333 loader->LoadDigits(mode);
334 loader->MakeTree("D");
335 TTree* treeD = loader->TreeD();
337 AliZDCDigit* pdigit = &digit;
338 const Int_t kBufferSize = 4000;
339 treeD->Branch("ZDC", "AliZDCDigit", &pdigit, kBufferSize);
343 Int_t digi[2], digioot[2];
344 for(sector[0]=1; sector[0]<6; sector[0]++){
345 for(sector[1]=0; sector[1]<5; sector[1]++){
346 if((sector[0]==3) && ((sector[1]<1) || (sector[1]>2))) continue;
347 for(Int_t res=0; res<2; res++){
348 digi[res] = Phe2ADCch(sector[0], sector[1], pm[sector[0]-1][sector[1]], res)
349 + Pedestal(sector[0], sector[1], res);
351 new(pdigit) AliZDCDigit(sector, digi);
355 //printf("\t DIGIT added -> det %d quad %d - digi[0,1] = [%d, %d]\n",
356 // sector[0], sector[1], digi[0], digi[1]); // Chiara debugging!
359 } // Loop over detector
360 // Adding in-time digits for 2 reference PTM signals (after signal ch.)
361 // (for the moment the ref. signal is completely invented assuming a PMgain of 5*10^4!)
365 // Reference signal are set to 100 (high gain chain) and 800 (low gain chain)
366 if(fIsCalibration==0) {sigRef[0]=100; sigRef[1]=800;}
367 else {sigRef[0]=0; sigRef[1]=0;} // calibration -> simulation of pedestal values
369 for(Int_t iref=0; iref<2; iref++){
370 sectorRef[0] = 3*iref+1;
371 for(Int_t res=0; res<2; res++){
372 sigRef[res] += Pedestal(sectorRef[0], sectorRef[1], res);
374 new(pdigit) AliZDCDigit(sectorRef, sigRef);
378 //printf("\t RefDigit added -> det = %d, quad = %d - digi[0,1] = [%d, %d]\n",
379 // sectorRef[0], sectorRef[1], sigRef[0], sigRef[1]); // Chiara debugging!
382 // --- Adding digits for out-of-time channels after signal digits
383 for(sector[0]=1; sector[0]<6; sector[0]++){
384 for(sector[1]=0; sector[1]<5; sector[1]++){
385 if((sector[0]==3) && ((sector[1]<1) || (sector[1]>2))) continue;
386 for(Int_t res=0; res<2; res++){
387 digioot[res] = Pedestal(sector[0], sector[1], res); // out-of-time ADCs
389 new(pdigit) AliZDCDigit(sector, digioot);
393 //printf("\t DIGIToot added -> det = %d, quad = %d - digi[0,1] = [%d, %d]\n",
394 // sector[0], sector[1], digioot[0], digioot[1]); // Chiara debugging!
397 // Adding out-of-time digits for 2 reference PTM signals (after out-of-time ch.)
399 for(Int_t iref=0; iref<2; iref++){
400 sectorRef[0] = 3*iref+1;
401 for(Int_t res=0; res<2; res++){
402 sigRefoot[res] = Pedestal(sectorRef[0], sectorRef[1], res);
404 new(pdigit) AliZDCDigit(sectorRef, sigRefoot);
407 //printf("\t RefDigitoot added -> det = %d, quad = %d - digi[0,1] = [%d, %d]\n",
408 // sectorRef[0], sectorRef[1], sigRefoot[0], sigRefoot[1]); // Chiara debugging!
411 //printf("\t AliZDCDigitizer -> TreeD has %d entries\n",(Int_t) treeD->GetEntries());
413 // write the output tree
414 loader->WriteDigits("OVERWRITE");
415 loader->UnloadDigits();
419 //_____________________________________________________________________________
420 void AliZDCDigitizer::Fragmentation(Float_t impPar, Int_t specN, Int_t specP,
421 Int_t &freeSpecN, Int_t &freeSpecP) const
423 // simulate fragmentation of spectators
425 AliZDCFragment frag(impPar);
427 // Fragments generation
429 Int_t nAlpha = frag.GetNalpha();
432 Int_t ztot = frag.GetZtot();
433 Int_t ntot = frag.GetNtot();
434 frag.AttachNeutrons();
435 freeSpecN = specN-ntot-2*nAlpha;
436 freeSpecP = specP-ztot-2*nAlpha;
437 // Removing deuterons
438 Int_t ndeu = (Int_t) (freeSpecN*frag.DeuteronNumber());
441 if(freeSpecN<0) freeSpecN=0;
442 if(freeSpecP<0) freeSpecP=0;
443 AliDebug(2, Form("FreeSpn = %d, FreeSpp = %d", freeSpecN, freeSpecP));
446 //_____________________________________________________________________________
447 void AliZDCDigitizer::SpectatorSignal(Int_t SpecType, Int_t numEvents,
448 Float_t pm[5][5]) const
450 // add signal of the spectators
452 TFile *specSignalFile = TFile::Open("$ALICE_ROOT/ZDC/SpectatorSignal.root");
453 if(!specSignalFile || !specSignalFile->IsOpen()) {
454 AliError((" Opening file $ALICE_ROOT/ZDC/SpectatorSignal.root failed\n"));
460 Float_t sqrtS = 2*fBeamEnergy;
462 if(TMath::Abs(sqrtS-5500) < 100.){
463 specSignalFile->cd("energy5500");
465 if(SpecType == 1) { // --- Signal for projectile spectator neutrons
466 specSignalFile->GetObject("energy5500/ZNCSignal;1",zdcSignal);
467 if(!zdcSignal) AliError(" PROBLEM!!! Can't retrieve ZNCSignal from SpectatorSignal.root file");
469 else if(SpecType == 2) { // --- Signal for projectile spectator protons
470 specSignalFile->GetObject("energy5500/ZPCSignal;1",zdcSignal);
471 if(!zdcSignal) AliError(" PROBLEM!!! Can't retrieve ZPCSignal from SpectatorSignal.root file");
473 else if(SpecType == 3) { // --- Signal for target spectator neutrons
474 specSignalFile->GetObject("energy5500/ZNASignal;1",zdcSignal);
475 if(!zdcSignal) AliError(" PROBLEM!!! Can't retrieve ZNASignal from SpectatorSignal.root file");
477 else if(SpecType == 4) { // --- Signal for target spectator protons
478 specSignalFile->GetObject("energy5500/ZPASignal;1",zdcSignal);
479 if(!zdcSignal) AliError(" PROBLEM!!! Can't retrieve ZPASignal from SpectatorSignal.root file");
482 else if(TMath::Abs(sqrtS-2760) < 100.){
483 specSignalFile->cd("energy2760");
485 if(SpecType == 1) { // --- Signal for projectile spectator neutrons
486 specSignalFile->GetObject("energy2760/ZNCSignal;1",zdcSignal);
487 if(!zdcSignal) AliError(" PROBLEM!!! Can't retrieve ZNCSignal from SpectatorSignal.root file");
489 else if(SpecType == 2) { // --- Signal for projectile spectator protons
490 specSignalFile->GetObject("energy2760/ZPCSignal;1",zdcSignal);
491 if(!zdcSignal) AliError(" PROBLEM!!! Can't retrieve ZPCSignal from SpectatorSignal.root file");
493 else if(SpecType == 3) { // --- Signal for target spectator neutrons
494 specSignalFile->GetObject("energy2760/ZNASignal;1",zdcSignal);
495 if(!zdcSignal) AliError(" PROBLEM!!! Can't retrieve ZNASignal from SpectatorSignal.root file");
497 else if(SpecType == 4) { // --- Signal for target spectator protons
498 specSignalFile->GetObject("energy2760/ZPASignal;1",zdcSignal);
499 if(!zdcSignal) AliError(" PROBLEM!!! Can't retrieve ZPASignal from SpectatorSignal.root file");
503 Int_t nentries = (Int_t) zdcSignal->GetEntries();
506 Int_t pl, i, k, iev=0, rnd[125], volume[2];
507 for(pl=0;pl<125;pl++) rnd[pl] = 0;
508 if(numEvents > 125) {
509 AliDebug(2,Form("numEvents (%d) is larger than 125", numEvents));
512 for(pl=0;pl<numEvents;pl++){
513 rnd[pl] = (Int_t) (9999*gRandom->Rndm());
514 if(rnd[pl] >= 9999) rnd[pl] = 9998;
515 //printf(" rnd[%d] = %d\n",pl,rnd[pl]);
517 // Sorting vector in ascending order with C function QSORT
518 qsort((void*)rnd,numEvents,sizeof(Int_t),comp);
520 for(i=0; i<nentries; i++){
521 zdcSignal->GetEvent(i);
522 entry = zdcSignal->GetArgs();
523 if(entry[0] == rnd[iev]){
524 for(k=0; k<2; k++) volume[k] = (Int_t) entry[k+1];
526 Float_t lightQ = entry[7];
527 Float_t lightC = entry[8];
529 if(volume[0] != 3) { // ZN or ZP
530 pm[volume[0]-1][0] += lightC;
531 pm[volume[0]-1][volume[1]] += lightQ;
532 //printf("\n pm[%d][0] = %.0f, pm[%d][%d] = %.0f\n",(volume[0]-1),pm[volume[0]-1][0],
533 // (volume[0]-1),volume[1],pm[volume[0]-1][volume[1]]);
536 if(volume[1] == 1) pm[2][1] += lightC; // ZEM 1
537 else pm[2][2] += lightQ; // ZEM 2
538 //printf("\n pm[2][1] = %.0f, pm[2][2] = %.0f\n",pm[2][1],pm[2][2]);
541 else if(entry[0] > rnd[iev]){
546 }while(iev<numEvents);
548 specSignalFile->Close();
549 delete specSignalFile;
553 //_____________________________________________________________________________
554 Int_t AliZDCDigitizer::Phe2ADCch(Int_t Det, Int_t Quad, Float_t Light,
557 // Evaluation of the ADC channel corresponding to the light yield Light
558 Int_t vADCch = (Int_t) (Light * fPMGain[Det-1][Quad] * fADCRes[Res]);
560 //printf("\t Phe2ADCch -> det %d quad %d - PMGain[%d][%d] %1.0f phe %1.2f ADC %d\n",
561 // Det,Quad,Det-1,Quad,fPMGain[Det-1][Quad],Light,vADCch);
566 //_____________________________________________________________________________
567 Int_t AliZDCDigitizer::Pedestal(Int_t Det, Int_t Quad, Int_t Res) const
569 // Returns a pedestal for detector det, PM quad, channel with res.
573 if(fIsCalibration == 0){
574 Int_t index=0, kNch=24;
576 if(Det==1) index = Quad+kNch*Res; // ZNC
577 else if(Det==2) index = (Quad+5)+kNch*Res; // ZPC
578 else if(Det==3) index = (Quad+9)+kNch*Res; // ZEM
579 else if(Det==4) index = (Quad+12)+kNch*Res; // ZNA
580 else if(Det==5) index = (Quad+17)+kNch*Res; // ZPA
582 else index = (Det-1)/3+22+kNch*Res; // Reference PMs
584 Float_t meanPed = fPedData->GetMeanPed(index);
585 Float_t pedWidth = fPedData->GetMeanPedWidth(index);
586 pedValue = gRandom->Gaus(meanPed,pedWidth);
588 /*printf("\t AliZDCDigitizer::Pedestal -> det %d quad %d res %d - Ped[%d] = %d\n",
589 Det, Quad, Res, index,(Int_t) pedValue); // Chiara debugging!
592 // To create calibration object
594 if(Res == 0) pedValue = gRandom->Gaus((35.+10.*gRandom->Rndm()),(0.5+0.2*gRandom->Rndm())); //High gain
595 else pedValue = gRandom->Gaus((250.+100.*gRandom->Rndm()),(3.5+2.*gRandom->Rndm())); //Low gain
598 return (Int_t) pedValue;
601 //_____________________________________________________________________________
602 AliCDBStorage* AliZDCDigitizer::SetStorage(const char *uri)
605 Bool_t deleteManager = kFALSE;
607 AliCDBManager *manager = AliCDBManager::Instance();
608 AliCDBStorage *defstorage = manager->GetDefaultStorage();
610 if(!defstorage || !(defstorage->Contains("ZDC"))){
611 AliWarning("No default storage set or default storage doesn't contain ZDC!");
612 manager->SetDefaultStorage(uri);
613 deleteManager = kTRUE;
616 AliCDBStorage *storage = manager->GetDefaultStorage();
619 AliCDBManager::Instance()->UnsetDefaultStorage();
620 defstorage = 0; // the storage is killed by AliCDBManager::Instance()->Destroy()
626 //_____________________________________________________________________________
627 AliZDCPedestals* AliZDCDigitizer::GetPedData() const
630 // Getting pedestal calibration object for ZDC set
632 AliCDBEntry *entry = AliCDBManager::Instance()->Get("ZDC/Calib/Pedestals");
633 if(!entry) AliFatal("No calibration data loaded!");
635 AliZDCPedestals *calibdata = dynamic_cast<AliZDCPedestals*> (entry->GetObject());
636 if(!calibdata) AliFatal("Wrong calibration object in calibration file!");