1#ifndef RecTofTrackCnv_CXX
2#define RecTofTrackCnv_CXX 1
4#include "GaudiKernel/MsgStream.h"
5#include "GaudiKernel/DataObject.h"
6#include "GaudiKernel/ObjectVector.h"
8#include "TClonesArray.h"
10#include "EventModel/EventModel.h"
12#include "ReconEvent/ReconEvent.h"
13#include "DstEvent/TofHitStatus.h"
14#include "MucRecEvent/RecMucTrack.h"
16#include "RootEventData/TRecTofTrack.h"
17#include "RootEventData/TRecTrackEvent.h"
19#include "RootCnvSvc/Rec/RecTrackCnv.h"
20#include "RootCnvSvc/Rec/RecTofTrackCnv.h"
21#include "RootCnvSvc/RootAddress.h"
37 MsgStream log(
msgSvc(),
"RecTofTrackCnv");
50 MsgStream log(
msgSvc(),
"RecTofTrackCnv");
51 log << MSG::DEBUG <<
"RecTofTrackCnv::TObjectToDataObject" << endreq;
52 StatusCode sc=StatusCode::SUCCESS;
56 refpObject=recTofTrackTdsCol;
59 if (!m_recTofTrackCol)
return sc;
60 TIter recTofTrackIter(m_recTofTrackCol);
62 while ((recTofTrackRoot = (
TRecTofTrack*)recTofTrackIter.Next())) {
64 int tofTrackID = recTofTrackRoot->
tofTrackID();
65 int trackID = recTofTrackRoot->
trackID();
66 int tofID = recTofTrackRoot->
tofID();
67 unsigned int status = recTofTrackRoot->
status();
68 double path = recTofTrackRoot->
path();
69 double zrhit = recTofTrackRoot->
zrhit();
70 double ph = recTofTrackRoot->
ph();
71 double tof = recTofTrackRoot->
tof();
72 double errtof = recTofTrackRoot->
errtof();
73 double beta = recTofTrackRoot->
beta();
75 double texpMuon = recTofTrackRoot->
texpMuon();
76 double texpPion = recTofTrackRoot->
texpPion();
77 double texpKaon = recTofTrackRoot->
texpKaon();
78 double texpProton = recTofTrackRoot->
texpProton();
80 double toffsetMuon = recTofTrackRoot->
toffsetMuon();
81 double toffsetPion = recTofTrackRoot->
toffsetPion();
82 double toffsetKaon = recTofTrackRoot->
toffsetKaon();
86 double sigmaMuon = recTofTrackRoot->
sigmaMuon();
87 double sigmaPion = recTofTrackRoot->
sigmaPion();
88 double sigmaKaon = recTofTrackRoot->
sigmaKaon();
89 double sigmaProton = recTofTrackRoot->
sigmaProton();
91 int quality = recTofTrackRoot->
quality();
92 double t0 = recTofTrackRoot->
t0();
93 double errt0 = recTofTrackRoot->
errt0();
94 double errz = recTofTrackRoot->
errz();
95 double phi = recTofTrackRoot->
phi();
96 double errphi = recTofTrackRoot->
errphi();
98 double errenergy = recTofTrackRoot->
errenergy();
109 recTofTrackTds->
setPh(ph);
110 recTofTrackTds->
setTof(tof);
131 recTofTrackTds->
setT0(t0);
134 recTofTrackTds->
setPhi(phi);
139 recTofTrackTdsCol->push_back(recTofTrackTds);
142 delete m_recTofTrackCol;
143 m_recTofTrackCol = 0;
145 return StatusCode::SUCCESS;
150 MsgStream log(
msgSvc(),
"RecTofTrackCnv");
151 log << MSG::DEBUG <<
"RecTofTrackCnv::DataObjectToTObject" << endreq;
152 StatusCode sc=StatusCode::SUCCESS;
155 if (!recTofTrackColTds) {
156 log << MSG::ERROR <<
"Could not downcast to TofTrackCol" << endreq;
157 return StatusCode::FAILURE;
163 log << MSG::ERROR <<
"Could not get RecEvent in TDS " << endreq;
164 return StatusCode::FAILURE;
169 log << MSG::ERROR <<
"RecMucTrackCnv:Could not downcast to TDS DigiEvent" << endreq;
172 IOpaqueAddress *addr;
178 if (!m_recTofTrackCol)
return sc;
180 RecTofTrackCol::const_iterator recTofTrackTds;
182 for (recTofTrackTds = recTofTrackColTds->begin(); recTofTrackTds != recTofTrackColTds->end(); recTofTrackTds++) {
184 Int_t tofTrackID = (*recTofTrackTds)->tofTrackID();
185 Int_t trackID = (*recTofTrackTds)->trackID();
186 Int_t tofID = (*recTofTrackTds)->tofID();
187 Int_t strip = (*recTofTrackTds)->strip();
188 UInt_t status = (*recTofTrackTds)->status();
189 Double_t path = (*recTofTrackTds)->path();
190 Double_t zrhit = (*recTofTrackTds)->zrhit();
191 Double_t ph = (*recTofTrackTds)->ph();
192 Double_t tof = (*recTofTrackTds)->tof();
193 Double_t errtof = (*recTofTrackTds)->errtof();
194 Double_t beta = (*recTofTrackTds)->beta();
195 Double_t texpElectron = (*recTofTrackTds)->texpElectron();
196 Double_t texpMuon = (*recTofTrackTds)->texpMuon();
197 Double_t texpPion = (*recTofTrackTds)->texpPion();
198 Double_t texpKaon = (*recTofTrackTds)->texpKaon();
199 Double_t texpProton = (*recTofTrackTds)->texpProton();
200 Double_t toffsetElectron = (*recTofTrackTds)->toffsetElectron();
201 Double_t toffsetMuon = (*recTofTrackTds)->toffsetMuon();
202 Double_t toffsetPion = (*recTofTrackTds)->toffsetPion();
203 Double_t toffsetKaon = (*recTofTrackTds)->toffsetKaon();
204 Double_t toffsetProton = (*recTofTrackTds)->toffsetProton();
205 Double_t toffsetAntiProton = (*recTofTrackTds)->toffsetAntiProton();
206 Double_t sigmaElectron = (*recTofTrackTds)->sigmaElectron();
207 Double_t sigmaMuon = (*recTofTrackTds)->sigmaMuon();
208 Double_t sigmaPion = (*recTofTrackTds)->sigmaPion();
209 Double_t sigmaKaon = (*recTofTrackTds)->sigmaKaon();
210 Double_t sigmaProton = (*recTofTrackTds)->sigmaProton();
211 Double_t sigmaAntiProton = (*recTofTrackTds)->sigmaAntiProton();
212 Int_t quality = (*recTofTrackTds)->quality();
213 Double_t t0 = (*recTofTrackTds)->t0();
214 Double_t errt0 = (*recTofTrackTds)->errt0();
215 Double_t errz = (*recTofTrackTds)->errz();
216 Double_t phi = (*recTofTrackTds)->phi();
217 Double_t errphi = (*recTofTrackTds)->errphi();
218 Double_t
energy = (*recTofTrackTds)->energy();
219 Double_t errenergy = (*recTofTrackTds)->errenergy();
230 recTofTrackRoot->
setPath(path);
232 recTofTrackRoot->
setPh(ph);
233 recTofTrackRoot->
setTof(tof);
235 recTofTrackRoot->
setBeta(beta);
254 recTofTrackRoot->
setT0(t0);
256 recTofTrackRoot->
setErrZ(errz);
257 recTofTrackRoot->
setPhi(phi);
266 return StatusCode::SUCCESS;
ObjectVector< RecTofTrack > RecTofTrackCol
************Class m_ypar INTEGER m_KeyWgt INTEGER m_nphot INTEGER m_KeyGPS INTEGER m_IsBeamPolarized INTEGER m_EvtGenInterface DOUBLE PRECISION m_Emin DOUBLE PRECISION m_sphot DOUBLE PRECISION m_Xenph DOUBLE PRECISION m_q2 DOUBLE PRECISION m_PolBeam2 DOUBLE PRECISION m_xErrPb *COMMON c_KK2f $ !CMS energy average $ !Spin Polarization vector first beam $ !Spin Polarization vector second beam $ !Beam energy spread[GeV] $ !minimum hadronization energy[GeV] $ !input READ never touch them !$ !debug facility $ !maximum weight $ !inverse alfaQED $ !minimum real photon energy
void setStatus(unsigned int status)
void setTexpElectron(double texpe)
void setTexpMuon(double texpmu)
void setToffsetPion(double topi)
void setEnergy(double energy)
void setPath(double path)
void setTexpPion(double texppi)
void setTofTrackID(int tofTrackID)
void setSigmaMuon(double smu)
void setQuality(int quality)
void setTexpKaon(double texpk)
void setZrHit(double zrhit)
void setToffsetMuon(double tomu)
void setSigmaProton(double sp)
void setToffsetProton(double top)
void setErrTof(double etof)
void setErrT0(double errt0)
void setTexpProton(double texpp)
void setToffsetAntiProton(double topb)
void setBeta(double beta)
void setSigmaKaon(double sk)
void setErrEnergy(double errenergy)
void setTrackID(int trackID)
void setErrZ(double errz)
void setSigmaAntiProton(double spb)
void setErrPhi(double errphi)
void setSigmaPion(double spi)
void setSigmaElectron(double se)
void setToffsetKaon(double tok)
void setToffsetElectron(double toe)
virtual StatusCode DataObjectToTObject(DataObject *obj, RootAddress *addr)
transformation to root
RecTofTrackCnv(ISvcLocator *svc)
virtual StatusCode TObjectToDataObject(DataObject *&obj)
transformation from root
static TRecTrackEvent * getWriteObject()
returns object to be written (maintained here for all DIGI-converters)
Definition of a Root address, derived from IOpaqueAddress.
RecTrackCnv * getRecTrackCnv()
Base class for all Root Converters.
IDataProviderSvc * m_eds
pointer to eventdataservice
std::vector< void * > m_adresses
each converter knows the corresponding adresses
virtual StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress)
Convert the transient object to the requested representation.
void setTexpElectron(Double_t texpe)
Double_t texpMuon() const
void setToffsetAntiProton(Double_t topb)
void setSigmaKaon(Double_t sk)
Double_t sigmaPion() const
Double_t sigmaAntiProton() const
void setTof(Double_t tof)
void setTrackID(Int_t trackID)
Double_t texpKaon() const
void setTexpProton(Double_t texpp)
Double_t toffsetMuon() const
void setToffsetKaon(Double_t tok)
Double_t sigmaProton() const
Double_t texpProton() const
void setSigmaElectron(Double_t se)
void setEnergy(Double_t energy)
Double_t texpElectron() const
void setStatus(UInt_t status)
void setToffsetElectron(Double_t toe)
Double_t sigmaMuon() const
void setTexpKaon(Double_t texpk)
void setToffsetMuon(Double_t tomu)
void setQuality(Int_t quality)
void setSigmaPion(Double_t spi)
Double_t toffsetPion() const
void setErrZ(Double_t errz)
void setErrTof(Double_t etof)
Double_t toffsetKaon() const
Double_t texpPion() const
void setTofID(Int_t tofID)
void setSigmaAntiProton(Double_t spb)
Double_t toffsetAntiProton() const
void setToffsetPion(Double_t topi)
void setBeta(Double_t beta)
Double_t toffsetProton() const
Double_t errenergy() const
void setSigmaMuon(Double_t smu)
void setPhi(Double_t phi)
void setErrPhi(Double_t errphi)
Double_t sigmaElectron() const
void setTofTrackID(Int_t tofTrackID)
void setPath(Double_t path)
void setErrEnergy(Double_t errenergy)
void setTexpMuon(Double_t texpmu)
void setToffsetProton(Double_t top)
void setSigmaProton(Double_t sp)
void setZrHit(Double_t zrhit)
void setTexpPion(Double_t texppi)
Double_t sigmaKaon() const
Double_t toffsetElectron() const
void setErrT0(Double_t errt0)
void clearTofTrackCol()
clear the whole array
const TObjArray * getTofTrackCol() const
retrieve the whole TObjArray of TofTrack Data
void addTofTrack(TRecTofTrack *Track)
Add a TofTrack into the TOF Data collection.
static std::map< const TObject *, const RecTofTrack * > m_rootRecTofTrackMap
_EXTERN_ std::string Event