CGEM BOSS 6.6.5.f
BESIII Offline Software System
Loading...
Searching...
No Matches
RecCgemKalHelixSegCnv Class Reference

#include <RecCgemKalHelixSegCnv.h>

+ Inheritance diagram for RecCgemKalHelixSegCnv:

Public Member Functions

virtual ~RecCgemKalHelixSegCnv ()
 
virtual ~RecCgemKalHelixSegCnv ()
 
virtual ~RecCgemKalHelixSegCnv ()
 
- 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.
 
virtual StatusCode DataObjectToTObject (DataObject *dat, RootAddress *addr)=0
 Do the concrete conversion from TDS to ROOT.
 
virtual StatusCode TObjectToDataObject (DataObject *&dat)=0
 Do the concrete conversion from ROOT to TDS.
 
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.
 
virtual StatusCode DataObjectToTObject (DataObject *dat, RootAddress *addr)=0
 Do the concrete conversion from TDS to ROOT.
 
virtual StatusCode TObjectToDataObject (DataObject *&dat)=0
 Do the concrete conversion from ROOT to TDS.
 
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.
 
virtual StatusCode DataObjectToTObject (DataObject *dat, RootAddress *addr)=0
 Do the concrete conversion from TDS to ROOT.
 
virtual StatusCode TObjectToDataObject (DataObject *&dat)=0
 Do the concrete conversion from ROOT to TDS.
 
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
 

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.
 

Protected Member Functions

 RecCgemKalHelixSegCnv (ISvcLocator *svc)
 
virtual StatusCode DataObjectToTObject (DataObject *obj, RootAddress *addr)
 transformation to root
 
virtual StatusCode TObjectToDataObject (DataObject *&obj)
 transformation from root
 
 RecCgemKalHelixSegCnv (ISvcLocator *svc)
 
virtual StatusCode DataObjectToTObject (DataObject *obj, RootAddress *addr)
 transformation to root
 
virtual StatusCode TObjectToDataObject (DataObject *&obj)
 transformation from root
 
 RecCgemKalHelixSegCnv (ISvcLocator *svc)
 
virtual StatusCode DataObjectToTObject (DataObject *obj, RootAddress *addr)
 transformation to root
 
virtual StatusCode TObjectToDataObject (DataObject *&obj)
 transformation from root
 
- Protected Member Functions inherited from Converter< Ty1, Ty2 >
virtual destinationconvert (const source &) const =0
 
virtual destinationconvert (const source &) const =0
 

Friends

class CnvFactory< RecCgemKalHelixSegCnv >
 

Additional Inherited Members

- Public Types inherited from Converter< Ty1, Ty2 >
typedef Ty1 source
 
typedef Ty2 destination
 
typedef Ty1 source
 
typedef Ty2 destination
 
- Protected Attributes inherited from RootEventBaseCnv
RootCnvSvcm_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

◆ ~RecCgemKalHelixSegCnv() [1/3]

virtual RecCgemKalHelixSegCnv::~RecCgemKalHelixSegCnv ( )
inlinevirtual

◆ RecCgemKalHelixSegCnv() [1/3]

RecCgemKalHelixSegCnv::RecCgemKalHelixSegCnv ( ISvcLocator *  svc)
protected

Definition at line 28 of file bak_RootCnvSvc-04-01-14/src/Rec/RecCgemKalHelixSegCnv.cxx.

30{
31
32 // Here we associate this converter with the /Event path on the TDS.
33 MsgStream log(msgSvc(), "RecCgemKalHelixSegCnv");
34 //log << MSG::DEBUG << "Constructor called for " << objType() << endreq;
35 //m_rootTreename ="Rec";
36 m_rootBranchname ="m_recCgemKalHelixSegCol";
37 //declareObject(EventModel::Recon::RecCgemKalHelixSegCol, objType(), m_rootTreename, m_rootBranchname);
38 m_adresses.push_back(&m_recCgemKalHelixSegCol);
39 m_recCgemKalHelixSegCol=0;
40}
std::vector< void * > m_adresses
each converter knows the corresponding adresses
std::string m_rootBranchname
root branchname (may be concatenated of severals)

◆ ~RecCgemKalHelixSegCnv() [2/3]

virtual RecCgemKalHelixSegCnv::~RecCgemKalHelixSegCnv ( )
inlinevirtual

◆ RecCgemKalHelixSegCnv() [2/3]

RecCgemKalHelixSegCnv::RecCgemKalHelixSegCnv ( ISvcLocator *  svc)
protected

◆ ~RecCgemKalHelixSegCnv() [3/3]

virtual RecCgemKalHelixSegCnv::~RecCgemKalHelixSegCnv ( )
inlinevirtual

◆ RecCgemKalHelixSegCnv() [3/3]

RecCgemKalHelixSegCnv::RecCgemKalHelixSegCnv ( ISvcLocator *  svc)
protected

Member Function Documentation

◆ classID() [1/3]

static const CLID & RecCgemKalHelixSegCnv::classID ( )
inlinestatic

Definition at line 20 of file Event/RootCnvSvc/bak_RootCnvSvc-04-01-14/RootCnvSvc/Rec/RecCgemKalHelixSegCnv.h.

21 {
23 }
const CLID & CLID_RecCgemKalHelixSegCol
Definition: EventModel.cxx:421

◆ classID() [2/3]

static const CLID & RecCgemKalHelixSegCnv::classID ( )
inlinestatic

◆ classID() [3/3]

static const CLID & RecCgemKalHelixSegCnv::classID ( )
inlinestatic

◆ DataObjectToTObject() [1/3]

StatusCode RecCgemKalHelixSegCnv::DataObjectToTObject ( DataObject *  obj,
RootAddress addr 
)
protectedvirtual

transformation to root

Implements RootEventBaseCnv.

Definition at line 123 of file bak_RootCnvSvc-04-01-14/src/Rec/RecCgemKalHelixSegCnv.cxx.

123 {
124
125 MsgStream log(msgSvc(), "RecCgemKalHelixSegCnv");
126 log << MSG::DEBUG << "RecCgemKalHelixSegCnv::DataObjectToTObject" << endreq;
127
128 RecCgemKalHelixSegCol * cgemHitColTds=dynamic_cast<RecCgemKalHelixSegCol *> (obj);
129 if (!cgemHitColTds) {
130 log << MSG::ERROR << "Could not downcast to RecCgemKalHelixSegCol" << endreq;
131 return StatusCode::FAILURE;
132 }
133
134 DataObject *evt;
135 m_eds->findObject(EventModel::Recon::Event,evt);
136 if (evt==NULL) {
137 log << MSG::ERROR << "Could not get ReconEvent in TDS " << endreq;
138 return StatusCode::FAILURE;
139 }
140
141 ReconEvent * devtTds=dynamic_cast<ReconEvent *> (evt);
142 if (!devtTds) {
143 log << MSG::ERROR << "RecCgemKalHelixSegCnv:Could not downcast to TDS ReconEvent" << endreq;
144 }
145
146 IOpaqueAddress *addr;
147
148 m_cnvSvc->getRecTrackCnv()->createRep(evt,addr);
150
151 const TObjArray *m_recCgemKalHelixSegCol = recEvt->getRecCgemKalHelixSegCol();
152 if (!m_recCgemKalHelixSegCol) return StatusCode::SUCCESS;
153 recEvt->clearRecCgemKalHelixSegCol(); //necessary in case there is I/O at the same time since array is static
154
155 RecCgemKalHelixSegCol::const_iterator recCgemKalHelixSeg;
156 for (recCgemKalHelixSeg = cgemHitColTds->begin(); recCgemKalHelixSeg != cgemHitColTds->end(); recCgemKalHelixSeg++) {
157 Int_t trackId =(*recCgemKalHelixSeg)->getTrackId();
158// UInt_t cgemIdMSB = (*recCgemKalHelixSeg)->getCgemId().get_valueMSB();
159// UInt_t cgemIdLSB = (*recCgemKalHelixSeg)->getCgemId().get_valueLSB();
160 UInt_t cgemId = (*recCgemKalHelixSeg)->getCgemId().get_value();
161 Double_t tdc = (*recCgemKalHelixSeg)->getTdc();
162 Double_t adc = (*recCgemKalHelixSeg)->getAdc();
163 Double_t zhit = (*recCgemKalHelixSeg)->getZhit();
164 Double_t tof = (*recCgemKalHelixSeg)->getTof();
165 Double_t docaIncl = (*recCgemKalHelixSeg)->getDocaIncl();
166 Double_t docaExcl = (*recCgemKalHelixSeg)->getDocaExcl();
167 Double_t entra = (*recCgemKalHelixSeg)->getEntra();
168// Int_t layerId = (*recCgemKalHelixSeg)->getLayerId();
169// Double_t drIncl = (*recCgemKalHelixSeg)->getDrIncl();
170// Double_t phi0Incl =(*recCgemKalHelixSeg)->getFi0Incl();
171// Double_t kappaIncl = (*recCgemKalHelixSeg)->getCpaIncl();
172// Double_t dzIncl = (*recCgemKalHelixSeg)->getDzIncl();
173// Double_t tanlIncl = (*recCgemKalHelixSeg)->getTanlIncl();
174// Double_t drExcl = (*recCgemKalHelixSeg)->getDrExcl();
175// Double_t phi0Excl = (*recCgemKalHelixSeg)->getFi0Excl();
176// Double_t kappaExcl = (*recCgemKalHelixSeg)->getCpaExcl();
177// Double_t dzExcl = (*recCgemKalHelixSeg)->getDzExcl();
178// Double_t tanlExcl = (*recCgemKalHelixSeg)->getTanlExcl();
179 HepVector helixIncl_vct = (*recCgemKalHelixSeg)->getHelixIncl();
180 HepVector helixExcl_vct = (*recCgemKalHelixSeg)->getHelixExcl();
181// HepSymMatrix errIncl_mtx = (*recCgemKalHelixSeg)->getErrorIncl();
182// HepSymMatrix errExcl_mtx = (*recCgemKalHelixSeg)->getErrorExcl();
183
184 Double_t helixIncl[5], helixExcl[5]; //errIncl[5][5], errExcl[5][5];
185 for(Int_t i=0; i<5; i++){
186 helixIncl[i] = helixIncl_vct[i];
187 helixExcl[i] = helixExcl_vct[i];
188 }
189// for (Int_t i=0; i<5; i++){
190// for(Int_t j=0; j<5; j++){
191// errIncl[i][j] = errIncl_mtx[i][j];
192// errExcl[i][j] = errExcl_mtx[i][j];
193// }
194// }
195
196 TRecCgemKalHelixSeg *recCgemKalHelixSegRoot = new TRecCgemKalHelixSeg();
197 //m_common.m_recCgemKalHelixSegMap[(*recCgemKalHelixSeg)] = recCgemKalHelixSegRoot;
198
199 recCgemKalHelixSegRoot->setTrackId( trackId );
200// recCgemKalHelixSegRoot->setCgemIdMSB( cgemIdMSB );
201// recCgemKalHelixSegRoot->setCgemIdLSB( cgemIdLSB );
202 recCgemKalHelixSegRoot->setCgemId( cgemId );
203 recCgemKalHelixSegRoot->setTdc( tdc );
204 recCgemKalHelixSegRoot->setAdc( adc );
205 recCgemKalHelixSegRoot->setZhit( zhit );
206 recCgemKalHelixSegRoot->setTof( tof );
207 recCgemKalHelixSegRoot->setDocaIncl( docaIncl );
208 recCgemKalHelixSegRoot->setDocaExcl( docaExcl );
209 recCgemKalHelixSegRoot->setEntra( entra );
210// recCgemKalHelixSegRoot->setLayerId( layerId );
211// recCgemKalHelixSegRoot->setDrIncl( drIncl );
212// recCgemKalHelixSegRoot->setFi0Incl( phi0Incl );
213// recCgemKalHelixSegRoot->setCpaIncl( kappaIncl );
214// recCgemKalHelixSegRoot->setDzIncl( dzIncl );
215// recCgemKalHelixSegRoot->setTanlIncl( tanlIncl );
216// recCgemKalHelixSegRoot->setDrExcl( drIncl );
217// recCgemKalHelixSegRoot->setFi0Excl( phi0Excl );
218// recCgemKalHelixSegRoot->setCpaExcl( kappaExcl );
219// recCgemKalHelixSegRoot->setDzExcl( dzExcl );
220// recCgemKalHelixSegRoot->setTanlExcl( tanlExcl );
221 recCgemKalHelixSegRoot->setHelixIncl( helixIncl );
222 recCgemKalHelixSegRoot->setHelixExcl( helixExcl );
223// recCgemKalHelixSegRoot->setErrorIncl( errIncl );
224// recCgemKalHelixSegRoot->setErrorExcl( errExcl );
225
226 recEvt->addRecCgemKalHelixSeg(recCgemKalHelixSegRoot);
227 }
228 return StatusCode::SUCCESS;
229}
ObjectVector< RecCgemKalHelixSeg > RecCgemKalHelixSegCol
static TRecTrackEvent * getWriteObject()
returns object to be written (maintained here for all DIGI-converters)
virtual StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress)
Convert the transient object to the requested representation.
void addRecCgemKalHelixSeg(TRecCgemKalHelixSeg *Track)

◆ DataObjectToTObject() [2/3]

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

transformation to root

Implements RootEventBaseCnv.

◆ DataObjectToTObject() [3/3]

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

transformation to root

Implements RootEventBaseCnv.

◆ TObjectToDataObject() [1/3]

StatusCode RecCgemKalHelixSegCnv::TObjectToDataObject ( DataObject *&  obj)
protectedvirtual

transformation from root

Implements RootEventBaseCnv.

Definition at line 42 of file bak_RootCnvSvc-04-01-14/src/Rec/RecCgemKalHelixSegCnv.cxx.

42 {
43 // creation of TDS object from root object
44 MsgStream log(msgSvc(), "RecCgemKalHelixSegCnv");
45 log << MSG::DEBUG << "RecCgemKalHelixSegCnv::TObjectToDataObject" << endreq;
46
47 // create the TDS location for the RecCgemKalHelixSeg Collection
48 RecCgemKalHelixSegCol* recCgemKalHelixSegCol = new RecCgemKalHelixSegCol;
49 refpObject = recCgemKalHelixSegCol;
50
51 // now convert
52 if (!m_recCgemKalHelixSegCol) return StatusCode::SUCCESS;
53 TIter cgemHitIter(m_recCgemKalHelixSegCol);
54 TRecCgemKalHelixSeg *recCgemKalHelixSegRoot = 0;
55 while ((recCgemKalHelixSegRoot = (TRecCgemKalHelixSeg*)cgemHitIter.Next())) {
56 int trackId = recCgemKalHelixSegRoot->getTrackId();
57// unsigned int cgemIdMSB = recCgemKalHelixSegRoot->getCgemIdMSB();
58// unsigned int cgemIdLSB = recCgemKalHelixSegRoot->getCgemIdLSB();
59// Identifier64 cgemId(cgemIdMSB,cgemIdLSB);
60 Identifier cgemId(recCgemKalHelixSegRoot->getCgemId());
61 double tdc = recCgemKalHelixSegRoot->getTdc();
62 double adc = recCgemKalHelixSegRoot->getAdc();
63 double zhit = recCgemKalHelixSegRoot->getZhit();
64 double tof = recCgemKalHelixSegRoot->getTof();
65 double docaIncl = recCgemKalHelixSegRoot->getDocaIncl();
66 double docaExcl = recCgemKalHelixSegRoot->getDocaExcl();
67 double entra = recCgemKalHelixSegRoot->getEntra();
68 // int layerId = recCgemKalHelixSegRoot->getLayerId();
69 // double drIncl = recCgemKalHelixSegRoot->getDrIncl();
70 // double phi0Incl = recCgemKalHelixSegRoot->getFi0Incl();
71 // double kappaIncl = recCgemKalHelixSegRoot->getCpaIncl();
72 // double dzIncl = recCgemKalHelixSegRoot->getDzIncl();
73 // double tanlIncl = recCgemKalHelixSegRoot->getTanlIncl();
74 // double drExcl = recCgemKalHelixSegRoot->getDrExcl();
75 // double phi0Excl = recCgemKalHelixSegRoot->getFi0Excl();
76 // double kappaExcl = recCgemKalHelixSegRoot->getCpaExcl();
77 // double dzExcl = recCgemKalHelixSegRoot->getDzExcl();
78 // double tanlExcl = recCgemKalHelixSegRoot->getTanlExcl();
79 double helixIncl[5]; // errIncl[15];
80 double helixExcl[5]; // errExcl[15];
81 for(int i=0, k=0; i<5; i++){
82 helixIncl[i] = recCgemKalHelixSegRoot->getHelixIncl(i);
83 helixExcl[i] = recCgemKalHelixSegRoot->getHelixExcl(i);
84 // for(int j=0; j<=i; j++){
85 // errIncl[k] = recCgemKalHelixSegRoot->getErrorIncl(i,j);
86 // errExcl[k] = recCgemKalHelixSegRoot->getErrorExcl(i,j);
87 // }
88 }
89
90 RecCgemKalHelixSeg *recCgemKalHelixSeg= new RecCgemKalHelixSeg();
91 m_common.m_rootRecCgemKalHelixSegMap[recCgemKalHelixSegRoot] = recCgemKalHelixSeg;
92
93 recCgemKalHelixSeg->setTrackId( trackId );
94 recCgemKalHelixSeg->setCgemId( Identifier(cgemId) );
95 recCgemKalHelixSeg->setTdc( tdc );
96 recCgemKalHelixSeg->setAdc( adc );
97 recCgemKalHelixSeg->setZhit( zhit );
98 recCgemKalHelixSeg->setTof( tof );
99 recCgemKalHelixSeg->setDocaIncl( docaIncl );
100 recCgemKalHelixSeg->setDocaExcl( docaExcl );
101 recCgemKalHelixSeg->setEntra( entra );
102// recCgemKalHelixSeg->setLayerId( layerId );
103// recCgemKalHelixSeg->setDrIncl( drIncl );
104// recCgemKalHelixSeg->setFi0Incl( phi0Incl );
105// recCgemKalHelixSeg->setCpaIncl( kappaIncl );
106// recCgemKalHelixSeg->setDzIncl( dzIncl );
107// recCgemKalHelixSeg->setTanlIncl( tanlIncl );
108// recCgemKalHelixSeg->setDrExcl( drIncl );
109// recCgemKalHelixSeg->setFi0Excl( phi0Excl );
110// recCgemKalHelixSeg->setCpaExcl( kappaExcl );
111// recCgemKalHelixSeg->setDzExcl( dzExcl );
112// recCgemKalHelixSeg->setTanlExcl( tanlExcl );
113 recCgemKalHelixSeg->setHelixIncl( helixIncl );
114 recCgemKalHelixSeg->setHelixExcl( helixExcl );
115// recCgemKalHelixSeg->setErrorIncl( errIncl );
116// recCgemKalHelixSeg->setErrorExcl( errExcl );
117
118 recCgemKalHelixSegCol->push_back(recCgemKalHelixSeg);
119 }
120 return StatusCode::SUCCESS;
121}
static std::map< const TObject *, const RecCgemKalHelixSeg * > m_rootRecCgemKalHelixSegMap

◆ TObjectToDataObject() [2/3]

virtual StatusCode RecCgemKalHelixSegCnv::TObjectToDataObject ( DataObject *&  obj)
protectedvirtual

transformation from root

Implements RootEventBaseCnv.

◆ TObjectToDataObject() [3/3]

virtual StatusCode RecCgemKalHelixSegCnv::TObjectToDataObject ( DataObject *&  obj)
protectedvirtual

transformation from root

Implements RootEventBaseCnv.

Friends And Related Function Documentation

◆ CnvFactory< RecCgemKalHelixSegCnv >


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