mEmcCalibratorModule.h

Go to the documentation of this file.
00001 // $Id: mEmcCalibratorModule.h,v 2.12 2006/01/13 23:49:08 pinkenbu Exp $
00002 //-----------------------------------------------------------------------------
00003 //
00004 //  (c) PHENIX Collaboration 1999
00005 //
00006 // Purpose: wraps the filling of rdo, mdo, and cdo from prdf
00007 //
00008 // Description: algorithm class
00009 //
00010 // Author:  Gines MARTINEZ SUBATECH, Broohaven Aug-00
00011 //
00012 //-----------------------------------------------------------------------------
00013 
00014 #ifndef __MEMCCALIBRATORMODULE_H__
00015 #define __MEMCCALIBRATORMODULE_H__
00016 
00017 #include <map>
00018 #include "EMCModule.h"
00019 #include "emcMixedDataObject.h"
00020 #include "emcManageable.h"
00021 #include "PHTimeStamp.h"
00022 
00023 class emcCalibratedDataObject;
00024 class emcRawDataAccessor;
00025 class emcCalibrator;
00026 class emcRawDataObject;
00027 
00035 class mEmcCalibratorModule: public EMCModule
00036 {
00037 
00038 public:
00039 
00041   mEmcCalibratorModule(const PHTimeStamp& ts,
00042                        const char* calibrator = "emcRawDataCalibrator",
00043                        emcManageable::EStorage source = emcManageable::kDB_Objy);
00044 
00045   mEmcCalibratorModule(const char* configfilename = "emcwb.conf",                      
00046                        const char* calibrator = "emcRawDataCalibrator",
00047                        emcManageable::EStorage source = emcManageable::kDB_Objy);
00048 
00049 
00051   virtual ~mEmcCalibratorModule()
00052   {}
00053  
00055   emcRawDataObject* GetEmcRawDataObject()
00056   {
00057     return fRdo;
00058   }
00059 
00064   bool Init(const char* configfilename = "emcwb.conf",
00065             const char* calibrator = "emcRawDataCalibrator",
00066             emcManageable::EStorage source = emcManageable::kDB_Objy);
00067 
00068   bool Init(const PHTimeStamp& ts,
00069             const char* calibrator = "emcRawDataCalibrator",
00070             emcManageable::EStorage source = emcManageable::kDB_Objy);
00071 
00073   PHBoolean event(PHCompositeNode * root);
00074 
00076   bool SetCalibrator(const char* calibrator);
00078   bool SetHighLowLimit(int limit = 512);
00080   void SetVerbose(int verbo)
00081   {
00082     fVerbose = verbo;
00083   }
00085   bool SetZeroSuppression(bool ZeroSupression = true);
00087   void SelectSource(emcManageable::EStorage source);
00088 
00092   void UseTimeStamp(const PHTimeStamp& when);
00093 
00097   void ForceDBCollection();
00098 
00099 private:
00100   bool Config(const char* calibrator, emcManageable::EStorage source);
00101 
00102 private:
00103 
00104   // MV 2001/09/24
00105   // We need to find which MDO index correspond to each CDO index.
00106   // ItemId is the only key to bind those internal indeces.
00107   // fIndexMap has ItemId as a key and an index from EmcDynamicData::DataMap
00108   // index as a value.
00109   std::map<int, int> fIndexMap;
00110   std::map<int, int>::iterator fIndexMapIter;
00111   PHTimeStamp fTimeStamp;
00112   bool fUseTimeStamp;
00113   emcCalibratedDataObject* fCdo;
00114   emcRawDataAccessor * fRda;
00115   emcMixedDataObject fMdo;
00116   emcCalibrator* fRdc;
00117   emcRawDataObject* fRdo;
00118   bool fZeroSuppression;
00119   int fVerbose;
00120   int fHighLowLimit;
00121 };
00122 
00123 #endif /*__MEMCCALIBRATORMODULE_H__*/
00124 
00125 
00126