]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
First prototype of the reco-param classes. Removal of static instance in the muon...
authorcvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 12 Jun 2008 13:57:47 +0000 (13:57 +0000)
committercvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 12 Jun 2008 13:57:47 +0000 (13:57 +0000)
MUON/AliMUONReconstructor.cxx
STEER/AliDetectorRecoParam.cxx
STEER/AliDetectorRecoParam.h
STEER/AliEventInfo.cxx [new file with mode: 0644]
STEER/AliEventInfo.h [new file with mode: 0644]
STEER/AliRecoParam.cxx
STEER/AliRecoParam.h
STEER/STEERLinkDef.h
STEER/libSTEER.pkg

index d34ad4969a28eb2329d62aa5165256b721b2873d..b3b94c5768e731151fc45002f47a7cbb2106f352 100644 (file)
@@ -178,25 +178,9 @@ const AliMUONRecoParam* AliMUONReconstructor::GetRecoParam()
 {
   /// get reconstruction parameters
   
-  if (!fgRecoParam) {
-    
-    // get reconstruction parameters from AliRecoParam if any
-    TObjArray *recoParams = AliRecoParam::Instance()->GetRecoParam("MUON");
-    
-    if (recoParams) {
-      
-      fgRecoParam = (AliMUONRecoParam*) recoParams->Last();
-      
-    } else {
-      
-      // initialize reconstruction parameters if not already done
-      cout<<"W-AliMUONReconstructor::GetRecoParam: Reconstruction parameters not initialized - Use default one"<<endl;
-      fgRecoParam = AliMUONRecoParam::GetLowFluxParam();
-      AliRecoParam::Instance()->RegisterRecoParam(fgRecoParam);
-      
-    }
-    
-  }
+  // initialize reconstruction parameters if not already done
+  cout<<"W-AliMUONReconstructor::GetRecoParam: Reconstruction parameters not initialized - Use default one"<<endl;
+  fgRecoParam = AliMUONRecoParam::GetLowFluxParam();
   
   return fgRecoParam;
 }
index 9e71434ec07e36d0ff3c0b71934a82ea5214b4fc..3acfae6d8db03d3cb9d1d1b243916a6cd88d25b5 100644 (file)
@@ -40,7 +40,6 @@ AliDetectorRecoParam::AliDetectorRecoParam():
   //
   // default constructor
   //
-  for (Int_t i=0;i<5; i++) fEventType[i]=0;
 }
 
 AliDetectorRecoParam::~AliDetectorRecoParam(){
index cd083df687659a26d8fadd321833c63b26a5d53a..1ac3fb2d22ce71ff1a828ad9c5b2018539114bc3 100644 (file)
@@ -19,11 +19,11 @@ class AliDetectorRecoParam : public TNamed
   AliDetectorRecoParam();
   virtual ~AliDetectorRecoParam();
   void  Print(Option_t */*option*/) const {Dump();}
-  const Int_t * GetEventType() { return fEventType;}
+
 protected:
-  Int_t fEventType[5]; // Reconstruction - event type        
+
   
-  ClassDef(AliDetectorRecoParam, 1)
+  ClassDef(AliDetectorRecoParam, 2)
 };
 
 
diff --git a/STEER/AliEventInfo.cxx b/STEER/AliEventInfo.cxx
new file mode 100644 (file)
index 0000000..243918f
--- /dev/null
@@ -0,0 +1,107 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+//////////////////////////////////////////////////////////////////////////////
+//                          Class AliEventInfo                              //
+//   Container class for all the information related to LHCstate, run and   //
+//   event types, trigger mask and trigger clusters.                        //
+//   It is used in order to provide the detector's AliRecoParam objects with//
+//   the necessary information so that they can decide which instance of    //
+//   AliDetectorRecoParam to use in reconstruction one particular event.    //
+//                                                                          //
+//   cvetan.cheshkov@cern.ch 12/06/2008                                     //
+//////////////////////////////////////////////////////////////////////////////
+
+#include "AliEventInfo.h"
+
+ClassImp(AliEventInfo)
+
+//______________________________________________________________________________
+AliEventInfo::AliEventInfo():
+  TObject(),
+  fLHCState("UNKNOWN"),
+  fRunType("UNKNOWN"),
+  fActiveDetectors(""),
+  fEventType(0),
+  fTriggerClasses(""),
+  fTriggerMask(0),
+  fTriggerCluster("")
+{
+  // default constructor
+  // ...
+}
+
+//______________________________________________________________________________
+AliEventInfo::AliEventInfo(const char *lhcState, const char *runType, const char *activeDetectors):
+  TObject(),
+  fLHCState(lhcState),
+  fRunType(runType),
+  fActiveDetectors(activeDetectors),  
+  fEventType(0),
+  fTriggerClasses(""),
+  fTriggerMask(0),
+  fTriggerCluster("")
+{
+  // constructor
+  // ...
+}
+
+//______________________________________________________________________________
+AliEventInfo::AliEventInfo(const AliEventInfo &evInfo):
+  TObject(evInfo),
+  fLHCState(evInfo.fLHCState),
+  fRunType(evInfo.fRunType),
+  fActiveDetectors(evInfo.fActiveDetectors),
+  fEventType(evInfo.fEventType),
+  fTriggerClasses(evInfo.fTriggerClasses),
+  fTriggerMask(evInfo.fTriggerMask),
+  fTriggerCluster(evInfo.fTriggerCluster)
+{
+  // Copy constructor
+  // ...
+}
+
+//_____________________________________________________________________________
+AliEventInfo &AliEventInfo::operator =(const AliEventInfo& evInfo)
+{
+  // assignment operator
+  // ...
+  if(this==&evInfo) return *this;
+  ((TObject *)this)->operator=(evInfo);
+
+  fLHCState = evInfo.fLHCState;
+  fRunType = evInfo.fRunType;
+  fActiveDetectors = evInfo.fActiveDetectors;
+  fEventType = evInfo.fEventType;
+  fTriggerClasses = evInfo.fTriggerClasses;
+  fTriggerMask = evInfo.fTriggerMask; 
+  fTriggerCluster = evInfo.fTriggerCluster;
+
+  return *this;
+}
+
+//______________________________________________________________________________
+void AliEventInfo::Reset()
+{
+  // Reset the contents
+  // ...
+  fLHCState = "UNKNOWN";
+  fRunType = "UNKNOWN";
+  fActiveDetectors = "";
+  fEventType = 0;
+  fTriggerClasses = "";
+  fTriggerMask = 0;
+  fTriggerCluster = "";
+}
diff --git a/STEER/AliEventInfo.h b/STEER/AliEventInfo.h
new file mode 100644 (file)
index 0000000..bce4d94
--- /dev/null
@@ -0,0 +1,55 @@
+#ifndef ALIEVENTINFO_H
+#define ALIEVENTINFO_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+//////////////////////////////////////////////////////////////////////////////
+//                          Class AliEventInfo                              //
+//   Container class for all the information related to LHCstate, run and   //
+//   event types, trigger mask and trigger clusters.                        //
+//   It is used in order to provide the detector's AliRecoParam objects with//
+//   the necessary information so that they can decide which instance of    //
+//   AliDetectorRecoParam to use in reconstruction one particular event.    //
+//                                                                          //
+//   cvetan.cheshkov@cern.ch 12/06/2008                                     //
+//////////////////////////////////////////////////////////////////////////////
+
+#include <TObject.h>
+#include <TObjString.h>
+
+class AliEventInfo : public TObject {
+
+ public:
+  AliEventInfo();
+  AliEventInfo(const char *lhcState,
+              const char *runType,
+              const char *activeDetectors);
+  virtual ~AliEventInfo() {}
+
+  void SetEventType(UInt_t evType) { fEventType = evType; }
+  void SetTriggerClasses(const char *classes) { fTriggerClasses.SetString(classes); }
+  void SetTriggerMask(ULong_t mask) { fTriggerMask = mask; }
+  void SetTriggerCluster(const char *cluster) { fTriggerCluster.SetString(cluster); }
+
+  virtual void Print(Option_t */*option=""*/) const { Dump(); }
+
+  const char *GetLHCState() const { return fLHCState.GetString().Data(); }
+
+  AliEventInfo(const AliEventInfo &evInfo);
+  AliEventInfo& operator= (const AliEventInfo& evInfo);
+
+  void Reset();
+ private:
+
+  TObjString  fLHCState;       // state of the machine as provided by DCS and DAQ log-book (per run)
+  TObjString  fRunType;        // run type accoring to ECS (per run)
+  TObjString  fActiveDetectors;// list of active detectors (per run)
+  UInt_t      fEventType;      // event type as defined by DAQ (start_of_*,calibration,physics etc) (per event)
+  TObjString  fTriggerClasses; // list of fired trigger classes (per event)
+  ULong_t     fTriggerMask;    // trigger mask as received from DAQ or CTP raw-data payload (per event)
+  TObjString  fTriggerCluster; // list of detectors that have been read out (per event)
+
+  ClassDef(AliEventInfo,1)     // Event info class
+};
+
+#endif
index bbdb5bd738195bc41507f283a25d3de8c03cd26f..9741d410a856af27dcc225c33126db69d67a7ccf 100644 (file)
 
 ///////////////////////////////////////////////////////////////////////////////
 //                                                                           //
-// ALICE Reconstruction parameterization:
-// 
-//
-// Retrieving paramaters:
-// 0.  Read the parameters from database
-// 1.  Using the ConfigRecoParam.C script (example : $ALICE_ROOT/macros)
-// 2.  Register additional parametes (AliRecoParam::Instance()->RegisterRecoParam(tpcRecoParam);
-//
-//
-// Using the reconstruction parameters
-//    AliRecoParam::Instance()->GetRecoParam(detType, eventType)                                                                       //  
-//  detType: 
-//  1. Detectors - ITS, TPC, TRD, TOF ...
-//  2. Process   - V0, Kink, ESDcuts
-
+// ALICE Reconstruction parameterization:                                    //
+//                                                                           //
+//                                                                           //
+// Base Class for Detector reconstruction parameters                         //
+// Revision: cvetan.cheshkov@cern.ch 12/06/2008                              //
+// Its structure has been revised and it is interfaced to AliEventInfo.      //
 //                                                                           //
 ///////////////////////////////////////////////////////////////////////////////
 
 
 ClassImp(AliRecoParam)
 
-
-AliRecoParam* AliRecoParam::fgInstance = 0x0;
-
-
-//_____________________________________________________________________________
-AliRecoParam* AliRecoParam::Instance()
+AliRecoParam::AliRecoParam(): 
+  TNamed("",""),
+  fRecoParamArray(0)
 {
-  //
-  // returns AliRecoParam instance (singleton)
-  //
-  if (!fgInstance) {
-    fgInstance = new AliRecoParam();
-  }
-  
-  return fgInstance;
+  // Default constructor
+  // ...
 }
 
-
-
-AliRecoParam::AliRecoParam(): 
-  TNamed("ALICE","ALICE"),
+AliRecoParam::AliRecoParam(const char *detector): 
+  TNamed(detector,detector),
   fRecoParamArray(0)
 {
-  //
-  //
-  //
+  // Default constructor
+  // ...
 }
 
 AliRecoParam::~AliRecoParam(){
-  //
-  //
-  //
+  // Destructor
+  // ...
+  // Delete the array with the reco-param objects
   if (fRecoParamArray){
     fRecoParamArray->Delete();
     delete fRecoParamArray;
   }
 }
 
-void  AliRecoParam::Print(Option_t *option) const{
+void  AliRecoParam::Print(Option_t *option) const {
   //
   // Print reconstruction setup
   //
-  printf("AliRecoParam\n"); 
+  printf("AliRecoParam object for %s\n",GetName()); 
   if (!fRecoParamArray) return;
   Int_t nparam = fRecoParamArray->GetEntriesFast();
   for (Int_t iparam=0; iparam<nparam; iparam++){
@@ -94,31 +73,10 @@ void  AliRecoParam::Print(Option_t *option) const{
   }
 }
 
-void  AliRecoParam::RegisterRecoParam(AliDetectorRecoParam* param){
-  //
-  //
+void  AliRecoParam::AddRecoParam(AliDetectorRecoParam* param){
+  // Add an instance of reco params object into
+  // the fRecoParamArray
   //
   if (!fRecoParamArray) fRecoParamArray = new TObjArray;
   fRecoParamArray->AddLast(param);
 }
-
-TObjArray * AliRecoParam::GetRecoParam(const char * detType, Int_t */*eventType*/){
-  //
-  // Get the list of Reconstruction parameters for given detector
-  // and event type
-  //
-  if (!fRecoParamArray) return 0;
-  TObjArray * array = 0;
-  Int_t nparam = fRecoParamArray->GetEntriesFast();
-  for (Int_t iparam=0;iparam<nparam; iparam++){
-    AliDetectorRecoParam * param = (AliDetectorRecoParam *)fRecoParamArray->At(iparam);
-    if (!param) continue;
-    TString str(param->GetName());
-    if (!str.Contains(detType)) continue;
-    if (!array) array = new TObjArray;
-    array->AddLast(param);    
-  }
-  return array;
-}
-
-
index 36c54b65f325532e16955e001b1b4d984c2e5a9e..0f9dadfee93be1d40af68049e95d7ae3efd6aaf9 100644 (file)
@@ -6,34 +6,39 @@
 ///////////////////////////////////////////////////////////////////////////////
 //                                                                           //
 // Base Class for Detector reconstruction parameters                         //
+// Revision: cvetan.cheshkov@cern.ch 12/06/2008                              //
+// Its structure has been revised and it is interfaced to AliEventInfo.      //
 //                                                                           //
 ///////////////////////////////////////////////////////////////////////////////
 
 
 #include "TNamed.h"
 class AliDetectorRecoParam;
+class AliEventInfo;
 
 class AliRecoParam : public TNamed
 {
-  enum EventType0 {kUndef=0, kPhysic=1, kCalib=2};  
+
  public: 
   AliRecoParam();
+  AliRecoParam(const char *detector);
   virtual ~AliRecoParam();  
-  static AliRecoParam * Instance();
   //
-  virtual void        Print(Option_t *option="") const;
-  TObjArray * GetRecoParam(const char * detType, Int_t *eventType=0);  
-  void        RegisterRecoParam(AliDetectorRecoParam* param);
+  virtual void                  Print(Option_t *option="") const;
+  TObjArray                    *GetAllRecoParams() const { return fRecoParamArray; }
+  virtual AliDetectorRecoParam *GetRecoParam(const AliEventInfo &evInfo) const = 0;
+  void                          AddRecoParam(AliDetectorRecoParam* param);
 
 protected:
-  TObjArray *fRecoParamArray;   //array with registerd reconstruction parameters
-  static AliRecoParam* fgInstance; // Reconstruction parameters instance
+
+  TObjArray *fRecoParamArray;   //array with reconstruction-parameter objects
 
 private:
+
   AliRecoParam(const AliRecoParam&); // Not implemented
   AliRecoParam& operator=(const AliRecoParam&); // Not implemented
 
-  ClassDef(AliRecoParam, 1)
+  ClassDef(AliRecoParam, 2)
 };
 
 
index e4ca2e0077128866999366af0056b81295e42b38..c59e7a690edaa7f4dc5d1551c66e7a3d552249e6 100644 (file)
 #pragma link C++ class AliTriggerRunScalers+;
 #pragma link C++ class AliGRPPreprocessor+;
 
+#pragma link C++ class AliEventInfo+;
+
 #endif
index dd6d15a2c5f03c750111c7f45075bd5ca0a9f95e..a0c82d29ad3276d612f7f62be38e254d6f927a1f 100644 (file)
@@ -61,7 +61,8 @@ AliMillepede.cxx \
 AliRecoParam.cxx \
 AliDetectorRecoParam.cxx \
 AliPlaneEff.cxx \
-AliTriggerRunScalers.cxx AliGRPPreprocessor.cxx
+AliTriggerRunScalers.cxx AliGRPPreprocessor.cxx \
+AliEventInfo.cxx
 
 
 HDRS:= $(SRCS:.cxx=.h)