]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EMCAL/macros/CalibrationDB/AliEMCALDecalibrate.C
Calibration macros directory
[u/mrichter/AliRoot.git] / EMCAL / macros / CalibrationDB / AliEMCALDecalibrate.C
1
2 // Digitize and decalibrate events assuming that SDigits 
3 // have been already produced.
4 // Decalibration coefficients are located in the local file
5 // DeCalibDB/EMCAL/Calib/GainFactors_and_Pedestals/Run_xxx.root
6 // Author: Boris Polichtchouk (Boris.Polichtchouk@cern.ch)
7 // Modified from PHOS script for EMCAL by Gustavo Conesa
8
9 void AliEMCALDecalibrate(Int_t nevents=3)
10 {
11
12   //Load (de)calibration database into aliroot session
13   //and set it to AliEMCALGetter.
14   
15   AliEMCALCalibData* deCal  = (AliEMCALCalibData*)(AliCDBManager::Instance()
16     ->GetStorage("local://DeCalibDB")->Get("EMCAL/Calib/GainFactors_and_Pedestals",1)
17     ->GetObject());
18   
19   //Loader  
20   AliRunLoader* rl=0x0;
21   
22   rl = AliRunLoader::Open("galice.root",
23                           AliConfig::GetDefaultEventFolderName(),
24                           "update");
25   if (rl == 0x0)
26     {
27       gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
28       return;
29     }
30
31   AliEMCALLoader *emcalLoader = dynamic_cast<AliEMCALLoader*>
32     (rl->GetDetectorLoader("EMCAL"));
33   //  rl->LoadSDigits("EMCAL");
34   emcalLoader->SetCalibData(deCal);
35
36   AliSimulation sim ; 
37   sim.SetRunGeneration(kFALSE) ;
38   sim.SetMakeSDigits("") ;
39   sim.SetMakeDigits("EMCAL") ;
40   sim.Run(nevents) ;  
41 }