3#include "GaudiKernel/Kernel.h"
4#include "GaudiKernel/IInterface.h"
5#include "GaudiKernel/IIncidentSvc.h"
6#include "GaudiKernel/Incident.h"
7#include "GaudiKernel/IIncidentListener.h"
8#include "GaudiKernel/StatusCode.h"
9#include "GaudiKernel/SvcFactory.h"
10#include "GaudiKernel/MsgStream.h"
11#include "GaudiKernel/IDataProviderSvc.h"
12#include "GaudiKernel/SmartDataPtr.h"
13#include "GaudiKernel/DataSvc.h"
21#include "GaudiKernel/ThreadGaudi.h"
46 return StatusCode::SUCCESS;
51 log << MSG::DEBUG <<
"handle: " << inc.type() << endreq;
52 if ( inc.type() ==
"BeginEvent" ){
62 if(!unRedo) digiRef.clear();
63 else if(digiRef.size()>0)
return digiRef;
65 IDataProviderSvc* evtSvc;
67 std::string evtDataSvc_name(
"EventDataSvc");
68 if(isGaudiThreaded(
m_name)){
69 evtDataSvc_name += getGaudiThreadIDfromName(
m_name);
72 sc =
m_svcLocator->service(evtDataSvc_name.c_str(),evtSvc,
true);
74 log << MSG::FATAL <<
"Could not load EventDataSvc" << endreq;
87 sc =
m_svcLocator->service(
"MdcCalibFunSvc", m_mdcCalibFunSvc);
88 if ( sc.isFailure() ){
89 log << MSG::FATAL <<
"Could not load MdcCalibFunSvc!" << endreq;
94 SmartDataPtr<RecEsTimeCol> esTimeCol(evtSvc,
"/Event/Recon/RecEsTimeCol");
96 log << MSG::INFO<<
" Could not retrieve RecEsTimeCol"<< endreq;
98 }
else if( (esTimeCol->size()==0)) {
99 log << MSG::INFO<<
" Could not retrieve RecEsTimeCol"<< endreq;
102 RecEsTimeCol::iterator
iter= esTimeCol->begin();
103 for(;
iter!=esTimeCol->end();
iter++){
104 t0 = (*iter)->getTest();
110 bool m_hitInUse[43][288];
111 for (
int i=0; i<43; i++){
112 for (
int j=0; j<288; j++) m_hitInUse[i][j]=
false;
114 bool dropHot = ((control&
b_dropHot)==0x4000);
116 SmartDataPtr<RecMdcHitCol> recHitCol(evtSvc,
"/Event/Recon/RecMdcHitCol");
118 log << MSG::INFO <<
"Could not retrieve RecMdcHitCol" << endreq;
121 RecMdcHitCol::iterator
iter = recHitCol->begin();
122 for ( ;
iter != recHitCol->end();
iter++) {
130 bool isSkipLayers = ((control&
b_keepSkipped)!=0x8000) && (m_skipLayers.size()>0);
133 for (
int i=0; i<43; i++){skipLayer[i]=
false;}
134 for(
unsigned iSkip =0; iSkip < m_skipLayers.size(); iSkip++){
135 skipLayer[m_skipLayers[iSkip]]=
true;
142 SmartDataPtr<MdcDigiCol> mdcDigiCol(evtSvc,
"/Event/Digi/MdcDigiCol");
143 if (sc!=StatusCode::SUCCESS) {
144 log << MSG::FATAL <<
"Could not find MdcDigiCol!" << endreq;
147 MdcDigiCol::iterator
iter = mdcDigiCol->begin();
148 for (;
iter != mdcDigiCol->end();
iter++,iDigi++ ) {
158 if((layer==18)&&(wire==27||wire==42))
continue;
161 if( isSkipLayers && skipLayer[layer] )
continue;
164 if ( dropHot && m_hitInUse[layer][wire])
continue;
173 (((overflow & 1)>0) ||
174 (((overflow&12)!=12)&&((overflow&12)!=0)) ||
175 (tdc==0x7FFFFFFF) || (adc== 0x7FFFFFFF) ) ) {
continue; }
183 if (m_mdcCalibFunSvc) { T0Walk = m_mdcCalibFunSvc->
getT0(layer,wire)
190 if ((maxMdcDigi>0) && (nMatchedDigi > maxMdcDigi)){
195 digiRef.push_back(aDigi);
std::vector< MdcDigi * > MdcDigiVec
virtual double getT0(int layid, int cellid) const =0
virtual double getTimeWalk(int layid, double Q) const =0
unsigned int getOverflow() const
static int layer(const Identifier &id)
Values of different levels (failure returns 0)
static int wire(const Identifier &id)
void handle(const Incident &)
MdcDigiVec & getMdcDigiVec(uint32_t control=0)
StatusCode initialize(ISvcLocator *svcLoc=0, IMessageSvc *pMsg=0)
StatusCode initialize(ISvcLocator *svcLoc=0, IMessageSvc *pMsg=0)
ISvcLocator * m_svcLocator
static double MdcTime(int timeChannel)
virtual Identifier identify() const
unsigned int getChargeChannel() const
unsigned int getTimeChannel() const