{
/// 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;
}
//
// default constructor
//
- for (Int_t i=0;i<5; i++) fEventType[i]=0;
}
AliDetectorRecoParam::~AliDetectorRecoParam(){
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)
};
--- /dev/null
+/**************************************************************************
+ * 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 = "";
+}
--- /dev/null
+#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
///////////////////////////////////////////////////////////////////////////////
// //
-// 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++){
}
}
-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;
-}
-
-
///////////////////////////////////////////////////////////////////////////////
// //
// 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)
};
#pragma link C++ class AliTriggerRunScalers+;
#pragma link C++ class AliGRPPreprocessor+;
+#pragma link C++ class AliEventInfo+;
+
#endif
AliRecoParam.cxx \
AliDetectorRecoParam.cxx \
AliPlaneEff.cxx \
-AliTriggerRunScalers.cxx AliGRPPreprocessor.cxx
+AliTriggerRunScalers.cxx AliGRPPreprocessor.cxx \
+AliEventInfo.cxx
HDRS:= $(SRCS:.cxx=.h)