BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
RecMdcKalHelixSegCnv Class Reference

#include <RecMdcKalHelixSegCnv.h>

Inheritance diagram for RecMdcKalHelixSegCnv:

Public Member Functions

virtual ~RecMdcKalHelixSegCnv ()
 RecMdcKalHelixSegCnv (ISvcLocator *svc)
virtual StatusCode DataObjectToTObject (DataObject *obj, RootAddress *addr)
 transformation to root
virtual StatusCode TObjectToDataObject (DataObject *&obj)
 transformation from root
virtual ~RecMdcKalHelixSegCnv ()
 RecMdcKalHelixSegCnv (ISvcLocator *svc)
virtual StatusCode DataObjectToTObject (DataObject *obj, RootAddress *addr)
 transformation to root
virtual StatusCode TObjectToDataObject (DataObject *&obj)
 transformation from root
virtual ~RecMdcKalHelixSegCnv ()
 RecMdcKalHelixSegCnv (ISvcLocator *svc)
virtual StatusCode DataObjectToTObject (DataObject *obj, RootAddress *addr)
 transformation to root
virtual StatusCode TObjectToDataObject (DataObject *&obj)
 transformation from root
Public Member Functions inherited from RootEventBaseCnv
 RootEventBaseCnv (const CLID &clid, ISvcLocator *svc)
virtual ~RootEventBaseCnv ()
virtual long repSvcType () const
virtual StatusCode initialize ()
virtual StatusCode finalize ()
void declareObject (const std::string &fullPath, const CLID &clid, const std::string &treename, const std::string &branchname)
 Store TDS path to link a particular converter to an object on the TDS.
virtual StatusCode createObj (IOpaqueAddress *addr, DataObject *&dat)
 Convert the persistent object to transient.
virtual StatusCode createRep (DataObject *pObject, IOpaqueAddress *&refpAddress)
 Convert the transient object to the requested representation.
virtual StatusCode fillRepRefs (IOpaqueAddress *pAddress, DataObject *pObject)
 Resolve the references of the converted object.
virtual StatusCode fillObjRefs (IOpaqueAddress *pAddress, DataObject *pObject)
 Resolve the references of the converted object.
TObject * getReadObject () const
 get the object to be read
 RootEventBaseCnv (const CLID &clid, ISvcLocator *svc)
virtual ~RootEventBaseCnv ()
virtual long repSvcType () const
virtual StatusCode initialize ()
virtual StatusCode finalize ()
void declareObject (const std::string &fullPath, const CLID &clid, const std::string &treename, const std::string &branchname)
 Store TDS path to link a particular converter to an object on the TDS.
virtual StatusCode createObj (IOpaqueAddress *addr, DataObject *&dat)
 Convert the persistent object to transient.
virtual StatusCode createRep (DataObject *pObject, IOpaqueAddress *&refpAddress)
 Convert the transient object to the requested representation.
virtual StatusCode fillRepRefs (IOpaqueAddress *pAddress, DataObject *pObject)
 Resolve the references of the converted object.
virtual StatusCode fillObjRefs (IOpaqueAddress *pAddress, DataObject *pObject)
 Resolve the references of the converted object.
TObject * getReadObject () const
 get the object to be read
 RootEventBaseCnv (const CLID &clid, ISvcLocator *svc)
virtual ~RootEventBaseCnv ()
virtual long repSvcType () const
virtual StatusCode initialize ()
virtual StatusCode finalize ()
void declareObject (const std::string &fullPath, const CLID &clid, const std::string &treename, const std::string &branchname)
 Store TDS path to link a particular converter to an object on the TDS.
virtual StatusCode createObj (IOpaqueAddress *addr, DataObject *&dat)
 Convert the persistent object to transient.
virtual StatusCode createRep (DataObject *pObject, IOpaqueAddress *&refpAddress)
 Convert the transient object to the requested representation.
virtual StatusCode fillRepRefs (IOpaqueAddress *pAddress, DataObject *pObject)
 Resolve the references of the converted object.
virtual StatusCode fillObjRefs (IOpaqueAddress *pAddress, DataObject *pObject)
 Resolve the references of the converted object.
TObject * getReadObject () const
 get the object to be read
Public Member Functions inherited from Converter< Ty1, Ty2 >
destinationoperator (const source &) const
destinationoperator (const source &) const
destinationoperator (const source &) const

Static Public Member Functions

static const CLID & classID ()
static const CLID & classID ()
static const CLID & classID ()
Static Public Member Functions inherited from RootEventBaseCnv
static const unsigned char storageType ()
 Storage type and class ID.
static const unsigned char storageType ()
 Storage type and class ID.
static const unsigned char storageType ()
 Storage type and class ID.

Friends

class CnvFactory< RecMdcKalHelixSegCnv >

Additional Inherited Members

Public Types inherited from Converter< Ty1, Ty2 >
typedef Ty1 source
typedef Ty2 destination
typedef Ty1 source
typedef Ty2 destination
typedef Ty1 source
typedef Ty2 destination
Protected Member Functions inherited from Converter< Ty1, Ty2 >
virtual destinationconvert (const source &) const =0
virtual destinationconvert (const source &) const =0
virtual destinationconvert (const source &) const =0
Protected Attributes inherited from RootEventBaseCnv
IRootCnvSvcm_cnvSvc
std::vector< RootCnvSvc::Leafm_leaves
RootInterfacem_rootInterface
 pointer to the RootInterface
IDataProviderSvc * m_eds
 pointer to eventdataservice
int m_branchNr
 the branchNr of this converter for writing
int m_branchNrDst
int m_branchNrMc
int m_branchNrRecon
int m_branchNrEvtRec
int m_branchNrEvtHeader
int m_branchNrEvtNavigator
TObject * m_objRead
 the object that was read
CLID CLID_top
 the CLID of the upper converter if any
TArrayS * m_branchNumbers
 array with number of branches for reading
std::string m_rootBranchname
 root branchname (may be concatenated of severals)
std::string m_rootTreename
 each converter knows it's treename
std::string m_currentFileName
std::vector< void * > m_adresses
 each converter knows the corresponding adresses
RootEvtSelectorm_evtsel

Detailed Description

Constructor & Destructor Documentation

◆ ~RecMdcKalHelixSegCnv() [1/3]

virtual RecMdcKalHelixSegCnv::~RecMdcKalHelixSegCnv ( )
inlinevirtual

◆ RecMdcKalHelixSegCnv() [1/3]

RecMdcKalHelixSegCnv::RecMdcKalHelixSegCnv ( ISvcLocator * svc)

Definition at line 27 of file RecMdcKalHelixSegCnv.cxx.

28 : RootEventBaseCnv( classID(), svc ) {
29
30 // Here we associate this converter with the /Event path on the TDS.
31 MsgStream log( msgSvc(), "RecMdcKalHelixSegCnv" );
32 // log << MSG::DEBUG << "Constructor called for " << objType() << endmsg;
33 // m_rootTreename ="Rec";
34 m_rootBranchname = "m_recMdcKalHelixSegCol";
35 // declareObject(EventModel::Recon::RecMdcKalHelixSegCol, objType(), m_rootTreename,
36 // m_rootBranchname);
37 m_adresses.push_back( &m_recMdcKalHelixSegCol );
38 m_recMdcKalHelixSegCol = 0;
39}
IMessageSvc * msgSvc()
std::vector< void * > m_adresses
each converter knows the corresponding adresses
std::string m_rootBranchname
root branchname (may be concatenated of severals)
RootEventBaseCnv(const CLID &clid, ISvcLocator *svc)

◆ ~RecMdcKalHelixSegCnv() [2/3]

virtual RecMdcKalHelixSegCnv::~RecMdcKalHelixSegCnv ( )
inlinevirtual

◆ RecMdcKalHelixSegCnv() [2/3]

RecMdcKalHelixSegCnv::RecMdcKalHelixSegCnv ( ISvcLocator * svc)

◆ ~RecMdcKalHelixSegCnv() [3/3]

virtual RecMdcKalHelixSegCnv::~RecMdcKalHelixSegCnv ( )
inlinevirtual

◆ RecMdcKalHelixSegCnv() [3/3]

RecMdcKalHelixSegCnv::RecMdcKalHelixSegCnv ( ISvcLocator * svc)

Member Function Documentation

◆ classID() [1/3]

const CLID & RecMdcKalHelixSegCnv::classID ( )
inlinestatic

◆ classID() [2/3]

const CLID & RecMdcKalHelixSegCnv::classID ( )
inlinestatic

◆ classID() [3/3]

const CLID & RecMdcKalHelixSegCnv::classID ( )
inlinestatic

◆ DataObjectToTObject() [1/3]

StatusCode RecMdcKalHelixSegCnv::DataObjectToTObject ( DataObject * obj,
RootAddress * addr )
virtual

transformation to root

Implements RootEventBaseCnv.

Definition at line 131 of file RecMdcKalHelixSegCnv.cxx.

132 {
133
134 MsgStream log( msgSvc(), "RecMdcKalHelixSegCnv" );
135 log << MSG::DEBUG << "RecMdcKalHelixSegCnv::DataObjectToTObject" << endmsg;
136
137 RecMdcKalHelixSegCol* mdcHitColTds = dynamic_cast<RecMdcKalHelixSegCol*>( obj );
138 if ( !mdcHitColTds )
139 {
140 log << MSG::ERROR << "Could not downcast to RecMdcKalHelixSegCol" << endmsg;
141 return StatusCode::FAILURE;
142 }
143
144 DataObject* evt;
145 m_eds->findObject( EventModel::Recon::Event, evt );
146 if ( evt == NULL )
147 {
148 log << MSG::ERROR << "Could not get ReconEvent in TDS " << endmsg;
149 return StatusCode::FAILURE;
150 }
151
152 ReconEvent* devtTds = dynamic_cast<ReconEvent*>( evt );
153 if ( !devtTds )
154 {
155 log << MSG::ERROR << "RecMdcKalHelixSegCnv:Could not downcast to TDS ReconEvent" << endmsg;
156 }
157
158 IOpaqueAddress* addr;
159
160 m_cnvSvc->getRecTrackCnv()->createRep( evt, addr );
161 TRecTrackEvent* recEvt = m_cnvSvc->getRecTrackCnv()->getWriteObject();
162
163 const TObjArray* m_recMdcKalHelixSegCol = recEvt->getRecMdcKalHelixSegCol();
164 if ( !m_recMdcKalHelixSegCol ) return StatusCode::SUCCESS;
165 recEvt->clearRecMdcKalHelixSegCol(); // necessary in case there is I/O at the same time since
166 // array is static
167
168 RecMdcKalHelixSegCol::const_iterator recMdcKalHelixSeg;
169 int nSeg = 0;
170 for ( recMdcKalHelixSeg = mdcHitColTds->begin(); recMdcKalHelixSeg != mdcHitColTds->end();
171 recMdcKalHelixSeg++ )
172 {
173 Int_t trackId = ( *recMdcKalHelixSeg )->getTrackId();
174 Int_t flagLR = ( *recMdcKalHelixSeg )->getFlagLR();
175 UInt_t mdcId = ( *recMdcKalHelixSeg )->getMdcId().get_value();
176 Double_t tdc = ( *recMdcKalHelixSeg )->getTdc();
177 Double_t adc = ( *recMdcKalHelixSeg )->getAdc();
178 Double_t zhit = ( *recMdcKalHelixSeg )->getZhit();
179 Double_t tof = ( *recMdcKalHelixSeg )->getTof();
180 Double_t docaIncl = ( *recMdcKalHelixSeg )->getDocaIncl();
181 Double_t docaExcl = ( *recMdcKalHelixSeg )->getDocaExcl();
182 Double_t driftDist = ( *recMdcKalHelixSeg )->getDD();
183 Double_t entra = ( *recMdcKalHelixSeg )->getEntra();
184 Double_t driftT = ( *recMdcKalHelixSeg )->getDT();
185 // Int_t layerId = (*recMdcKalHelixSeg)->getLayerId();
186 // Double_t drIncl = (*recMdcKalHelixSeg)->getDrIncl();
187 // Double_t phi0Incl =(*recMdcKalHelixSeg)->getFi0Incl();
188 // Double_t kappaIncl = (*recMdcKalHelixSeg)->getCpaIncl();
189 // Double_t dzIncl = (*recMdcKalHelixSeg)->getDzIncl();
190 // Double_t tanlIncl = (*recMdcKalHelixSeg)->getTanlIncl();
191 // Double_t drExcl = (*recMdcKalHelixSeg)->getDrExcl();
192 // Double_t phi0Excl = (*recMdcKalHelixSeg)->getFi0Excl();
193 // Double_t kappaExcl = (*recMdcKalHelixSeg)->getCpaExcl();
194 // Double_t dzExcl = (*recMdcKalHelixSeg)->getDzExcl();
195 // Double_t tanlExcl = (*recMdcKalHelixSeg)->getTanlExcl();
196 HepVector helixIncl_vct = ( *recMdcKalHelixSeg )->getHelixIncl();
197 HepVector helixExcl_vct = ( *recMdcKalHelixSeg )->getHelixExcl();
198 // HepSymMatrix errIncl_mtx = (*recMdcKalHelixSeg)->getErrorIncl();
199 // HepSymMatrix errExcl_mtx = (*recMdcKalHelixSeg)->getErrorExcl();
200
201 Double_t helixIncl[5], helixExcl[5]; // errIncl[5][5], errExcl[5][5];
202 for ( Int_t i = 0; i < 5; i++ )
203 {
204 helixIncl[i] = helixIncl_vct[i];
205 helixExcl[i] = helixExcl_vct[i];
206 }
207 // for (Int_t i=0; i<5; i++){
208 // for(Int_t j=0; j<5; j++){
209 // errIncl[i][j] = errIncl_mtx[i][j];
210 // errExcl[i][j] = errExcl_mtx[i][j];
211 // }
212 // }
213
214 TRecMdcKalHelixSeg* recMdcKalHelixSegRoot = new TRecMdcKalHelixSeg();
215 // m_common.m_recMdcKalHelixSegMap[(*recMdcKalHelixSeg)] = recMdcKalHelixSegRoot;
216
217 recMdcKalHelixSegRoot->setTrackId( trackId );
218 recMdcKalHelixSegRoot->setFlagLR( flagLR );
219 recMdcKalHelixSegRoot->setMdcId( Identifier( mdcId ) );
220 recMdcKalHelixSegRoot->setTdc( tdc );
221 recMdcKalHelixSegRoot->setAdc( adc );
222 recMdcKalHelixSegRoot->setZhit( zhit );
223 recMdcKalHelixSegRoot->setTof( tof );
224 recMdcKalHelixSegRoot->setDocaIncl( docaIncl );
225 recMdcKalHelixSegRoot->setDocaExcl( docaExcl );
226 recMdcKalHelixSegRoot->setDD( driftDist );
227 recMdcKalHelixSegRoot->setEntra( entra );
228 recMdcKalHelixSegRoot->setDT( driftT );
229 // recMdcKalHelixSegRoot->setLayerId( layerId );
230 // recMdcKalHelixSegRoot->setDrIncl( drIncl );
231 // recMdcKalHelixSegRoot->setFi0Incl( phi0Incl );
232 // recMdcKalHelixSegRoot->setCpaIncl( kappaIncl );
233 // recMdcKalHelixSegRoot->setDzIncl( dzIncl );
234 // recMdcKalHelixSegRoot->setTanlIncl( tanlIncl );
235 // recMdcKalHelixSegRoot->setDrExcl( drIncl );
236 // recMdcKalHelixSegRoot->setFi0Excl( phi0Excl );
237 // recMdcKalHelixSegRoot->setCpaExcl( kappaExcl );
238 // recMdcKalHelixSegRoot->setDzExcl( dzExcl );
239 // recMdcKalHelixSegRoot->setTanlExcl( tanlExcl );
240 recMdcKalHelixSegRoot->setHelixIncl( helixIncl );
241 recMdcKalHelixSegRoot->setHelixExcl( helixExcl );
242 // recMdcKalHelixSegRoot->setErrorIncl( errIncl );
243 // recMdcKalHelixSegRoot->setErrorExcl( errExcl );
244
245 log << MSG::INFO << " recMdcKalHelixSegRoot.dd: " << recMdcKalHelixSegRoot->getDD()
246 << " recMdcKalHelixSegRoot.entra: " << recMdcKalHelixSegRoot->getEntra() << endmsg;
247
248 recEvt->addRecMdcKalHelixSeg( recMdcKalHelixSegRoot );
249 nSeg++;
250 }
251 // cout<<"writing nSeg = "<<nSeg<<endl;
252 return StatusCode::SUCCESS;
253}
ObjectVector< RecMdcKalHelixSeg > RecMdcKalHelixSegCol
IDataProviderSvc * m_eds
pointer to eventdataservice
void addRecMdcKalHelixSeg(TRecMdcKalHelixSeg *Track)

◆ DataObjectToTObject() [2/3]

virtual StatusCode RecMdcKalHelixSegCnv::DataObjectToTObject ( DataObject * obj,
RootAddress * addr )
virtual

transformation to root

Implements RootEventBaseCnv.

◆ DataObjectToTObject() [3/3]

virtual StatusCode RecMdcKalHelixSegCnv::DataObjectToTObject ( DataObject * obj,
RootAddress * addr )
virtual

transformation to root

Implements RootEventBaseCnv.

◆ TObjectToDataObject() [1/3]

StatusCode RecMdcKalHelixSegCnv::TObjectToDataObject ( DataObject *& obj)
virtual

transformation from root

Implements RootEventBaseCnv.

Definition at line 41 of file RecMdcKalHelixSegCnv.cxx.

41 {
42 // creation of TDS object from root object
43 MsgStream log( msgSvc(), "RecMdcKalHelixSegCnv" );
44 log << MSG::DEBUG << "RecMdcKalHelixSegCnv::TObjectToDataObject" << endmsg;
45
46 // create the TDS location for the RecMdcKalHelixSeg Collection
47 RecMdcKalHelixSegCol* recMdcKalHelixSegCol = new RecMdcKalHelixSegCol;
48 refpObject = recMdcKalHelixSegCol;
49
50 // now convert
51 if ( !m_recMdcKalHelixSegCol ) return StatusCode::SUCCESS;
52 TIter mdcHitIter( m_recMdcKalHelixSegCol );
53 TRecMdcKalHelixSeg* recMdcKalHelixSegRoot = 0;
54 int nSeg = 0;
55 while ( ( recMdcKalHelixSegRoot = (TRecMdcKalHelixSeg*)mdcHitIter.Next() ) )
56 {
57 int trackId = recMdcKalHelixSegRoot->getTrackId();
58 int flagLR = recMdcKalHelixSegRoot->getFlagLR();
59 Identifier mdcId( recMdcKalHelixSegRoot->getMdcId() );
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();
69 // int layerId = recMdcKalHelixSegRoot->getLayerId();
70 // double drIncl = recMdcKalHelixSegRoot->getDrIncl();
71 // double phi0Incl = recMdcKalHelixSegRoot->getFi0Incl();
72 // double kappaIncl = recMdcKalHelixSegRoot->getCpaIncl();
73 // double dzIncl = recMdcKalHelixSegRoot->getDzIncl();
74 // double tanlIncl = recMdcKalHelixSegRoot->getTanlIncl();
75 // double drExcl = recMdcKalHelixSegRoot->getDrExcl();
76 // double phi0Excl = recMdcKalHelixSegRoot->getFi0Excl();
77 // double kappaExcl = recMdcKalHelixSegRoot->getCpaExcl();
78 // double dzExcl = recMdcKalHelixSegRoot->getDzExcl();
79 // double tanlExcl = recMdcKalHelixSegRoot->getTanlExcl();
80 double helixIncl[5]; // errIncl[15];
81 double helixExcl[5]; // errExcl[15];
82 for ( int i = 0, k = 0; i < 5; i++ )
83 {
84 helixIncl[i] = recMdcKalHelixSegRoot->getHelixIncl( i );
85 helixExcl[i] = recMdcKalHelixSegRoot->getHelixExcl( i );
86 // for(int j=0; j<=i; j++){
87 // errIncl[k] = recMdcKalHelixSegRoot->getErrorIncl(i,j);
88 // errExcl[k] = recMdcKalHelixSegRoot->getErrorExcl(i,j);
89 // }
90 }
91
92 RecMdcKalHelixSeg* recMdcKalHelixSeg = new RecMdcKalHelixSeg();
93 m_common.m_rootRecMdcKalHelixSegMap[recMdcKalHelixSegRoot] = recMdcKalHelixSeg;
94
95 recMdcKalHelixSeg->setTrackId( trackId );
96 recMdcKalHelixSeg->setFlagLR( flagLR );
97 recMdcKalHelixSeg->setMdcId( Identifier( mdcId ) );
98 recMdcKalHelixSeg->setTdc( tdc );
99 recMdcKalHelixSeg->setAdc( adc );
100 recMdcKalHelixSeg->setZhit( zhit );
101 recMdcKalHelixSeg->setTof( tof );
102 recMdcKalHelixSeg->setDocaIncl( docaIncl );
103 recMdcKalHelixSeg->setDocaExcl( docaExcl );
104 recMdcKalHelixSeg->setDD( driftDist );
105 recMdcKalHelixSeg->setEntra( entra );
106 recMdcKalHelixSeg->setDT( driftT );
107 // recMdcKalHelixSeg->setLayerId( layerId );
108 // recMdcKalHelixSeg->setDrIncl( drIncl );
109 // recMdcKalHelixSeg->setFi0Incl( phi0Incl );
110 // recMdcKalHelixSeg->setCpaIncl( kappaIncl );
111 // recMdcKalHelixSeg->setDzIncl( dzIncl );
112 // recMdcKalHelixSeg->setTanlIncl( tanlIncl );
113 // recMdcKalHelixSeg->setDrExcl( drIncl );
114 // recMdcKalHelixSeg->setFi0Excl( phi0Excl );
115 // recMdcKalHelixSeg->setCpaExcl( kappaExcl );
116 // recMdcKalHelixSeg->setDzExcl( dzExcl );
117 // recMdcKalHelixSeg->setTanlExcl( tanlExcl );
118 recMdcKalHelixSeg->setHelixIncl( helixIncl );
119 recMdcKalHelixSeg->setHelixExcl( helixExcl );
120 // recMdcKalHelixSeg->setErrorIncl( errIncl );
121 // recMdcKalHelixSeg->setErrorExcl( errExcl );
122
123 recMdcKalHelixSegCol->push_back( recMdcKalHelixSeg );
124 nSeg++;
125 }
126 // cout<<"rec -> Tds, nSeg = "<<nSeg<<",
127 // recMdcKalHelixSegCol.size="<<recMdcKalHelixSegCol->size()<<endl;
128 return StatusCode::SUCCESS;
129}

◆ TObjectToDataObject() [2/3]

virtual StatusCode RecMdcKalHelixSegCnv::TObjectToDataObject ( DataObject *& obj)
virtual

transformation from root

Implements RootEventBaseCnv.

◆ TObjectToDataObject() [3/3]

virtual StatusCode RecMdcKalHelixSegCnv::TObjectToDataObject ( DataObject *& obj)
virtual

transformation from root

Implements RootEventBaseCnv.

◆ CnvFactory< RecMdcKalHelixSegCnv >


The documentation for this class was generated from the following files: