1#ifndef RecMdcKalHelixSegCnv_CXX
2#define RecMdcKalHelixSegCnv_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 "MdcRecEvent/RecMdcKalHelixSeg.h"
14#include "Identifier/Identifier.h"
16#include "RootEventData/TRecMdcKalHelixSeg.h"
17#include "RootEventData/TRecTrackEvent.h"
19#include "RootCnvSvc/Rec/RecTrackCnv.h"
20#include "RootCnvSvc/Rec/RecMdcKalHelixSegCnv.h"
21#include "RootCnvSvc/RootAddress.h"
33 MsgStream log(
msgSvc(),
"RecMdcKalHelixSegCnv");
36 m_rootBranchname =
"m_recMdcKalHelixSegCol";
38 m_adresses.push_back(&m_recMdcKalHelixSegCol);
39 m_recMdcKalHelixSegCol=0;
44 MsgStream log(
msgSvc(),
"RecMdcKalHelixSegCnv");
45 log << MSG::DEBUG <<
"RecMdcKalHelixSegCnv::TObjectToDataObject" << endreq;
49 refpObject = recMdcKalHelixSegCol;
52 if (!m_recMdcKalHelixSegCol)
return StatusCode::SUCCESS;
53 TIter mdcHitIter(m_recMdcKalHelixSegCol);
57 int trackId = recMdcKalHelixSegRoot->
getTrackId();
58 int flagLR = recMdcKalHelixSegRoot->
getFlagLR();
60 double tdc = recMdcKalHelixSegRoot->
getTdc();
61 double adc = recMdcKalHelixSegRoot->
getAdc();
62 double zhit = recMdcKalHelixSegRoot->
getZhit();
63 double tof = recMdcKalHelixSegRoot->
getTof();
64 double docaIncl = recMdcKalHelixSegRoot->
getDocaIncl();
65 double docaExcl = recMdcKalHelixSegRoot->
getDocaExcl();
66 double driftDist= recMdcKalHelixSegRoot->
getDD();
67 double entra = recMdcKalHelixSegRoot->
getEntra();
68 double driftT = recMdcKalHelixSegRoot->
getDT();
82 for(
int i=0, k=0; i<5; i++){
97 recMdcKalHelixSeg->
setTdc( tdc );
98 recMdcKalHelixSeg->
setAdc( adc );
99 recMdcKalHelixSeg->
setZhit( zhit );
100 recMdcKalHelixSeg->
setTof( tof );
103 recMdcKalHelixSeg->
setDD( driftDist );
104 recMdcKalHelixSeg->
setEntra( entra );
105 recMdcKalHelixSeg->
setDT( driftT );
122 recMdcKalHelixSegCol->push_back(recMdcKalHelixSeg);
126 return StatusCode::SUCCESS;
131 MsgStream log(
msgSvc(),
"RecMdcKalHelixSegCnv");
132 log << MSG::DEBUG <<
"RecMdcKalHelixSegCnv::DataObjectToTObject" << endreq;
136 log << MSG::ERROR <<
"Could not downcast to RecMdcKalHelixSegCol" << endreq;
137 return StatusCode::FAILURE;
143 log << MSG::ERROR <<
"Could not get ReconEvent in TDS " << endreq;
144 return StatusCode::FAILURE;
149 log << MSG::ERROR <<
"RecMdcKalHelixSegCnv:Could not downcast to TDS ReconEvent" << endreq;
152 IOpaqueAddress *addr;
158 if (!m_recMdcKalHelixSegCol)
return StatusCode::SUCCESS;
161 RecMdcKalHelixSegCol::const_iterator recMdcKalHelixSeg;
163 for (recMdcKalHelixSeg = mdcHitColTds->begin(); recMdcKalHelixSeg != mdcHitColTds->end(); recMdcKalHelixSeg++) {
164 Int_t trackId =(*recMdcKalHelixSeg)->
getTrackId();
165 Int_t flagLR = (*recMdcKalHelixSeg)->getFlagLR();
166 UInt_t mdcId = (*recMdcKalHelixSeg)->getMdcId().get_value();
167 Double_t tdc = (*recMdcKalHelixSeg)->getTdc();
168 Double_t adc = (*recMdcKalHelixSeg)->getAdc();
169 Double_t zhit = (*recMdcKalHelixSeg)->getZhit();
170 Double_t tof = (*recMdcKalHelixSeg)->getTof();
171 Double_t docaIncl = (*recMdcKalHelixSeg)->getDocaIncl();
172 Double_t docaExcl = (*recMdcKalHelixSeg)->getDocaExcl();
173 Double_t driftDist= (*recMdcKalHelixSeg)->getDD();
174 Double_t entra = (*recMdcKalHelixSeg)->getEntra();
175 Double_t driftT = (*recMdcKalHelixSeg)->getDT();
187 HepVector helixIncl_vct = (*recMdcKalHelixSeg)->getHelixIncl();
188 HepVector helixExcl_vct = (*recMdcKalHelixSeg)->getHelixExcl();
192 Double_t helixIncl[5], helixExcl[5];
193 for(Int_t i=0; i<5; i++){
194 helixIncl[i] = helixIncl_vct[i];
195 helixExcl[i] = helixExcl_vct[i];
208 recMdcKalHelixSegRoot->
setFlagLR( flagLR );
210 recMdcKalHelixSegRoot->
setTdc( tdc );
211 recMdcKalHelixSegRoot->
setAdc( adc );
212 recMdcKalHelixSegRoot->
setZhit( zhit );
213 recMdcKalHelixSegRoot->
setTof( tof );
216 recMdcKalHelixSegRoot->
setDD( driftDist );
217 recMdcKalHelixSegRoot->
setEntra( entra );
218 recMdcKalHelixSegRoot->
setDT( driftT );
235 log<<MSG::INFO<<
" recMdcKalHelixSegRoot.dd: "<<recMdcKalHelixSegRoot->
getDD()
236 <<
" recMdcKalHelixSegRoot.entra: "<<recMdcKalHelixSegRoot->
getEntra()
243 return StatusCode::SUCCESS;
ObjectVector< RecMdcKalHelixSeg > RecMdcKalHelixSegCol
virtual StatusCode DataObjectToTObject(DataObject *obj, RootAddress *addr)
transformation to root
virtual StatusCode TObjectToDataObject(DataObject *&obj)
transformation from root
RecMdcKalHelixSegCnv(ISvcLocator *svc)
void setTrackId(int trackid)
void setDocaExcl(double doca)
void setHelixIncl(const HepVector &helix)
void setEntra(double entra)
int getTrackId(void) const
void setFlagLR(int flagLR)
void setHelixExcl(const HepVector &helix)
void setZhit(double zhit)
void setMdcId(Identifier mdcid)
void setDocaIncl(double doca)
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
virtual StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress)
Convert the transient object to the requested representation.
const Double_t getDocaIncl(void) const
const Double_t getEntra(void) const
void setEntra(Double_t entra)
const UInt_t getMdcId() const
void setAdc(Double_t adc)
void setTof(Double_t tof)
const Double_t getHelixExcl(Int_t i) const
void setHelixIncl(const Double_t helix[5])
void setDocaExcl(Double_t docaexcl)
void setZhit(Double_t zhit)
void setDocaIncl(Double_t docaincl)
void setMdcId(UInt_t mdcid)
const Double_t getHelixIncl(Int_t i) const
void setTrackId(Int_t trkid)
const Double_t getTof(void) const
const Double_t getTdc(void) const
const Double_t getDT(void) const
void setDT(Double_t driftT)
void setHelixExcl(const Double_t helix[5])
const Double_t getDD(void) const
const Double_t getZhit(void) const
const Double_t getAdc(void) const
const Int_t getTrackId(void) const
const Int_t getFlagLR(void) const
const Double_t getDocaExcl(void) const
void setTdc(Double_t tdc)
void addRecMdcKalHelixSeg(TRecMdcKalHelixSeg *Track)
void clearRecMdcKalHelixSegCol()
const TObjArray * getRecMdcKalHelixSegCol() const
static std::map< const TObject *, const RecMdcKalHelixSeg * > m_rootRecMdcKalHelixSegMap
_EXTERN_ std::string Event