107 MsgStream log(
msgSvc(), name());
111 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),
"/Event/EventHeader");
113 log << MSG::FATAL <<
"Could not find Event Header" << endreq;
114 return( StatusCode::FAILURE);
118 SmartDataPtr<RecMdcTrackCol> mdcTrackCol(eventSvc(),
"/Event/Recon/RecMdcTrackCol");
120 log << MSG::FATAL <<
"Could not find Mdc track collection!!" << endreq;
121 return( StatusCode::FAILURE);
124 RecMdcTrackCol::iterator iterTrk=mdcTrackCol->begin();
127 double cost1=-999,cost2=-999,
phi1=-999,
phi2=-999;
128 int hit1=-999,hit2=-999,shit1=-999,shit2=-999,charg1=-999,charg2=-999;
129 double mdcbalance=-999;
131 unsigned int ntrk=mdcTrackCol->size();
132 double kappa=-999,tanl=-999,sint=-999;
133 double p=-999,theta=-999,phi=-999;
134 double vz1=-999,vz2=-999,vr1=-999,vr2=-999;
137 for(;iterTrk!= mdcTrackCol->end();iterTrk++) {
141 phi=(*iterTrk)->helix(1);
142 kappa=(*iterTrk)->helix(2);
143 tanl=(*iterTrk)->helix(4);
145 theta=0.5*3.1415926-atan(tanl);
150 if(
abs(kappa)>0.001&&
abs(sint)>0.01){
151 p=
abs(1./kappa)/sint;
155 log << MSG::WARNING <<
"FastTrk=>"<<
" kappa=" <<kappa<<
"; sint="<<sint<<endreq;
165 vz1=(*iterTrk)->helix(3);
167 vr1=(*iterTrk)->helix(0);
169 hit1=(*iterTrk)->getNhits();
171 shit1=(*iterTrk)->nster();
173 charg1=(*iterTrk)->charge();
179 vz2=(*iterTrk)->helix(3);
180 vr2=(*iterTrk)->helix(0);
181 hit2=(*iterTrk)->getNhits();
182 shit2=(*iterTrk)->nster();
183 charg2=(*iterTrk)->charge();
185 log << MSG::DEBUG <<
"p=" <<p <<
", "<<
"theta="<<theta
186 <<
", phi="<<phi<<
", vz="<<(*iterTrk)->helix(3)<<
", vr="<<(*iterTrk)->helix(0)<<endreq;
187 if(
cos(theta)>0) mdcbalance +=1.;
188 else if(
cos(theta)<0) mdcbalance -=1.;
190 if(ntrk>=2) mdcbalance /= ntrk;
200 log << MSG::INFO <<
"ntrk=" << ntrk <<
"; mdc balance=" <<mdcbalance
201 <<
"; pmax1="<< max1 <<
"; pmax2="<< max2
202 <<
"; acol="<< acol<<
"; cost1="<<cost1<<
"; cost2="<<cost2<<endreq;
242 return StatusCode::SUCCESS;