BOSS 8.0.0
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 ()

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.

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()
IEFAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)

◆ ~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 105 of file EFDetectorHits.cxx.

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

◆ finalize()

StatusCode EFDetectorHits::finalize ( )
virtual

Definition at line 200 of file EFDetectorHits.cxx.

200 {
201 MsgStream log( msgSvc(), name() );
202 log << MSG::INFO << "in finalize()" << endmsg;
203 return StatusCode::SUCCESS;
204}

◆ 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()" << endmsg;
61
63
64 StatusCode sc;
65 sc = m_HltStoreSvc->put( "nmdc", m_nmdc );
66 if ( sc.isFailure() )
67 {
68 log << MSG::ERROR << "m_HltStoreSvc->put(nmdc) wrong" << endmsg;
69 return sc;
70 }
71 sc = m_HltStoreSvc->put( "nmuc", m_nmuc );
72 if ( sc.isFailure() )
73 {
74 log << MSG::ERROR << "m_HltStoreSvc->put(nmuc) wrong" << endmsg;
75 return sc;
76 }
77 sc = m_HltStoreSvc->put( "ntof", m_ntof );
78 if ( sc.isFailure() )
79 {
80 log << MSG::ERROR << "m_HltStoreSvc->put(ntof) wrong" << endmsg;
81 return sc;
82 }
83 sc = m_HltStoreSvc->put( "nemc", m_nemc );
84 if ( sc.isFailure() )
85 {
86 log << MSG::ERROR << "m_HltStoreSvc->put(nemc) wrong" << endmsg;
87 return sc;
88 }
89 sc = m_HltStoreSvc->put( "derr", m_derr );
90 if ( sc.isFailure() )
91 {
92 log << MSG::ERROR << "m_HltStoreSvc->put(derr) wrong" << endmsg;
93 return sc;
94 }
95 sc = m_HltStoreSvc->put( "rndm", m_rndm );
96 if ( sc.isFailure() )
97 {
98 log << MSG::ERROR << "m_HltStoreSvc->put(rndm) wrong" << endmsg;
99 return sc;
100 }
101
102 return StatusCode::SUCCESS;
103}
virtual StatusCode initialize()
HltStoreSvc * m_HltStoreSvc

◆ reset()

void EFDetectorHits::reset ( )
virtual

Implements IEFAlgorithm.

Definition at line 206 of file EFDetectorHits.cxx.

206 {
207
208 if ( m_run )
209 {
210 m_nmdc->reset();
211 m_nmuc->reset();
212 m_ntof->reset();
213 m_nemc->reset();
214 m_derr->reset();
215 m_rndm->reset();
216 m_run = 0;
217 }
218 return;
219}

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