Rearrangement of Calibration objects for simulation
authorzampolli <zampolli@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 23 Oct 2007 15:41:29 +0000 (15:41 +0000)
committerzampolli <zampolli@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 23 Oct 2007 15:41:29 +0000 (15:41 +0000)
TOF/Calib/SimParOffline/Run0_999999999_v0_s0.root [deleted file]
TOF/Calib/SimParOnline/Run0_999999999_v0_s0.root [deleted file]
TOF/CreateIdealOnlineCalibPars.C [new file with mode: 0644]
TOF/CreateOnlineCalibPars.C [new file with mode: 0644]

diff --git a/TOF/Calib/SimParOffline/Run0_999999999_v0_s0.root b/TOF/Calib/SimParOffline/Run0_999999999_v0_s0.root
deleted file mode 100644 (file)
index 3a8fd3e..0000000
Binary files a/TOF/Calib/SimParOffline/Run0_999999999_v0_s0.root and /dev/null differ
diff --git a/TOF/Calib/SimParOnline/Run0_999999999_v0_s0.root b/TOF/Calib/SimParOnline/Run0_999999999_v0_s0.root
deleted file mode 100644 (file)
index 0b576e1..0000000
Binary files a/TOF/Calib/SimParOnline/Run0_999999999_v0_s0.root and /dev/null differ
diff --git a/TOF/CreateIdealOnlineCalibPars.C b/TOF/CreateIdealOnlineCalibPars.C
new file mode 100644 (file)
index 0000000..9848f60
--- /dev/null
@@ -0,0 +1,19 @@
+void CreateIdealOnlineCalibPars(){
+  // Create TOF Dummy (delay=0) Offline Calibration Object for reconstruction
+  // and write it on CDB
+  AliTOFcalib *tofcalib = new AliTOFcalib();
+  tofcalib->CreateCalArrays();
+  TObjArray *tofCalOnline = (TObjArray*) tofcalib->GetTOFCalArrayOnline(); 
+  // Write the dummy offline calibration object on CDB
+
+  AliCDBManager *man = AliCDBManager::Instance();
+  man->SetDefaultStorage("local://$ALICE");
+  Int_t nChannels = AliTOFGeometry::NSectors()*(2*(AliTOFGeometry::NStripC()+AliTOFGeometry::NStripB())+AliTOFGeometry::NStripA())*AliTOFGeometry::NpadZ()*AliTOFGeometry::NpadX();
+  for (Int_t ipad = 0 ; ipad<nChannels; ipad++){
+    AliTOFChannelOnline *calChannelOnline = (AliTOFChannelOnline*)tofCalOnline->At(ipad);
+    Float_t delay = 0.;
+    calChannelOnline->SetDelay(delay);
+  }
+  tofcalib->WriteParOnlineOnCDB("TOF/Calib");
+  return;
+}
diff --git a/TOF/CreateOnlineCalibPars.C b/TOF/CreateOnlineCalibPars.C
new file mode 100644 (file)
index 0000000..3b14b85
--- /dev/null
@@ -0,0 +1,23 @@
+void CreateOnlineCalibPars(){
+  // Create TOF Online Calibration Object for reconstruction
+  // and write it on CDB
+  AliTOFcalib *tofcalib = new AliTOFcalib();
+  tofcalib->CreateCalArrays();
+  TObjArray *tofCalOnline = (TObjArray*) tofcalib->GetTOFCalArrayOnline(); 
+  // Write the offline calibration object on CDB
+
+  AliCDBManager *man = AliCDBManager::Instance();
+  man->SetDefaultStorage("local://$ALICE");
+  Int_t nChannels = AliTOFGeometry::NSectors()*(2*(AliTOFGeometry::NStripC()+AliTOFGeometry::NStripB())+AliTOFGeometry::NStripA())*AliTOFGeometry::NpadZ()*AliTOFGeometry::NpadX();
+  Float_t delay=0.;
+  Float_t meanDelay=0.3;
+  Float_t sigmaDelay=0.08;
+  TRandom *rnd   = new TRandom(4357);
+  for (Int_t ipad = 0 ; ipad<nChannels; ipad++){
+    AliTOFChannelOnline *calChannelOnline = (AliTOFChannelOnline*)tofCalOnline->At(ipad);
+    delay = rnd->Gaus(meanDelay,sigmaDelay);
+    calChannelOnline->SetDelay(delay);
+  }
+  tofcalib->WriteParOnlineOnCDB("TOF/Calib");
+  return;
+}