Reading PHOS trigger parameters from OCDB.
authorpolicheh <policheh@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 11 Dec 2011 21:34:35 +0000 (21:34 +0000)
committerpolicheh <policheh@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 11 Dec 2011 21:34:35 +0000 (21:34 +0000)
OCDB/PHOS/Trigger/Parameters/Run158171_999999_v0_s0.root [new file with mode: 0644]
PHOS/AliPHOSRecoParam.cxx
PHOS/AliPHOSRecoParam.h
PHOS/AliPHOSReconstructor.cxx

diff --git a/OCDB/PHOS/Trigger/Parameters/Run158171_999999_v0_s0.root b/OCDB/PHOS/Trigger/Parameters/Run158171_999999_v0_s0.root
new file mode 100644 (file)
index 0000000..55f764b
Binary files /dev/null and b/OCDB/PHOS/Trigger/Parameters/Run158171_999999_v0_s0.root differ
index 31c9639..be3ad2b 100644 (file)
@@ -28,6 +28,7 @@
 ClassImp(AliPHOSRecoParam)
 
 TObjArray* AliPHOSRecoParam::fgkMaps =0; //ALTRO mappings
+TObject*   AliPHOSRecoParam::fgkTrigParams =0; // Trigger parameters
 
 //-----------------------------------------------------------------------------
 AliPHOSRecoParam::AliPHOSRecoParam() :
@@ -219,3 +220,24 @@ void AliPHOSRecoParam::SetNonlinearityCorrectionVersion(const char * ver){
 
 
 }
+
+//-----------------------------------------------------------------------------
+const TObject* AliPHOSRecoParam::GetTriggerParameters()
+{
+  //Returns trigger parameters.
+
+  //Quick check as follows:
+  //  root [0] AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
+  //  root [1] AliCDBManager::Instance()->SetRun(158171);
+  //  root [2] TObject* parameters = AliPHOSRecoParam::GetTriggerParameters();
+  //  root [3] parameters->Print();
+  
+  if(fgkTrigParams) return fgkTrigParams;
+  
+  AliCDBEntry* entry = AliCDBManager::Instance()->Get("PHOS/Trigger/Parameters");
+  if(entry)
+    fgkTrigParams = entry->GetObject();
+  
+  return fgkTrigParams;
+  
+}
index 28be9c6..bd2c3a8 100644 (file)
@@ -78,6 +78,7 @@ public:
 
   static AliPHOSRecoParam* GetDefaultParameters();
   static const  TObjArray* GetMappings();
+  static const  TObject*   GetTriggerParameters();
 
 protected:
 
@@ -108,8 +109,9 @@ protected:
   Bool_t  fCPVUnfold;              // CPV: true if overlapped clusters should be unfolded
 
   static TObjArray* fgkMaps;       // ALTRO mappings for RCU0..RCU3
+  static TObject* fgkTrigParams;   // PHOS trigger parameters
 
-  ClassDef(AliPHOSRecoParam,11)
+  ClassDef(AliPHOSRecoParam,12)
 };
 
 #endif
index c3ce258..e1a8c17 100644 (file)
@@ -453,15 +453,12 @@ void  AliPHOSReconstructor::ConvertDigits(AliRawReader* rawReader, TTree* digits
 
   rawReader->Reset();
   AliPHOSTriggerRawDigiProducer tdp(rawReader);
-
-  AliPHOSTriggerParameters* parameters = new AliPHOSTriggerParameters();
-  readTRUParameters(parameters);
+  
+  AliPHOSTriggerParameters* parameters = (AliPHOSTriggerParameters*)AliPHOSRecoParam::GetTriggerParameters();
   
   tdp.SetTriggerParameters(parameters);
   tdp.ProcessEvent(tdigits);
   
-  delete parameters;
-  
   if (AliLog::GetGlobalDebugLevel() == 1) {
     Int_t modMax=-111;
     Int_t colMax=-111;