90 {
91 MsgStream log(
msgSvc(), name());
92 log << MSG::INFO << "in execute()" << endreq;
93 StatusCode sc;
94
95 DataObject *pnode = 0;
96 sc = eventSvc()->retrieveObject("/Event/Hit",pnode);
97 if(!sc.isSuccess()) {
98 pnode = new DataObject;
99 sc = eventSvc()->registerObject("/Event/Hit",pnode);
100 if(!sc.isSuccess()) {
101 log << MSG::FATAL << " Could not register hit branch" <<endreq;
102 return StatusCode::FAILURE;
103 }
104 }
105
106 SmartIF<IDataManagerSvc> dataManSvc(eventSvc());
107 DataObject *hitCol;
108 eventSvc()->findObject("/Event/Hit/MdcHitCol",hitCol);
109 if(hitCol!= NULL) {
110 dataManSvc->clearSubTree("/Event/Hit/MdcHitCol");
111 eventSvc()->unregisterObject("/Event/Hit/MdcHitCol");
112 }
114 sc = eventSvc()->registerObject("/Event/Hit/MdcHitCol",mdcHitCol);
115 if(!sc.isSuccess()) {
116 log << MSG::FATAL << " Could not register hit collection" <<endreq;
117 return StatusCode::FAILURE;
118 }
119
120 DataObject *hitMap;
121 eventSvc()->findObject("/Event/Hit/MdcHitMap",hitMap);
122 if(hitMap!= NULL) {
123 dataManSvc->clearSubTree("/Event/Hit/MdcHitMap");
124 eventSvc()->unregisterObject("/Event/Hit/MdcHitMap");
125 }
127 sc = eventSvc()->registerObject("/Event/Hit/MdcHitMap",mdcHitMap);
128 if(!sc.isSuccess()) {
129 log << MSG::FATAL << " Could not register hit map" <<endreq;
130 return StatusCode::FAILURE;
131 }
132
133
134 uint32_t getDigiFlag = 0;
135 getDigiFlag += m_maxMdcDigi;
140
141
142 if ((int)mdcDigiVec.size()<m_minMdcDigi){
143 log << MSG::WARNING << " Skip this event for MdcDigiVec.size() < "<<m_minMdcDigi << endreq;
144 return StatusCode::SUCCESS;
145 }
146
147 MdcDigiVec::iterator
iter = mdcDigiVec.begin();
148 for (;
iter != mdcDigiVec.end();
iter++ ) {
154#ifdef MDCPATREC_RESLAYER
155 hit->setResLayer(m_resLayer);
156#endif
157 mdcHitCol->push_back(hit);
159 }
160 return StatusCode::SUCCESS;
161}
ObjectVector< MdcHit > MdcHitCol
std::vector< MdcDigi * > MdcDigiVec
void addHit(MdcHit &theHit)
void setCalibSvc(const MdcCalibFunSvc *calibSvc)
void setCosmicFit(const bool cosmicfit)
void setCountPropTime(const bool count)
MdcDigiVec & getMdcDigiVec(uint32_t control=0)