Decalibrate simulated data
authorkharlov <kharlov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 2 Sep 2005 14:49:09 +0000 (14:49 +0000)
committerkharlov <kharlov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 2 Sep 2005 14:49:09 +0000 (14:49 +0000)
PHOS/macros/CalibrationDB/AliPHOSDecalibrate.C [new file with mode: 0644]

diff --git a/PHOS/macros/CalibrationDB/AliPHOSDecalibrate.C b/PHOS/macros/CalibrationDB/AliPHOSDecalibrate.C
new file mode 100644 (file)
index 0000000..302d568
--- /dev/null
@@ -0,0 +1,26 @@
+/* $Id$ */
+
+// Digitize and decalibrate events assuming that SDigits 
+// have been already produced.
+// Decalibration coefficients are located in the local file
+// DeCalibDB/PHOS/Calib/GainFactors_and_Pedestals/Run0-10_v0.root
+
+void AliPHOSDecalibrate(Int_t nevents=1)
+{
+  //Load calibration database into aliroot session
+  //and set it to AliPHOSGetter.
+  AliCDBLocal *loc = new AliCDBLocal("DeCalibDB");
+  AliPHOSCalibData* clb = (AliPHOSCalibData*)AliCDBStorage::Instance()
+    ->Get("PHOS/Calib/GainFactors_and_Pedestals",gAlice->GetRunNumber());
+  
+  AliPHOSGetter* gime = AliPHOSGetter::Instance("galice.root");
+  gime->SetCalibData(clb);
+
+
+  AliSimulation sim ; 
+  sim.SetRunGeneration(kFALSE) ;
+  sim.SetMakeSDigits("") ;
+  sim.SetMakeDigits("PHOS") ;
+  sim.Run(nevents) ;  
+}