2#define TofTrackCnv_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 "DstEvent/DstEvent.h"
13#include "DstEvent/DstTofTrack.h"
14#include "RootEventData/TTofTrack.h"
15#include "RootEventData/TDstEvent.h"
17#include "RootCnvSvc/Dst/DstCnv.h"
18#include "RootCnvSvc/Dst/TofTrackCnv.h"
19#include "RootCnvSvc/RootAddress.h"
34 MsgStream log(
msgSvc(),
"TofTrackCnv");
36 m_rootBranchname =
"m_tofTrackCol";
38 m_adresses.push_back(&m_tofTrackCol);
45 MsgStream log(
msgSvc(),
"TofTrackCnv");
46 log << MSG::DEBUG <<
"TofTrackCnv::TObjectToDataObject" << endreq;
47 StatusCode sc=StatusCode::SUCCESS;
50 refpObject=tofTrackTdsCol;
54 if (!m_tofTrackCol)
return sc;
55 TIter tofTrackIter(m_tofTrackCol);
57 while ((tofTrackRoot = (
TTofTrack*)tofTrackIter.Next())) {
60 int trackID = tofTrackRoot->
trackID();
61 int tofID = tofTrackRoot->
tofID();
62 unsigned int status = tofTrackRoot->
status();
63 double path = tofTrackRoot->
path();
64 double zrhit = tofTrackRoot->
zrhit();
65 double ph = tofTrackRoot->
ph();
66 double tof = tofTrackRoot->
tof();
67 double errtof = tofTrackRoot->
errtof();
68 double beta = tofTrackRoot->
beta();
70 double texpMuon = tofTrackRoot->
texpMuon();
71 double texpPion = tofTrackRoot->
texpPion();
72 double texpKaon = tofTrackRoot->
texpKaon();
73 double texpProton = tofTrackRoot->
texpProton();
81 double sigmaMuon = tofTrackRoot->
sigmaMuon();
82 double sigmaPion = tofTrackRoot->
sigmaPion();
83 double sigmaKaon = tofTrackRoot->
sigmaKaon();
86 int quality = tofTrackRoot->
quality();
87 double t0 = tofTrackRoot->
t0();
88 double errt0 = tofTrackRoot->
errt0();
89 double errz = tofTrackRoot->
errz();
90 double phi = tofTrackRoot->
phi();
91 double errphi = tofTrackRoot->
errphi();
93 double errenergy = tofTrackRoot->
errenergy();
104 tofTrackTds->
setPh(ph);
126 tofTrackTds->
setT0(t0);
134 tofTrackTdsCol->push_back(tofTrackTds);
141 delete m_tofTrackCol;
143 return StatusCode::SUCCESS;
148 MsgStream log(
msgSvc(),
"TofTrackCnv");
149 log << MSG::DEBUG <<
"TofTrackCnv::DataObjectToTObject" << endreq;
150 StatusCode sc=StatusCode::SUCCESS;
153 if (!tofTrackColTds) {
154 log << MSG::ERROR <<
"Could not downcast to DstTofTrackCol" << endreq;
155 return StatusCode::FAILURE;
161 log << MSG::ERROR <<
"Could not get DstEvent in TDS " << endreq;
162 return StatusCode::FAILURE;
167 log << MSG::ERROR <<
"TofTrackCnv:Could not downcast to TDS ReconEvent" << endreq;
169 IOpaqueAddress *addr;
175 if (!m_tofTrackCol)
return sc;
177 DstTofTrackCol::const_iterator tofTrackTds;
179 for (tofTrackTds = tofTrackColTds->begin(); tofTrackTds != tofTrackColTds->end(); tofTrackTds++) {
181 Int_t tofTrackID = (*tofTrackTds)->
tofTrackID();
182 Int_t trackID = (*tofTrackTds)->trackID();
183 Int_t tofID = (*tofTrackTds)->tofID();
184 UInt_t status = (*tofTrackTds)->status();
185 Double_t path = (*tofTrackTds)->path();
186 Double_t zrhit = (*tofTrackTds)->zrhit();
187 Double_t ph = (*tofTrackTds)->ph();
188 Double_t tof = (*tofTrackTds)->tof();
189 Double_t errtof = (*tofTrackTds)->errtof();
190 Double_t beta = (*tofTrackTds)->beta();
191 Double_t texpElectron = (*tofTrackTds)->texpElectron();
192 Double_t texpMuon = (*tofTrackTds)->texpMuon();
193 Double_t texpPion = (*tofTrackTds)->texpPion();
194 Double_t texpKaon = (*tofTrackTds)->texpKaon();
195 Double_t texpProton = (*tofTrackTds)->texpProton();
196 Double_t toffsetElectron = (*tofTrackTds)->toffsetElectron();
197 Double_t toffsetMuon = (*tofTrackTds)->toffsetMuon();
198 Double_t toffsetPion = (*tofTrackTds)->toffsetPion();
199 Double_t toffsetKaon = (*tofTrackTds)->toffsetKaon();
200 Double_t toffsetProton = (*tofTrackTds)->toffsetProton();
201 Double_t toffsetAntiProton = (*tofTrackTds)->toffsetAntiProton();
202 Double_t sigmaElectron = (*tofTrackTds)->sigmaElectron();
203 Double_t sigmaMuon = (*tofTrackTds)->sigmaMuon();
204 Double_t sigmaPion = (*tofTrackTds)->sigmaPion();
205 Double_t sigmaKaon = (*tofTrackTds)->sigmaKaon();
206 Double_t sigmaProton = (*tofTrackTds)->sigmaProton();
207 Double_t sigmaAntiProton = (*tofTrackTds)->sigmaAntiProton();
208 Int_t quality = (*tofTrackTds)->quality();
209 Double_t t0 = (*tofTrackTds)->t0();
210 Double_t errt0 = (*tofTrackTds)->errt0();
211 Double_t errz = (*tofTrackTds)->errz();
212 Double_t phi = (*tofTrackTds)->phi();
213 Double_t errphi = (*tofTrackTds)->errphi();
214 Double_t
energy = (*tofTrackTds)->energy();
215 Double_t errenergy = (*tofTrackTds)->errenergy();
227 tofTrackRoot->
setPh(ph);
228 tofTrackRoot->
setTof(tof);
249 tofTrackRoot->
setT0(t0);
252 tofTrackRoot->
setPhi(phi);
260 return StatusCode::SUCCESS;
ObjectVector< DstTofTrack > DstTofTrackCol
************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
static TDstEvent * getWriteObject()
returns object to be written (maintained here for all DIGI-converters)
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)
Definition of a Root address, derived from IOpaqueAddress.
Base class for all Root Converters.
IDataProviderSvc * m_eds
pointer to eventdataservice
virtual StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress)
Convert the transient object to the requested representation.
void clearTofTrackCol()
clear the whole array
const TObjArray * getTofTrackCol() const
retrieve the whole TObjArray of TofTrack Data
void addTofTrack(TTofTrack *Track)
Add a TofTrack into the TOF Data collection.
Double_t toffsetPion() const
void setSigmaElectron(Double_t se)
void setSigmaKaon(Double_t sk)
void setSigmaMuon(Double_t smu)
void setToffsetMuon(Double_t tomu)
Double_t sigmaMuon() const
void setToffsetPion(Double_t topi)
Double_t toffsetMuon() const
void setPhi(Double_t phi)
Double_t texpKaon() const
void setEnergy(Double_t energy)
Double_t sigmaElectron() const
void setToffsetProton(Double_t top)
void setToffsetAntiProton(Double_t topb)
void setTexpKaon(Double_t texpk)
Double_t toffsetAntiProton() const
Double_t sigmaPion() const
void setTof(Double_t tof)
void setBeta(Double_t beta)
void setToffsetKaon(Double_t tok)
void setTexpProton(Double_t texpp)
Double_t errenergy() const
Double_t sigmaAntiProton() const
Double_t sigmaKaon() const
void setSigmaPion(Double_t spi)
void setTexpMuon(Double_t texpmu)
void setSigmaProton(Double_t sp)
void setZrHit(Double_t zrhit)
void setTofTrackID(Int_t tofTrackID)
void setErrT0(Double_t errt0)
void setErrZ(Double_t errz)
void setQuality(Int_t quality)
Double_t texpProton() const
void setStatus(UInt_t status)
void setTrackID(Int_t trackID)
void setTexpPion(Double_t texppi)
Double_t toffsetProton() const
void setToffsetElectron(Double_t toe)
Double_t texpPion() const
void setTofID(Int_t tofID)
Double_t texpElectron() const
Double_t sigmaProton() const
void setTexpElectron(Double_t texpe)
void setSigmaAntiProton(Double_t spb)
void setErrPhi(Double_t errphi)
void setErrTof(Double_t etof)
Double_t toffsetElectron() const
Double_t texpMuon() const
void setPath(Double_t path)
Double_t toffsetKaon() const
void setErrEnergy(Double_t errenergy)
virtual StatusCode DataObjectToTObject(DataObject *obj, RootAddress *addr)
transformation to root
virtual StatusCode TObjectToDataObject(DataObject *&obj)
transformation from root
TofTrackCnv(ISvcLocator *svc)
static std::map< const TObject *, const DstTofTrack * > m_rootTofTrackMap
_EXTERN_ std::string Event