BOSS 8.0.0
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 20 of file EFSectorHits.cxx.

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

29{ delete m_nsec; }

Member Function Documentation

◆ execute()

StatusCode EFSectorHits::execute ( )

Definition at line 49 of file EFSectorHits.cxx.

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

◆ finalize()

StatusCode EFSectorHits::finalize ( )

Definition at line 116 of file EFSectorHits.cxx.

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

◆ initialize()

StatusCode EFSectorHits::initialize ( )
virtual

Reimplemented from IEFAlgorithm.

Definition at line 31 of file EFSectorHits.cxx.

31 {
32
33 MsgStream log( msgSvc(), name() );
34 log << MSG::INFO << "in initialize()" << endmsg;
35
37
38 StatusCode sc;
39 sc = m_HltStoreSvc->put( "nsec", m_nsec );
40 if ( sc.isFailure() )
41 {
42 log << MSG::ERROR << "m_HltStoreSvc->put(nsec) wrong" << endmsg;
43 return sc;
44 }
45
46 return StatusCode::SUCCESS;
47}
virtual StatusCode initialize()

◆ reset()

void EFSectorHits::reset ( )
virtual

Implements IEFAlgorithm.

Definition at line 122 of file EFSectorHits.cxx.

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

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