BOSS 7.1.1
BESIII Offline Software System
Loading...
Searching...
No Matches
EFSectorHits Class Reference

#include <EFSectorHits.h>

+ Inheritance diagram for EFSectorHits:

Public Member Functions

 EFSectorHits (const std::string &name, ISvcLocator *pSvcLocator)
 
virtual ~EFSectorHits ()
 
virtual StatusCode initialize ()
 
StatusCode execute ()
 
StatusCode finalize ()
 
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 13 of file EFSectorHits.h.

Constructor & Destructor Documentation

◆ EFSectorHits()

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

Definition at line 21 of file EFSectorHits.cxx.

21 :
22 IEFAlgorithm(name, pSvcLocator) {
23 int output= (m_output%1000)/100;
24 //declareProperty("OutputLevel",m_output = MSG::NIL);
25 MsgStream log(msgSvc(), name);
26 msgSvc()->setOutputLevel(name,output);
27 m_nsec = new CriteriaItemValue;
28}
*******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)

◆ ~EFSectorHits()

EFSectorHits::~EFSectorHits ( )
virtual

Definition at line 30 of file EFSectorHits.cxx.

30 {
31 delete m_nsec;
32}

Member Function Documentation

◆ execute()

StatusCode EFSectorHits::execute ( )

Definition at line 51 of file EFSectorHits.cxx.

51 {
52
53 //reset();
54 MsgStream log(msgSvc(), name());
55 int32_t nshower=m_ef->getEFVec(38);
56 if(nshower<2) return StatusCode::SUCCESS;
57
58 //DataObject* pObject;
59
60 // Part 1: Get the event header, print out event and run number
61 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),"/Event/EventHeader");
62 if (!eventHeader) {
63 log << MSG::FATAL << "Could not find Event Header" << endreq;
64 return( StatusCode::FAILURE);
65 }
66 //Part 2: Retrieve Hits Collection
67 SmartDataPtr<MdcDigiCol> mdcDigiCol(eventSvc(),"/Event/Digi/MdcDigiCol");
68 if (!mdcDigiCol) {
69 log << MSG::FATAL << "EmcRec could not find Mdc digi!!" << endreq;
70 return( StatusCode::FAILURE);
71 }
72 //Part 3: Get information of hits
73 unsigned int nsec=0;
74 Identifier id;
75 MdcDigiCol::iterator iter=mdcDigiCol->begin();
76
79 float phi1,phi2;
80 if((!m_HltStoreSvc->get("phi1", p1))||(!m_HltStoreSvc->get("phi2", p2)))return false;
81 if((!(p1->getValue(phi1)))||(!(p2->getValue(phi2)))) return false;
82 //phi(-pi,pi)==>(0,2pi)
83 if(phi1<0) phi1+=6.2831852;
84 if(phi2<0) phi2+=6.2831852;
85 //Decide sector (phi11,phi12) and (phi21,phi22)
86 float phi11=min(phi1,phi2);
87 float phi22=max(phi1,phi2);
88 float phi12=(phi11+phi22-3.1415926)*0.5;
89 float phi21=(phi11+phi22+3.1415926)*0.5;
90 if(phi12<0.) phi12 += 6.2831852;
91 if(phi21>6.2831852) phi21 -= 6.2831852;
92 for(;iter!= mdcDigiCol->end();iter++) {
93 id=(*iter)->identify();
94 unsigned int iphi=MdcID::wire(id);
95 unsigned int ilayer=MdcID::layer(id);
96 if(ilayer>=43)
97 log << MSG::ERROR << "MDC(" << ilayer <<","<<iphi <<endreq;
98 float phi=6.2831853*iphi/idmax[ilayer];
99 if(WhetherSector(phi,phi11,phi12)||WhetherSector(phi,phi21,phi22)) nsec++;
100 }
101 log << MSG::INFO << " Number of hits in sector of MDC is " << nsec <<endreq;
102
103 //Part 4: Put the criteria item(s) to HltStoreSvc here
104 m_nsec->setValue(nsec);
105 m_ef->setVecBit(true, 0, 3);
106 m_ef->addToEFVec(9,37);
107 if(m_ef->getEFVec(37)!=0) log << MSG::WARNING << "nsec(0) !=0"<< endreq;
108 m_ef->addToEFVec(nsec,37);
109
110 m_run=1;
111
112 return StatusCode::SUCCESS;
113}
double p1[4]
double p2[4]
Double_t phi2
Double_t phi1
EvtStreamInputIterator< typename Generator::result_type > iter(Generator gen, int N=0)
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
const std::vector< uint32_t > getEFVec() const
Definition EFResult.cxx:51
bool get(const std::string &name, T &value)
Definition HltStoreSvc.h:76
EFResult * m_ef
HltStoreSvc * m_HltStoreSvc
static int layer(const Identifier &id)
Values of different levels (failure returns 0)
Definition MdcID.cxx:49
static int wire(const Identifier &id)
Definition MdcID.cxx:54

◆ finalize()

StatusCode EFSectorHits::finalize ( )

Definition at line 115 of file EFSectorHits.cxx.

115 {
116 MsgStream log(msgSvc(), name());
117 log << MSG::INFO << "in finalize()" << endmsg;
118 return StatusCode::SUCCESS;
119}

◆ initialize()

StatusCode EFSectorHits::initialize ( )
virtual

Reimplemented from IEFAlgorithm.

Definition at line 34 of file EFSectorHits.cxx.

34 {
35
36 MsgStream log(msgSvc(), name());
37 log << MSG::INFO << "in initialize()" << endreq;
38
40
41 StatusCode sc;
42 sc = m_HltStoreSvc->put("nsec", m_nsec);
43 if ( sc.isFailure() ) {
44 log << MSG::ERROR << "m_HltStoreSvc->put(nsec) wrong" << endreq;
45 return sc;
46 }
47
48 return StatusCode::SUCCESS;
49}
bool put(const std::string &name, const T &value)
Definition HltStoreSvc.h:60
virtual StatusCode initialize()

◆ reset()

void EFSectorHits::reset ( )
virtual

Implements IEFAlgorithm.

Definition at line 121 of file EFSectorHits.cxx.

121 {
122
123 if(m_run){
124 m_nsec->reset();
125 m_run=0;
126 }
127 return;
128}

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