macros to set and get offset between channels and global offsets
authoralla <Alla.Maevskaya@cern.ch>
Mon, 16 Feb 2015 18:07:29 +0000 (21:07 +0300)
committeralla <Alla.Maevskaya@cern.ch>
Mon, 16 Feb 2015 18:09:10 +0000 (21:09 +0300)
T0/AliT0getTimeAdjust.C [new file with mode: 0644]
T0/AliT0getTimeDelay.C [new file with mode: 0644]
T0/AliT0setTimeAdjust.C [new file with mode: 0644]
T0/AliT0setTimeDelay.C [new file with mode: 0644]

diff --git a/T0/AliT0getTimeAdjust.C b/T0/AliT0getTimeAdjust.C
new file mode 100644 (file)
index 0000000..d5c96ab
--- /dev/null
@@ -0,0 +1,17 @@
+//------------------------------------------------------------------------
+void AliT0getTimeAdjust(Int_t run)
+{
+  // Read calibration coefficients into the Calibration DB
+  AliCDBManager* man = AliCDBManager::Instance();
+  man->SetDefaultStorage("raw://");
+  man->SetRun(run);
+  AliCDBEntry *entry = AliCDBManager::Instance()->Get("T0/Calib/TimeAdjust");
+  AliT0CalibSeasonTimeShift *clb = (AliT0CalibSeasonTimeShift*)entry->GetObject();
+  clb->Print();
+  Float_t *means= clb-> GetT0Means();
+  Float_t *sigmas= clb-> GetT0Sigmas();
+    for (Int_t i=0; i<4; i++) 
+      cout<<means[i]<<" "<<sigmas[i]<<endl;
+
+}
diff --git a/T0/AliT0getTimeDelay.C b/T0/AliT0getTimeDelay.C
new file mode 100644 (file)
index 0000000..7363d0e
--- /dev/null
@@ -0,0 +1,12 @@
+void AliT0getTimeDelay(Int_t run)
+{
+  // Read Calib/TimeDelay entry with channel equalizing and mean CFD position 
+
+  AliCDBManager* man = AliCDBManager::Instance();
+  man->SetDefaultStorage("raw://");
+  man->SetRun(run);
+  AliCDBEntry *entry = AliCDBManager::Instance()->Get("T0/Calib/TimeDelay");
+  AliT0CalibTimeEq *clb = (AliT0CalibTimeEq*)entry->GetObject();
+  clb->Print();
+
+}
diff --git a/T0/AliT0setTimeAdjust.C b/T0/AliT0setTimeAdjust.C
new file mode 100644 (file)
index 0000000..79a3860
--- /dev/null
@@ -0,0 +1,21 @@
+void AliT0setTimeAdjust(Int_t firstRun, Int_t lastRun)
+{
+  // Set T0 alignment OCDB entry calib/TimeAdjust
+  AliT0CalibSeasonTimeShift *clb = new AliT0CalibSeasonTimeShift();
+  Float_t par[4] = {0,0,0,0};
+  Float_t sigmas[4] = {0,0,0,0};
+
+  clb->SetT0Par(par, sigmas);
+  clb->Print();
+
+  AliCDBMetaData md;
+  md.SetResponsible("Alla");
+  TString fPath="T0/Calib/TimeAdjust";
+  AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
+  AliCDBStorage* storage = AliCDBManager::Instance()->GetDefaultStorage();
+  if(storage) {
+    AliCDBId id(fPath.Data(),firstRun, lastRun );
+    storage->Put(clb, id, &md);
+  }
+  
+}
diff --git a/T0/AliT0setTimeDelay.C b/T0/AliT0setTimeDelay.C
new file mode 100644 (file)
index 0000000..a08d262
--- /dev/null
@@ -0,0 +1,24 @@
+void AliT0setTimeDelay(Int_t firstRun, Int_t lastRun)
+{
+  // Writing calibration coefficients into the Calibration DB
+  // Arguments:
+  Int_t beamPeriod =  1;
+  char*   objFormat = "T0 initial time delay";
+  
+  AliT0CalibTimeEq *clb = new AliT0CalibTimeEq();
+  for(Int_t ipmt=0; ipmt<24; ipmt++)  clb->SetTimeEq(ipmt, 0);
+  clb->Print();
+   //Store calibration data into database
+  AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
+  AliCDBMetaData md;
+  md.SetComment(objFormat);
+  md.SetBeamPeriod(beamPeriod);
+  md.SetResponsible("Alla");
+  TString fPath="T0/Calib/TimeDelay";
+  cout<<fPath.Data()<<endl;
+ AliCDBStorage* storage = AliCDBManager::Instance()->GetDefaultStorage();
+  if(storage) {
+     AliCDBId id(fPath.Data(),firstRun, lastRun );
+    storage->Put(clb, id, &md);
+  }
+}