70{
71 MsgStream log(
msgSvc(), name());
72 log << MSG::INFO << "in BFieldCorr::execute()" << endreq;
73 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),"/Event/EventHeader");
74 int run_no = eventHeader->runNumber();
75 if (run_no < 0) return StatusCode::SUCCESS;
76
78 if (!evtRecEvent)
79 {
80 log << MSG::FATAL << "Could not find EvtRecEvent" << endreq;
81 return StatusCode::SUCCESS;
82 }
83
85 if (!evtRecTrkCol)
86 {
87 log << MSG::FATAL << "Could not find EvtRecTrackCol" << endreq;
88 return StatusCode::SUCCESS;
89 }
90
91 if ((unsigned int)evtRecEvent->totalTracks() > evtRecTrkCol->size()) return StatusCode::SUCCESS;
92
93
94
95 double factor;
96 if (fabs(m_factor - 1.000) < 1e-6)
97 {
98 if (run_no >= RUN_BEGIN_10 && run_no <= RUN_END_10)
99 factor = 1.0004;
100 else if (run_no >= RUN_BEGIN_11 && run_no <= RUN_END_11)
101 factor = 1.0002;
102 else
103 factor = 1.0000;
104 }
105 else
106 {
107 factor = m_factor;
108 }
109 m_Ew[2][2] = fabs(factor) < 1e-6 ? 1.0 : 1.0 / factor;
110
111 for (int i = 0; i < evtRecEvent->totalCharged(); i++)
112 {
114 if (!(*itTrk)->isMdcTrackValid()) continue;
115 if (!(*itTrk)->isMdcKalTrackValid()) continue;
116
117
120 mdc_trk->
setError( mdc_trk->
err().similarity(m_Ew) );
121 mdc_trk->
setP( factor * mdc_trk->
p() );
122 mdc_trk->
setPxy( factor * mdc_trk->
pxy() );
123 mdc_trk->
setPx( factor * mdc_trk->
px() );
124 mdc_trk->
setPy( factor * mdc_trk->
py() );
125 mdc_trk->
setPz( factor * mdc_trk->
pz() );
126
127
135 };
136
137 for (int j = 0; j < 5; j++)
138 {
141 kal_trk->
setZError( kal_trk->
err().similarity(m_Ew), j );
142 kal_trk->
setP( factor * kal_trk->
p(), j );
143 kal_trk->
setPxy( factor * kal_trk->
pxy(), j );
144 kal_trk->
setPx( factor * kal_trk->
px(), j );
145 kal_trk->
setPy( factor * kal_trk->
py(), j );
146 kal_trk->
setPz( factor * kal_trk->
pz(), j );
147 }
148 }
149 return StatusCode::SUCCESS;
150}
EvtRecTrackCol::iterator EvtRecTrackIterator
void setPz(const double pz, const int pid)
const HepVector & helix() const
void setZError(const HepSymMatrix &error, const int pid)
void setP(const double p, const int pid)
void setPx(const double px, const int pid)
void setPxy(const double pxy, const int pid)
void setPy(const double py, const int pid)
static void setPidType(PidType pidType)
void setZHelix(const HepVector &helix, const int pid)
const HepSymMatrix & err() const
void setPxy(const double pxy)
void setPy(const double py)
const HepSymMatrix err() const
void setError(double err[15])
void setP(const double p)
void setHelix(double helix[5])
const HepVector helix() const
......
void setPz(const double pz)
void setPx(const double px)
_EXTERN_ std::string EvtRecEvent
_EXTERN_ std::string EvtRecTrackCol