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 "DstEvent/TofHitStatus.h"
15#include "RootEventData/TTofTrack.h"
16#include "RootEventData/TDstEvent.h"
18#include "RootCnvSvc/Dst/DstCnv.h"
19#include "RootCnvSvc/Dst/TofTrackCnv.h"
20#include "RootCnvSvc/RootAddress.h"
35 MsgStream log(
msgSvc(),
"TofTrackCnv");
46 MsgStream log(
msgSvc(),
"TofTrackCnv");
47 log << MSG::DEBUG <<
"TofTrackCnv::TObjectToDataObject" << endreq;
48 StatusCode sc=StatusCode::SUCCESS;
51 refpObject=tofTrackTdsCol;
55 if (!m_tofTrackCol)
return sc;
56 TIter tofTrackIter(m_tofTrackCol);
58 while ((tofTrackRoot = (
TTofTrack*)tofTrackIter.Next())) {
61 int trackID = tofTrackRoot->
trackID();
62 int tofID = tofTrackRoot->
tofID();
63 unsigned int status = tofTrackRoot->
status();
64 double path = tofTrackRoot->
path();
65 double zrhit = tofTrackRoot->
zrhit();
66 double ph = tofTrackRoot->
ph();
67 double tof = tofTrackRoot->
tof();
68 double errtof = tofTrackRoot->
errtof();
69 double beta = tofTrackRoot->
beta();
71 double texpMuon = tofTrackRoot->
texpMuon();
72 double texpPion = tofTrackRoot->
texpPion();
73 double texpKaon = tofTrackRoot->
texpKaon();
74 double texpProton = tofTrackRoot->
texpProton();
82 double sigmaMuon = tofTrackRoot->
sigmaMuon();
83 double sigmaPion = tofTrackRoot->
sigmaPion();
84 double sigmaKaon = tofTrackRoot->
sigmaKaon();
87 int quality = tofTrackRoot->
quality();
88 double t0 = tofTrackRoot->
t0();
89 double errt0 = tofTrackRoot->
errt0();
90 double errz = tofTrackRoot->
errz();
91 double phi = tofTrackRoot->
phi();
92 double errphi = tofTrackRoot->
errphi();
94 double errenergy = tofTrackRoot->
errenergy();
105 tofTrackTds->
setPh(ph);
127 tofTrackTds->
setT0(t0);
135 tofTrackTdsCol->push_back(tofTrackTds);
142 delete m_tofTrackCol;
144 return StatusCode::SUCCESS;
149 MsgStream log(
msgSvc(),
"TofTrackCnv");
150 log << MSG::DEBUG <<
"TofTrackCnv::DataObjectToTObject" << endreq;
151 StatusCode sc=StatusCode::SUCCESS;
154 if (!tofTrackColTds) {
155 log << MSG::ERROR <<
"Could not downcast to DstTofTrackCol" << endreq;
156 return StatusCode::FAILURE;
162 log << MSG::ERROR <<
"Could not get DstEvent in TDS " << endreq;
163 return StatusCode::FAILURE;
168 log << MSG::ERROR <<
"TofTrackCnv:Could not downcast to TDS ReconEvent" << endreq;
170 IOpaqueAddress *addr;
176 if (!m_tofTrackCol)
return sc;
178 DstTofTrackCol::const_iterator tofTrackTds;
180 for (tofTrackTds = tofTrackColTds->begin(); tofTrackTds != tofTrackColTds->end(); tofTrackTds++) {
182 Int_t tofTrackID = (*tofTrackTds)->tofTrackID();
183 Int_t trackID = (*tofTrackTds)->trackID();
184 Int_t tofID = (*tofTrackTds)->tofID();
185 Int_t strip = (*tofTrackTds)->strip();
186 UInt_t status = (*tofTrackTds)->status();
187 Double_t path = (*tofTrackTds)->path();
188 Double_t zrhit = (*tofTrackTds)->zrhit();
189 Double_t ph = (*tofTrackTds)->ph();
190 Double_t tof = (*tofTrackTds)->tof();
191 Double_t errtof = (*tofTrackTds)->errtof();
192 Double_t beta = (*tofTrackTds)->beta();
193 Double_t texpElectron = (*tofTrackTds)->texpElectron();
194 Double_t texpMuon = (*tofTrackTds)->texpMuon();
195 Double_t texpPion = (*tofTrackTds)->texpPion();
196 Double_t texpKaon = (*tofTrackTds)->texpKaon();
197 Double_t texpProton = (*tofTrackTds)->texpProton();
198 Double_t toffsetElectron = (*tofTrackTds)->toffsetElectron();
199 Double_t toffsetMuon = (*tofTrackTds)->toffsetMuon();
200 Double_t toffsetPion = (*tofTrackTds)->toffsetPion();
201 Double_t toffsetKaon = (*tofTrackTds)->toffsetKaon();
202 Double_t toffsetProton = (*tofTrackTds)->toffsetProton();
203 Double_t toffsetAntiProton = (*tofTrackTds)->toffsetAntiProton();
204 Double_t sigmaElectron = (*tofTrackTds)->sigmaElectron();
205 Double_t sigmaMuon = (*tofTrackTds)->sigmaMuon();
206 Double_t sigmaPion = (*tofTrackTds)->sigmaPion();
207 Double_t sigmaKaon = (*tofTrackTds)->sigmaKaon();
208 Double_t sigmaProton = (*tofTrackTds)->sigmaProton();
209 Double_t sigmaAntiProton = (*tofTrackTds)->sigmaAntiProton();
210 Int_t quality = (*tofTrackTds)->quality();
211 Double_t t0 = (*tofTrackTds)->t0();
212 Double_t errt0 = (*tofTrackTds)->errt0();
213 Double_t errz = (*tofTrackTds)->errz();
214 Double_t phi = (*tofTrackTds)->phi();
215 Double_t errphi = (*tofTrackTds)->errphi();
216 Double_t
energy = (*tofTrackTds)->energy();
217 Double_t errenergy = (*tofTrackTds)->errenergy();
230 tofTrackRoot->
setPh(ph);
231 tofTrackRoot->
setTof(tof);
252 tofTrackRoot->
setT0(t0);
255 tofTrackRoot->
setPhi(phi);
263 return StatusCode::SUCCESS;
ObjectVector< DstTofTrack > DstTofTrackCol
************Class m_ypar INTEGER m_KeyWgt INTEGER m_KeyIHVP 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
std::vector< void * > m_adresses
each converter knows the corresponding adresses
std::string m_rootBranchname
root branchname (may be concatenated of severals)
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