1#include "GaudiKernel/MsgStream.h"
3#include "GaudiKernel/SmartDataPtr.h"
5#include "EventModel/Event.h"
6#include "EventModel/EventHeader.h"
9#include "Identifier/Identifier.h"
10#include "Identifier/MdcID.h"
11#include "MdcRawEvent/MdcDigi.h"
15int EFSectorHits::idmax[43] = { 40, 44, 48, 56, 64, 72, 80, 80, 76, 76, 88,
16 88, 100, 100, 112, 112, 128, 128, 140, 140, 160, 160,
17 160, 160, 176, 176, 176, 176, 208, 208, 208, 208, 240,
18 240, 240, 240, 256, 256, 256, 256, 288, 288, 288 };
24 MsgStream log(
msgSvc(), name );
33 MsgStream log(
msgSvc(), name() );
34 log << MSG::INFO <<
"in initialize()" << endmsg;
42 log << MSG::ERROR <<
"m_HltStoreSvc->put(nsec) wrong" << endmsg;
46 return StatusCode::SUCCESS;
52 MsgStream log(
msgSvc(), name() );
53 int32_t nshower =
m_ef->getEFVec( 38 );
54 if ( nshower < 2 )
return StatusCode::SUCCESS;
59 SmartDataPtr<Event::EventHeader> eventHeader( eventSvc(),
"/Event/EventHeader" );
62 log << MSG::FATAL <<
"Could not find Event Header" << endmsg;
63 return ( StatusCode::FAILURE );
66 SmartDataPtr<MdcDigiCol> mdcDigiCol( eventSvc(),
"/Event/Digi/MdcDigiCol" );
69 log << MSG::FATAL <<
"EmcRec could not find Mdc digi!!" << endmsg;
70 return ( StatusCode::FAILURE );
73 unsigned int nsec = 0;
75 MdcDigiCol::iterator
iter = mdcDigiCol->begin();
82 if ( ( !(
p1->getValue(
phi1 ) ) ) || ( !(
p2->getValue(
phi2 ) ) ) )
return false;
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++ )
95 id = ( *iter )->identify();
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++;
102 log << MSG::INFO <<
" Number of hits in sector of MDC is " << nsec << endmsg;
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 );
113 return StatusCode::SUCCESS;
117 MsgStream log(
msgSvc(), name() );
118 log << MSG::INFO <<
"in finalize()" << endmsg;
119 return StatusCode::SUCCESS;
132bool EFSectorHits::WhetherSector(
float ph,
float ph1,
float ph2 ) {
135 float delta = 0.0610865;
141 if (
phi2 > 6.2831852 )
phi2 -= 6.2831852;
154 if ( ph <= phi2 && ph >=
phi1 )
return true;
159 if ( ph >=
phi2 || ph <=
phi1 )
return true;
*******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
EFSectorHits(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode initialize()
IEFAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode initialize()
HltStoreSvc * m_HltStoreSvc
static int layer(const Identifier &id)
Values of different levels (failure returns 0).
static int wire(const Identifier &id)