1#include "GaudiKernel/MsgStream.h"
5#include "GaudiKernel/Bootstrap.h"
6#include "GaudiKernel/SmartDataPtr.h"
8#include "EventModel/Event.h"
9#include "EventModel/EventHeader.h"
10#include "MdcRecEvent/RecMdcTrack.h"
11#include "HltAlgorithms/EFChargedTrack.h"
19 MsgStream log(
msgSvc(), name);
46 MsgStream log(
msgSvc(), name());
47 log << MSG::INFO <<
"in initialize()" << endreq;
53 if ( sc.isFailure() ) {
54 log << MSG::ERROR <<
"m_HltStoreSvc->put(ntrk) wrong" << endreq;
58 if ( sc.isFailure() ) {
59 log << MSG::ERROR <<
"m_HltStoreSvc->put(acol) wrong" << endreq;
63 if ( sc.isFailure() ) {
64 log << MSG::ERROR <<
"m_HltStoreSvc->put(mbal) wrong" << endreq;
68 if ( sc.isFailure() ) {
69 log << MSG::ERROR <<
"m_HltStoreSvc->put(pmax1) wrong" << endreq;
73 if ( sc.isFailure() ) {
74 log << MSG::ERROR <<
"m_HltStoreSvc->put(pmax2) wrong" << endreq;
78 if ( sc.isFailure() ) {
79 log << MSG::ERROR <<
"m_HltStoreSvc->put(cost1) wrong" << endreq;
83 if ( sc.isFailure() ) {
84 log << MSG::ERROR <<
"m_HltStoreSvc->put(cost2) wrong" << endreq;
88 if ( sc.isFailure() ) {
89 log << MSG::ERROR <<
"m_HltStoreSvc->put(vr) wrong" << endreq;
93 if ( sc.isFailure() ) {
94 log << MSG::ERROR <<
"m_HltStoreSvc->put(vz) wrong" << endreq;
98 log << MSG::DEBUG <<
"finish initialize()" << endreq;
100 return StatusCode::SUCCESS;
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;
246 MsgStream log(
msgSvc(), name());
247 log << MSG::INFO <<
"in finalize()" << endmsg;
248 return StatusCode::SUCCESS;
*******INTEGER m_nBinMax INTEGER m_NdiMax !No of bins in histogram for cell exploration division $ !Last vertex $ !Last active cell $ !Last cell in buffer $ !No of sampling when dividing cell $ !No of function total $ !Flag for random ceel for $ !Flag for type of for WtMax $ !Flag which decides whether vertices are included in the sampling $ entire domain is hyp !Maximum effective eevents per saves r n generator level $ !Flag for chat level in output
double sin(const BesAngle a)
double cos(const BesAngle a)
void setValue(float value)
virtual StatusCode finalize()
virtual ~EFChargedTrack()
virtual StatusCode initialize()
virtual StatusCode execute()
EFChargedTrack(const std::string &name, ISvcLocator *pSvcLocator)
bool addToEFVec(uint32_t val, uint32_t pos)
bool appToEFVec(double val, uint32_t pos)
bool setVecBit(uint32_t val, uint32_t vecpos, uint32_t bbegin, uint32_t bend)
bool put(const std::string &name, const T &value)
virtual StatusCode initialize()
HltStoreSvc * m_HltStoreSvc