62 MsgStream log(
msgSvc(), name());
64 log << MSG::INFO <<
"in initialize()" << endmsg;
68 NTuplePtr nt2(
ntupleSvc(),
"LumTau/event");
69 if ( nt2 ) m_tuple2 = nt2;
72 m_tuple2 =
ntupleSvc()->book (
"LumTau/event", CLID_ColumnWiseTuple,
"Bhabha N-Tuple signal");
75 status = m_tuple2->addItem (
"run", m_run);
76 status = m_tuple2->addItem (
"rec", m_rec);
77 status = m_tuple2->addItem (
"time", m_time);
78 status = m_tuple2->addItem (
"etot", m_etot);
79 status = m_tuple2->addItem (
"e1", m_e1);
80 status = m_tuple2->addItem (
"e2", m_e2);
81 status = m_tuple2->addItem (
"costht1", m_costht1);
82 status = m_tuple2->addItem (
"costht2", m_costht2);
83 status = m_tuple2->addItem (
"dltphi", m_dltphi);
84 status = m_tuple2->addItem (
"dlttht", m_dlttht);
85 status = m_tuple2->addItem (
"phi1", m_phi1);
86 status = m_tuple2->addItem (
"phi2", m_phi2);
90 log << MSG::ERROR <<
"Cannot book N-tuple2:"<<long(m_tuple2)<<endmsg;
91 return StatusCode::FAILURE;
94 return StatusCode::SUCCESS;
99 StatusCode sc=StatusCode::SUCCESS;
101 MsgStream log(
msgSvc(),name());
102 log<<MSG::INFO<<
"in execute()"<<endreq;
104 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),
"/Event/EventHeader");
107 log<<MSG::DEBUG<<
"ncharg, nneu, tottks = "<<evtRecEvent->totalCharged()<<
" , "<<evtRecEvent->totalNeutral()<<
" , "<<evtRecEvent->totalTracks()<<endreq;
110 log<<MSG::DEBUG <<
"ncharg, nneu, tottks = "<<evtRecEvent->totalCharged()<<
" , "<<evtRecEvent->totalNeutral()<<
" , "<<evtRecEvent->totalTracks()<<endreq;
111 SmartDataPtr<RecEsTimeCol> evTimeCol(eventSvc(),
"/Event/Recon/RecEsTimeCol");
113 double time = eventHeader->time();
116 m_run = eventHeader->runNumber();
117 m_rec = eventHeader->eventNumber();
119 if(m_rec%1000==0)cout<<
"Run "<<m_run<<
" Event "<<m_rec<<endl;
125 if((evtRecEvent->totalTracks() >= 2)){
127 for(
int i = 0;i < evtRecEvent->totalTracks(); i++)
129 if(i>=evtRecTrkCol->size())
break;
131 if(!(*itTrk)->isEmcShowerValid())
continue;
133 double Ener=emcTrk->
energy();
153 log << MSG::INFO <<
"Emax1 = " << Emax1 <<
"Emax2= "<<Emax2<< endreq;
154 if(Emax1 > 0 && Emax2 > 0){
155 double emcphi[2],emctht[2];
156 for(
int i = 0;i < 2; i++)
158 if(i>=evtRecTrkCol->size())
break;
160 if(!(*itTrk)->isEmcShowerValid())
continue;
162 emcphi[i]=emcTrk->
phi();
163 emctht[i]=emcTrk->
theta();
167 double dlttht=(fabs(emctht[0]+emctht[1])-
pai)*180./
pai;
168 m_costht1=
cos(emctht[0]);
169 m_costht2=
cos(emctht[1]);
201 int DiskWrite = m_tuple2->write();
203 log<<MSG::FATAL<<
"ERROR In LumTau DiskWrite!"<<endreq;
207 return StatusCode::SUCCESS;