63 MsgStream log(
msgSvc(), name());
65 log << MSG::INFO <<
"in initialize()" << endmsg;
69 status = service(
"InjSigIntervalSvc", m_intervalSvc);
70 if ( status != StatusCode::SUCCESS ){
71 log << MSG::FATAL <<
"can not use InjSigIntervalSvc" << endreq;
74 NTuplePtr nt2(
ntupleSvc(),
"LumTau/event");
75 if ( nt2 ) m_tuple2 = nt2;
78 m_tuple2 =
ntupleSvc()->book (
"LumTau/event", CLID_ColumnWiseTuple,
"Bhabha N-Tuple signal");
81 status = m_tuple2->addItem (
"topup", m_topup);
82 status = m_tuple2->addItem (
"run", m_run);
83 status = m_tuple2->addItem (
"rec", m_rec);
84 status = m_tuple2->addItem (
"time", m_time);
85 status = m_tuple2->addItem (
"etsT1", m_etsT1);
86 status = m_tuple2->addItem (
"etot", m_etot);
87 status = m_tuple2->addItem (
"e1", m_e1);
88 status = m_tuple2->addItem (
"e2", m_e2);
89 status = m_tuple2->addItem (
"costht1", m_costht1);
90 status = m_tuple2->addItem (
"costht2", m_costht2);
91 status = m_tuple2->addItem (
"dltphi", m_dltphi);
92 status = m_tuple2->addItem (
"dlttht", m_dlttht);
93 status = m_tuple2->addItem (
"phi1", m_phi1);
94 status = m_tuple2->addItem (
"phi2", m_phi2);
98 log << MSG::ERROR <<
"Cannot book N-tuple2:"<<long(m_tuple2)<<endmsg;
99 return StatusCode::FAILURE;
102 return StatusCode::SUCCESS;
107 StatusCode sc=StatusCode::SUCCESS;
109 MsgStream log(
msgSvc(),name());
110 log<<MSG::INFO<<
"in execute()"<<endreq;
113 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),
"/Event/EventHeader");
116 log<<MSG::DEBUG<<
"ncharg, nneu, tottks = "<<evtRecEvent->totalCharged()<<
" , "<<evtRecEvent->totalNeutral()<<
" , "<<evtRecEvent->totalTracks()<<endreq;
119 log<<MSG::DEBUG <<
"ncharg, nneu, tottks = "<<evtRecEvent->totalCharged()<<
" , "<<evtRecEvent->totalNeutral()<<
" , "<<evtRecEvent->totalTracks()<<endreq;
120 SmartDataPtr<RecEsTimeCol> evTimeCol(eventSvc(),
"/Event/Recon/RecEsTimeCol");
124 log<<MSG::DEBUG <<
"interval = " << interval << endreq;
126 if (interval <= 0 ) {
127 log << MSG::FATAL <<
"error in reading the interval!" << endreq;
128 return StatusCode::FAILURE;
130 else if ( interval < 100 ) {
134 double time = eventHeader->time();
135 log << MSG::DEBUG <<
"time = " <<
time << endreq;
136 if (
time <=0 )
return StatusCode::SUCCESS;
138 m_etsT1 = eventHeader->etsT1()/2000000.;
139 log << MSG::DEBUG <<
"ets time = " << m_etsT1 << endreq;
141 m_run = eventHeader->runNumber();
142 m_rec = eventHeader->eventNumber();
144 if(m_rec%1000==0) log << MSG::INFO <<
"Run "<<m_run<<
" Event "<<m_rec<<endreq;
150 if((evtRecEvent->totalTracks() >= 2)){
152 for(
int i = 0;i < evtRecEvent->totalTracks(); i++)
154 if(i>=evtRecTrkCol->size())
break;
156 if(!(*itTrk)->isEmcShowerValid())
continue;
158 double Ener=emcTrk->
energy();
178 log << MSG::INFO <<
"Emax1 = " << Emax1 <<
"Emax2= "<<Emax2<< endreq;
179 if(Emax1 > 0 && Emax2 > 0){
180 double emcphi[2],emctht[2];
181 for(
int i = 0;i < 2; i++)
183 if(i>=evtRecTrkCol->size())
break;
185 if(!(*itTrk)->isEmcShowerValid())
continue;
187 emcphi[i]=emcTrk->
phi();
188 emctht[i]=emcTrk->
theta();
192 double dlttht=(fabs(emctht[0]+emctht[1])-
pai)*180./
pai;
193 m_costht1=
cos(emctht[0]);
194 m_costht2=
cos(emctht[1]);
226 int DiskWrite = m_tuple2->write();
228 log<<MSG::FATAL<<
"ERROR In LumTau DiskWrite!"<<endreq;
232 return StatusCode::SUCCESS;