BOSS 7.0.2
BESIII Offline Software System
Loading...
Searching...
No Matches
Event/RawDataProviderSvc/RawDataProviderSvc-00-03-46/RawDataProviderSvc/EmcRawDataProvider.h
Go to the documentation of this file.
1#ifndef EMCRAWDATAPROVIDER_H
2#define EMCRAWDATAPROVIDER_H
3
4//#include "GaudiKernel/ISvcLocator.h"
5//#include "GaudiKernel/IMessageSvc.h"
6#include "GaudiKernel/IIncidentListener.h"
7#include "RawDataProviderSvc/RawDataProviderBase.h"
8#include "EmcCalibConstSvc/EmcCalibConstSvc.h"
9#include "EmcRawEvent/EmcDigi.h"
10#include "Rtypes.h"
11#include <vector>
12
13//typedef std::vector<EmcDigi*> EmcDigiVec;
14
15// RawDataProvider for EMC
16// @author: C.D.Fu
18 public:
20 EmcRawDataProvider(const char* name, uint32_t adclow=0,uint32_t tlow=0,uint32_t thigh=60);
21 EmcRawDataProvider(const char* name, std::vector<uint32_t>& hot,std::vector<uint32_t>& dead,
22 uint32_t elow=0,uint32_t tlow=0, uint32_t thigh=60);
23 virtual ~EmcRawDataProvider(){m_emcDigiVec=EmcDigiCol();};
24
25 void handle(const Incident&);
26
27 // initialize service point
28 virtual StatusCode initialize(bool mode=0, ISvcLocator* svcLoc=0, IMessageSvc* pMsg=0);
29 // Provider's mode
31 DropLow = BIT(0),
32 DropFull = BIT(1),
33 DropHot = BIT(2),
34 DropDead = BIT(3),
35 CutTime = BIT(4),
36 DoCalib = BIT(5),
37 DoOther = BIT(6),
38 Redo = BIT(7)
39 };
40
41 // get vector of point of EmcDigi after drop or cut or calib, etc.
42 EmcDigiCol& getEmcDigiVec(uint32_t control);
43 // decide whether it is a good emc hit
44 bool isGoodEmcDigi(uint32_t control, uint32_t id, uint32_t measure, uint32_t adc, uint32_t tdc);
45 bool isGoodEmcDigi(uint32_t control, EmcDigi* emcDigi);
46 // calibiration
47 void doCalib(Identifier& id, uint32_t& measure, uint32_t& adc);
48 void doCalib(EmcDigi* emcDigi);
49
50 // set
51 void setELowThreshold(const uint32_t low) { m_adcLowThreshold = low; };
52 void setTLowThreshold(const uint32_t low) { m_tLowThreshold = low; };
53 void setTHighThreshold(const uint32_t high) { m_tHighThreshold = high; };
54 void setHotCrystals(const std::vector<uint32_t>& idVec) { m_hotCrystals = idVec; };
55 void addHotCrystal(const uint32_t id);
56 void setDeadCrystals(const std::vector<uint32_t>& idVec) { m_deadCrystals = idVec; };
57 void addDeadCrystal(const uint32_t id);
58 bool removeHotCrystal(const uint32_t id);
59 bool removeDeadCrystal(const uint32_t id);
60
61 // get
62 uint32_t getAdcLowThreshold() { return m_adcLowThreshold; };
63 uint32_t getTdcLowThreshold() { return m_tLowThreshold; };
64 uint32_t getTdcHighThreshold() { return m_tHighThreshold; };
65 std::vector<uint32_t>& getHotCrystals() { return m_hotCrystals; };
66 std::vector<uint32_t>& getDeadCrystals() { return m_deadCrystals; };
67
68 private:
69 IEmcCalibConstSvc* m_emcCalibConstSvc;
70
71 uint32_t m_adcLowThreshold; // adc threshold when measure==0
72 uint32_t m_tLowThreshold; // tdc threshold
73 uint32_t m_tHighThreshold;
74 std::vector<uint32_t> m_hotCrystals; // hot channels' id
75 std::vector<uint32_t> m_deadCrystals; // dead channels' id
76
77 EmcDigiCol m_emcDigiVec; // storage of result
78};
79#endif
bool removeDeadCrystal(const uint32_t id)
bool isGoodEmcDigi(uint32_t control, uint32_t id, uint32_t measure, uint32_t adc, uint32_t tdc)
bool removeHotCrystal(const uint32_t id)
void doCalib(Identifier &id, uint32_t &measure, uint32_t &adc)
EmcDigiCol & getEmcDigiVec(uint32_t control)
void addDeadCrystal(const uint32_t id)
void addHotCrystal(const uint32_t id)
void handle(const Incident &)
virtual StatusCode initialize(bool mode=0, ISvcLocator *svcLoc=0, IMessageSvc *pMsg=0)