BOSS 7.0.8
BESIII Offline Software System
Loading...
Searching...
No Matches
EFDetectorHits Class Reference

#include <EFDetectorHits.h>

+ Inheritance diagram for EFDetectorHits:

Public Member Functions

 EFDetectorHits (const std::string &name, ISvcLocator *pSvcLocator)
 
virtual ~EFDetectorHits ()
 
virtual StatusCode initialize ()
 
virtual StatusCode execute ()
 
virtual StatusCode finalize ()
 
virtual void reset ()
 
- Public Member Functions inherited from IEFAlgorithm
 IEFAlgorithm (const std::string &name, ISvcLocator *pSvcLocator)
 
virtual ~IEFAlgorithm ()
 
virtual StatusCode initialize ()
 
virtual void reset ()=0
 

Additional Inherited Members

- Protected Attributes inherited from IEFAlgorithm
int m_output
 
float m_beam
 
PropertyMgr m_propMgr
 
bool m_run
 
HltStoreSvcm_HltStoreSvc
 
IRawDataProviderSvcm_rawDigiSvc
 
EFResultm_ef
 

Detailed Description

Definition at line 16 of file EFDetectorHits.h.

Constructor & Destructor Documentation

◆ EFDetectorHits()

EFDetectorHits::EFDetectorHits ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Definition at line 24 of file EFDetectorHits.cxx.

24 :
25 IEFAlgorithm(name, pSvcLocator) {
26
27 int output=m_output/100000;
28#if 1
29 //m_propMgr.declareProperty("OutputLevel", output);
30 //cout << "OutputLevel="<<output<<"; name="<<name<<endl;
31 // Get a pointer to the Job Options Service
32 //IJobOptionsSvc* jobSvc;
33 //Gaudi::svcLocator()->service("JobOptionsSvc", jobSvc);
34 //jobSvc->setMyProperties("EFDetector", &m_propMgr);
35 //cout << "OutputLevel="<<output<<"; name="<<name<<endl;
36#endif
37 MsgStream log(msgSvc(), name);
38 msgSvc()->setOutputLevel(name,output);
39
40 m_nmdc = new CriteriaItemValue;
41 m_nmuc = new CriteriaItemValue;
42 m_ntof = new CriteriaItemValue;
43 m_nemc = new CriteriaItemValue;
44 m_derr = new CriteriaItemValue;
45 m_rndm = new CriteriaItemValue;
46}
*******INTEGER m_nBinMax INTEGER m_NdiMax !No of bins in histogram for cell exploration division $ !Last vertex $ !Last active cell $ !Last cell in buffer $ !No of sampling when dividing cell $ !No of function total $ !Flag for random ceel for $ !Flag for type of for WtMax $ !Flag which decides whether vertices are included in the sampling $ entire domain is hyp !Maximum effective eevents per saves r n generator level $ !Flag for chat level in output
Definition: FoamA.h:89
IMessageSvc * msgSvc()

◆ ~EFDetectorHits()

EFDetectorHits::~EFDetectorHits ( )
virtual

Definition at line 48 of file EFDetectorHits.cxx.

48 {
49 delete m_nmdc;
50 delete m_nmuc;
51 delete m_ntof;
52 delete m_nemc;
53 delete m_derr;
54 delete m_rndm;
55}

Member Function Documentation

◆ execute()

StatusCode EFDetectorHits::execute ( )
virtual

Definition at line 99 of file EFDetectorHits.cxx.

99 {
100
101 //reset();
102
103 MsgStream log(msgSvc(), name());
104
105 // Part 1: Get the event header, print out event number
106 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),"/Event/EventHeader");
107 if (!eventHeader) {
108 log << MSG::FATAL << "Could not find Event Header" << endreq;
109 return( StatusCode::FAILURE);
110 }
111 log << MSG::INFO << "eventNo-->" << eventHeader->eventNumber()<<endreq;
112
113 //Part 2: Retrieve Hits Collection
114 SmartDataPtr<MdcDigiCol> mdcDigiCol(eventSvc(),"/Event/Digi/MdcDigiCol");
115 if (!mdcDigiCol) {
116 log << MSG::FATAL << "Could not find Mdc digi!!" << endreq;
117 return( StatusCode::FAILURE);
118 }
119
120 SmartDataPtr<TofDigiCol> tofDigiCol(eventSvc(),"/Event/Digi/TofDigiCol");
121 if (!tofDigiCol) {
122 log << MSG::FATAL << "Could not find Tof digi!!" << endreq;
123 return( StatusCode::FAILURE);
124 }
125 SmartDataPtr<EmcDigiCol> emcDigiCol(eventSvc(),"/Event/Digi/EmcDigiCol");
126 if (!emcDigiCol) {
127 log << MSG::FATAL << "Could not find Emc digi!!" << endreq;
128 return( StatusCode::FAILURE);
129 }
130 if(m_rawDigiSvc){
133 }
134 }
135
136 SmartDataPtr<MucDigiCol> mucDigiCol(eventSvc(),"/Event/Digi/MucDigiCol");
137 if (!mucDigiCol) {
138 log << MSG::FATAL << "Could not find Muc digi!!" << endreq;
139 return( StatusCode::FAILURE);
140 }
141
142 //Part 3: Get information of hits
143 unsigned int nhitsMdc=mdcDigiCol->size();
144 if(m_rawDigiSvc){
146 nhitsMdc=m_rawDigiSvc->getMdcDigiVec(0x38000).size();
147 }
148 }
149 unsigned int nhitsEmc=emcDigiCol->size();
150 unsigned int nhitsMuc=mucDigiCol->size();
151 unsigned int nhitsTof=tofDigiCol->size();
152
153 double rndm=CLHEP::RandFlat::shoot();
154
155 log << MSG::INFO << " Number of hits in MDC:EMC:MUC:TOF is " << nhitsMdc
156 << ":" << nhitsEmc << ":" << nhitsMuc << ":" <<nhitsTof <<"; "
157 << "random number:" << rndm <<endreq;
158
159 //Part 4: Put the criteria item(s) to HltStoreSvc here
160 m_nmdc->setValue(nhitsMdc);
161 m_nmuc->setValue(nhitsMuc);
162 m_ntof->setValue(nhitsTof);
163 m_nemc->setValue(nhitsEmc);
164
165 m_rndm->setValue(rndm);
166
167 m_ef->addToEFVec(nhitsMdc, 5);
168 m_ef->addToEFVec(nhitsTof, 25);
169 m_ef->addToEFVec(nhitsEmc, 30);
170 m_ef->addToEFVec(nhitsMuc, 52);
171
172 m_ef->addToEFVec(0xFFFFFFF7,37); //nsec init
173
174 m_ef->setVecBit(true, 0, 0);
175 m_ef->addToEFVec(1, 1);
176 m_ef->addToEFVec(1<<8, 1);
177 m_ef->addToEFVec(1<<16, 1);
178 m_ef->addToEFVec(1<<24, 1);
179
180 m_run=1;
181
182 return StatusCode::SUCCESS;
183}
void setValue(float value)
bool addToEFVec(uint32_t val, uint32_t pos)
Definition: EFResult.cxx:81
bool setVecBit(uint32_t val, uint32_t vecpos, uint32_t bbegin, uint32_t bend)
Definition: EFResult.cxx:94
EFResult * m_ef
Definition: IEFAlgorithm.h:22
IRawDataProviderSvc * m_rawDigiSvc
Definition: IEFAlgorithm.h:21
virtual EmcDigiCol & getEmcDigiVec(uint32_t control=0)=0
virtual bool isOnlineMode()=0
virtual MdcDigiVec & getMdcDigiVec(uint32_t control=0)=0

◆ finalize()

StatusCode EFDetectorHits::finalize ( )
virtual

Definition at line 185 of file EFDetectorHits.cxx.

185 {
186 MsgStream log(msgSvc(), name());
187 log << MSG::INFO << "in finalize()" << endmsg;
188 return StatusCode::SUCCESS;
189}

◆ initialize()

StatusCode EFDetectorHits::initialize ( )
virtual

Reimplemented from IEFAlgorithm.

Definition at line 57 of file EFDetectorHits.cxx.

57 {
58
59 MsgStream log(msgSvc(), name());
60 log << MSG::INFO << "in initialize()" << endreq;
61
63
64 StatusCode sc;
65 sc = m_HltStoreSvc->put("nmdc", m_nmdc);
66 if ( sc.isFailure() ) {
67 log << MSG::ERROR << "m_HltStoreSvc->put(nmdc) wrong" << endreq;
68 return sc;
69 }
70 sc = m_HltStoreSvc->put("nmuc", m_nmuc);
71 if ( sc.isFailure() ) {
72 log << MSG::ERROR << "m_HltStoreSvc->put(nmuc) wrong" << endreq;
73 return sc;
74 }
75 sc = m_HltStoreSvc->put("ntof", m_ntof);
76 if ( sc.isFailure() ) {
77 log << MSG::ERROR << "m_HltStoreSvc->put(ntof) wrong" << endreq;
78 return sc;
79 }
80 sc = m_HltStoreSvc->put("nemc", m_nemc);
81 if ( sc.isFailure() ) {
82 log << MSG::ERROR << "m_HltStoreSvc->put(nemc) wrong" << endreq;
83 return sc;
84 }
85 sc = m_HltStoreSvc->put("derr", m_derr);
86 if(sc.isFailure()) {
87 log << MSG::ERROR << "m_HltStoreSvc->put(derr) wrong" << endreq;
88 return sc;
89 }
90 sc = m_HltStoreSvc->put("rndm", m_rndm);
91 if(sc.isFailure()) {
92 log << MSG::ERROR << "m_HltStoreSvc->put(rndm) wrong" << endreq;
93 return sc;
94 }
95
96 return StatusCode::SUCCESS;
97}
bool put(const std::string &name, const T &value)
Definition: HltStoreSvc.h:60
virtual StatusCode initialize()
HltStoreSvc * m_HltStoreSvc
Definition: IEFAlgorithm.h:20

◆ reset()

void EFDetectorHits::reset ( )
virtual

Implements IEFAlgorithm.

Definition at line 191 of file EFDetectorHits.cxx.

191 {
192
193 if(m_run){
194 m_nmdc->reset();
195 m_nmuc->reset();
196 m_ntof->reset();
197 m_nemc->reset();
198 m_derr->reset();
199 m_rndm->reset();
200 m_run=0;
201 }
202 return;
203}

The documentation for this class was generated from the following files: