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 "MucRecEvent/RecMucTrack.h"
15#include "RootEventData/TRecTofTrack.h"
16#include "RootEventData/TRecTrackEvent.h"
18#include "RootCnvSvc/Rec/RecTrackCnv.h"
19#include "RootCnvSvc/Rec/RecTofTrackCnv.h"
20#include "RootCnvSvc/RootAddress.h"
36 MsgStream log(
msgSvc(),
"RecTofTrackCnv");
49 MsgStream log(
msgSvc(),
"RecTofTrackCnv");
50 log << MSG::DEBUG <<
"RecTofTrackCnv::TObjectToDataObject" << endreq;
51 StatusCode sc=StatusCode::SUCCESS;
55 refpObject=recTofTrackTdsCol;
58 if (!m_recTofTrackCol)
return sc;
59 TIter recTofTrackIter(m_recTofTrackCol);
61 while ((recTofTrackRoot = (
TRecTofTrack*)recTofTrackIter.Next())) {
63 int tofTrackID = recTofTrackRoot->
tofTrackID();
64 int trackID = recTofTrackRoot->
trackID();
65 int tofID = recTofTrackRoot->
tofID();
66 unsigned int status = recTofTrackRoot->
status();
67 double path = recTofTrackRoot->
path();
68 double zrhit = recTofTrackRoot->
zrhit();
69 double ph = recTofTrackRoot->
ph();
70 double tof = recTofTrackRoot->
tof();
71 double errtof = recTofTrackRoot->
errtof();
72 double beta = recTofTrackRoot->
beta();
74 double texpMuon = recTofTrackRoot->
texpMuon();
75 double texpPion = recTofTrackRoot->
texpPion();
76 double texpKaon = recTofTrackRoot->
texpKaon();
77 double texpProton = recTofTrackRoot->
texpProton();
79 double toffsetMuon = recTofTrackRoot->
toffsetMuon();
80 double toffsetPion = recTofTrackRoot->
toffsetPion();
81 double toffsetKaon = recTofTrackRoot->
toffsetKaon();
85 double sigmaMuon = recTofTrackRoot->
sigmaMuon();
86 double sigmaPion = recTofTrackRoot->
sigmaPion();
87 double sigmaKaon = recTofTrackRoot->
sigmaKaon();
88 double sigmaProton = recTofTrackRoot->
sigmaProton();
90 int quality = recTofTrackRoot->
quality();
91 double t0 = recTofTrackRoot->
t0();
92 double errt0 = recTofTrackRoot->
errt0();
93 double errz = recTofTrackRoot->
errz();
94 double phi = recTofTrackRoot->
phi();
95 double errphi = recTofTrackRoot->
errphi();
97 double errenergy = recTofTrackRoot->
errenergy();
108 recTofTrackTds->
setPh(ph);
109 recTofTrackTds->
setTof(tof);
130 recTofTrackTds->
setT0(t0);
133 recTofTrackTds->
setPhi(phi);
138 recTofTrackTdsCol->push_back(recTofTrackTds);
141 delete m_recTofTrackCol;
142 m_recTofTrackCol = 0;
144 return StatusCode::SUCCESS;
149 MsgStream log(
msgSvc(),
"RecTofTrackCnv");
150 log << MSG::DEBUG <<
"RecTofTrackCnv::DataObjectToTObject" << endreq;
151 StatusCode sc=StatusCode::SUCCESS;
154 if (!recTofTrackColTds) {
155 log << MSG::ERROR <<
"Could not downcast to TofTrackCol" << endreq;
156 return StatusCode::FAILURE;
162 log << MSG::ERROR <<
"Could not get RecEvent in TDS " << endreq;
163 return StatusCode::FAILURE;
168 log << MSG::ERROR <<
"RecMucTrackCnv:Could not downcast to TDS DigiEvent" << endreq;
171 IOpaqueAddress *addr;
177 if (!m_recTofTrackCol)
return sc;
179 RecTofTrackCol::const_iterator recTofTrackTds;
181 for (recTofTrackTds = recTofTrackColTds->begin(); recTofTrackTds != recTofTrackColTds->end(); recTofTrackTds++) {
183 Int_t tofTrackID = (*recTofTrackTds)->tofTrackID();
184 Int_t trackID = (*recTofTrackTds)->trackID();
185 Int_t tofID = (*recTofTrackTds)->tofID();
186 UInt_t status = (*recTofTrackTds)->status();
187 Double_t path = (*recTofTrackTds)->path();
188 Double_t zrhit = (*recTofTrackTds)->zrhit();
189 Double_t ph = (*recTofTrackTds)->ph();
190 Double_t tof = (*recTofTrackTds)->tof();
191 Double_t errtof = (*recTofTrackTds)->errtof();
192 Double_t beta = (*recTofTrackTds)->beta();
193 Double_t texpElectron = (*recTofTrackTds)->texpElectron();
194 Double_t texpMuon = (*recTofTrackTds)->texpMuon();
195 Double_t texpPion = (*recTofTrackTds)->texpPion();
196 Double_t texpKaon = (*recTofTrackTds)->texpKaon();
197 Double_t texpProton = (*recTofTrackTds)->texpProton();
198 Double_t toffsetElectron = (*recTofTrackTds)->toffsetElectron();
199 Double_t toffsetMuon = (*recTofTrackTds)->toffsetMuon();
200 Double_t toffsetPion = (*recTofTrackTds)->toffsetPion();
201 Double_t toffsetKaon = (*recTofTrackTds)->toffsetKaon();
202 Double_t toffsetProton = (*recTofTrackTds)->toffsetProton();
203 Double_t toffsetAntiProton = (*recTofTrackTds)->toffsetAntiProton();
204 Double_t sigmaElectron = (*recTofTrackTds)->sigmaElectron();
205 Double_t sigmaMuon = (*recTofTrackTds)->sigmaMuon();
206 Double_t sigmaPion = (*recTofTrackTds)->sigmaPion();
207 Double_t sigmaKaon = (*recTofTrackTds)->sigmaKaon();
208 Double_t sigmaProton = (*recTofTrackTds)->sigmaProton();
209 Double_t sigmaAntiProton = (*recTofTrackTds)->sigmaAntiProton();
210 Int_t quality = (*recTofTrackTds)->quality();
211 Double_t t0 = (*recTofTrackTds)->t0();
212 Double_t errt0 = (*recTofTrackTds)->errt0();
213 Double_t errz = (*recTofTrackTds)->errz();
214 Double_t phi = (*recTofTrackTds)->phi();
215 Double_t errphi = (*recTofTrackTds)->errphi();
216 Double_t
energy = (*recTofTrackTds)->energy();
217 Double_t errenergy = (*recTofTrackTds)->errenergy();
226 recTofTrackRoot->
setPath(path);
228 recTofTrackRoot->
setPh(ph);
229 recTofTrackRoot->
setTof(tof);
231 recTofTrackRoot->
setBeta(beta);
250 recTofTrackRoot->
setT0(t0);
252 recTofTrackRoot->
setErrZ(errz);
253 recTofTrackRoot->
setPhi(phi);
262 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