/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Event/RawDataProviderSvc/RawDataProviderSvc-00-03-46/RawDataProviderSvc/EmcRawDataProvider.h

Go to the documentation of this file.
00001 #ifndef EMCRAWDATAPROVIDER_H
00002 #define EMCRAWDATAPROVIDER_H
00003 
00004 //#include "GaudiKernel/ISvcLocator.h"
00005 //#include "GaudiKernel/IMessageSvc.h"
00006 #include "GaudiKernel/IIncidentListener.h"
00007 #include "RawDataProviderSvc/RawDataProviderBase.h"
00008 #include "EmcCalibConstSvc/EmcCalibConstSvc.h"
00009 #include "EmcRawEvent/EmcDigi.h"
00010 #include "Rtypes.h"
00011 #include <vector>
00012 
00013 //typedef std::vector<EmcDigi*> EmcDigiVec;
00014 
00015 // RawDataProvider for EMC
00016 // @author: C.D.Fu
00017 class EmcRawDataProvider:public RawDataProviderBase{ 
00018  public:
00019   EmcRawDataProvider();
00020   EmcRawDataProvider(const char* name, uint32_t adclow=0,uint32_t tlow=0,uint32_t thigh=60);
00021   EmcRawDataProvider(const char* name, std::vector<uint32_t>& hot,std::vector<uint32_t>& dead,
00022                      uint32_t elow=0,uint32_t tlow=0, uint32_t thigh=60);
00023   virtual ~EmcRawDataProvider(){m_emcDigiVec=EmcDigiCol();};
00024 
00025   void handle(const Incident&);
00026 
00027   // initialize service point
00028   virtual StatusCode initialize(bool mode=0, ISvcLocator* svcLoc=0, IMessageSvc* pMsg=0);
00029   // Provider's mode
00030   enum EmcDataMode{
00031     DropLow  = BIT(0),
00032     DropFull = BIT(1),
00033     DropHot  = BIT(2),
00034     DropDead = BIT(3),
00035     CutTime  = BIT(4),
00036     DoCalib  = BIT(5),
00037     DoOther  = BIT(6),
00038     Redo     = BIT(7)
00039   };
00040 
00041   // get vector of point of EmcDigi after drop or cut or calib, etc.  
00042   EmcDigiCol& getEmcDigiVec(uint32_t control);
00043   // decide whether it is a good emc hit
00044   bool isGoodEmcDigi(uint32_t control, uint32_t id, uint32_t measure, uint32_t adc, uint32_t tdc); 
00045   bool isGoodEmcDigi(uint32_t control, EmcDigi* emcDigi);
00046   // calibiration
00047   void doCalib(Identifier& id, uint32_t& measure, uint32_t& adc);
00048   void doCalib(EmcDigi* emcDigi);
00049 
00050   // set
00051   void setELowThreshold(const uint32_t low) { m_adcLowThreshold = low; };
00052   void setTLowThreshold(const uint32_t low) { m_tLowThreshold = low; };
00053   void setTHighThreshold(const uint32_t high) { m_tHighThreshold = high; };
00054   void setHotCrystals(const std::vector<uint32_t>& idVec) { m_hotCrystals = idVec; };
00055   void addHotCrystal(const uint32_t id);
00056   void setDeadCrystals(const std::vector<uint32_t>& idVec) { m_deadCrystals = idVec; };
00057   void addDeadCrystal(const uint32_t id);
00058   bool removeHotCrystal(const uint32_t id);
00059   bool removeDeadCrystal(const uint32_t id);
00060 
00061   // get
00062   uint32_t getAdcLowThreshold() { return m_adcLowThreshold; };
00063   uint32_t getTdcLowThreshold() { return m_tLowThreshold; };
00064   uint32_t getTdcHighThreshold() { return m_tHighThreshold; };
00065   std::vector<uint32_t>& getHotCrystals() { return m_hotCrystals; };
00066   std::vector<uint32_t>& getDeadCrystals() { return m_deadCrystals; };
00067 
00068  private:
00069   IEmcCalibConstSvc* m_emcCalibConstSvc;
00070 
00071   uint32_t m_adcLowThreshold;          // adc threshold when measure==0
00072   uint32_t m_tLowThreshold;            // tdc threshold
00073   uint32_t m_tHighThreshold;
00074   std::vector<uint32_t> m_hotCrystals;   // hot channels' id
00075   std::vector<uint32_t> m_deadCrystals;  // dead channels' id
00076   
00077   EmcDigiCol   m_emcDigiVec;  // storage of result
00078 };
00079 #endif

Generated on Tue Nov 29 22:58:35 2016 for BOSS_7.0.2 by  doxygen 1.4.7