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

#include <RecCgemSegmentCnv.h>

+ Inheritance diagram for RecCgemSegmentCnv:

Public Member Functions

virtual ~RecCgemSegmentCnv ()
 
virtual ~RecCgemSegmentCnv ()
 
virtual ~RecCgemSegmentCnv ()
 
- 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

 RecCgemSegmentCnv (ISvcLocator *svc)
 
virtual StatusCode DataObjectToTObject (DataObject *obj, RootAddress *addr)
 Do the concrete conversion from TDS to ROOT.
 
virtual StatusCode TObjectToDataObject (DataObject *&obj)
 Do the concrete conversion from ROOT to TDS.
 
 RecCgemSegmentCnv (ISvcLocator *svc)
 
virtual StatusCode DataObjectToTObject (DataObject *obj, RootAddress *addr)
 Do the concrete conversion from TDS to ROOT.
 
virtual StatusCode TObjectToDataObject (DataObject *&obj)
 Do the concrete conversion from ROOT to TDS.
 
 RecCgemSegmentCnv (ISvcLocator *svc)
 
virtual StatusCode DataObjectToTObject (DataObject *obj, RootAddress *addr)
 Do the concrete conversion from TDS to ROOT.
 
virtual StatusCode TObjectToDataObject (DataObject *&obj)
 Do the concrete conversion from ROOT to TDS.
 
- Protected Member Functions inherited from Converter< Ty1, Ty2 >
virtual destinationconvert (const source &) const =0
 
virtual destinationconvert (const source &) const =0
 

Friends

class CnvFactory< RecCgemSegmentCnv >
 

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

◆ ~RecCgemSegmentCnv() [1/3]

virtual RecCgemSegmentCnv::~RecCgemSegmentCnv ( )
inlinevirtual

◆ RecCgemSegmentCnv() [1/3]

RecCgemSegmentCnv::RecCgemSegmentCnv ( ISvcLocator *  svc)
protected

Definition at line 26 of file bak_RootCnvSvc-04-01-14/src/Rec/RecCgemSegmentCnv.cxx.

28{
29
30 MsgStream log(msgSvc(),"RecCgemSegmentCnv");
31 log << MSG::INFO << " RecCgemSegmentCnv ------ " << endreq;
32 m_rootBranchname = "m_recCgemSegmentCol";
33 m_adresses.push_back(&m_recCgemSegmentCol);
34 m_recCgemSegmentCol = 0;
35}
std::vector< void * > m_adresses
each converter knows the corresponding adresses
std::string m_rootBranchname
root branchname (may be concatenated of severals)

◆ ~RecCgemSegmentCnv() [2/3]

virtual RecCgemSegmentCnv::~RecCgemSegmentCnv ( )
inlinevirtual

◆ RecCgemSegmentCnv() [2/3]

RecCgemSegmentCnv::RecCgemSegmentCnv ( ISvcLocator *  svc)
protected

◆ ~RecCgemSegmentCnv() [3/3]

virtual RecCgemSegmentCnv::~RecCgemSegmentCnv ( )
inlinevirtual

◆ RecCgemSegmentCnv() [3/3]

RecCgemSegmentCnv::RecCgemSegmentCnv ( ISvcLocator *  svc)
protected

Member Function Documentation

◆ classID() [1/3]

static const CLID & RecCgemSegmentCnv::classID ( )
inlinestatic

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

22 {
24 }
const CLID & CLID_RecCgemSegmentCol
Definition: EventModel.cxx:402

◆ classID() [2/3]

static const CLID & RecCgemSegmentCnv::classID ( )
inlinestatic

◆ classID() [3/3]

static const CLID & RecCgemSegmentCnv::classID ( )
inlinestatic

◆ DataObjectToTObject() [1/3]

StatusCode RecCgemSegmentCnv::DataObjectToTObject ( DataObject *  dat,
RootAddress addr 
)
protectedvirtual

Do the concrete conversion from TDS to ROOT.

Implements RootEventBaseCnv.

Definition at line 83 of file bak_RootCnvSvc-04-01-14/src/Rec/RecCgemSegmentCnv.cxx.

84{
85 MsgStream log(msgSvc(), "RecCgemSegmentCnv");
86 log << MSG::DEBUG << "RecCgemSegmentCnv::DataObjectToTObject" << endreq;
87
88 RecCgemSegmentCol * cgemSegmentColTds=dynamic_cast<RecCgemSegmentCol *> (obj);
89 if (!cgemSegmentColTds) {
90 log << MSG::ERROR << "Could not downcast to RecCgemSegmentCol" << endreq;
91 return StatusCode::FAILURE;
92 }
93
94 DataObject *evt;
95 m_eds->findObject(EventModel::Recon::Event,evt);
96 if (evt==NULL) {
97 log << MSG::ERROR << "Could not get ReconEvent in TDS " << endreq;
98 return StatusCode::FAILURE;
99 }
100
101 ReconEvent * devtTds=dynamic_cast<ReconEvent *> (evt);
102 if (!devtTds) {
103 log << MSG::ERROR << "RecCgemHitCnv:Could not downcast to TDS ReconEvent" << endreq;
104 }
105
106 IOpaqueAddress *addr;
107
108 m_cnvSvc->getRecTrackCnv()->createRep(evt,addr);
110// m_cnvSvc->getRecSegmentCnv()->createRep(evt,addr);
111// TRecTrackEvent *recEvt=m_cnvSvc->getRecSegmentCnv()->getWriteObject();
112
113 const TObjArray *m_recCgemSegmentCol = recEvt->getRecCgemSegmentCol();
114 if (!m_recCgemSegmentCol) return StatusCode::SUCCESS;
115 recEvt->clearRecCgemSegmentCol();
116
117 RecCgemSegmentCol::const_iterator recCgemSegment;
118 for (recCgemSegment = cgemSegmentColTds->begin(); recCgemSegment != cgemSegmentColTds->end(); recCgemSegment++)
119 {
120 Int_t eventid = (*recCgemSegment)->geteventid();
121 Int_t match = (*recCgemSegment)->getmatch();
122 Int_t segmentid = (*recCgemSegment)->getsegmentid();
123 Int_t clusterid_1 = (*recCgemSegment)->getclusterid_1();
124 Int_t clusterid_2 = (*recCgemSegment)->getclusterid_2();
125 Int_t clusterid_3 = (*recCgemSegment)->getclusterid_3();
126 Double_t helix[5];
127 Double_t helix_err[15];
128 for(int i = 0; i < 5; i++){
129 helix[i] = (*recCgemSegment)->gethelix(i);
130 }
131 for(int i = 0; i < 15; i++){
132 helix_err[i] = (*recCgemSegment)->gethelix_err(i);
133 }
134
135 TRecCgemSegment *recCgemSegmentRoot = new TRecCgemSegment();
136
137 recCgemSegmentRoot->seteventid(eventid);
138 recCgemSegmentRoot->setmatch(match);
139 recCgemSegmentRoot->setsegmentid(segmentid);
140 recCgemSegmentRoot->setclusterid_1(clusterid_1);
141 recCgemSegmentRoot->setclusterid_2(clusterid_2);
142 recCgemSegmentRoot->setclusterid_3(clusterid_3);
143 recCgemSegmentRoot->sethelix( helix );
144 recCgemSegmentRoot->sethelix_err( helix_err );
145
146 recEvt->addRecCgemSegment(recCgemSegmentRoot);
147 }
148 return StatusCode::SUCCESS;
149}
ObjectVector< RecCgemSegment > RecCgemSegmentCol
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 addRecCgemSegment(TRecCgemSegment *Segment)
Add a TkrSegment into the Cgem data collection.
const TObjArray * getRecCgemSegmentCol() const
retrieve the whole TObjArray of RecCgemSegment Data
void clearRecCgemSegmentCol()
clear the whole array (necessary because of the consts-s)

◆ DataObjectToTObject() [2/3]

virtual StatusCode RecCgemSegmentCnv::DataObjectToTObject ( DataObject *  dat,
RootAddress addr 
)
protectedvirtual

Do the concrete conversion from TDS to ROOT.

Implements RootEventBaseCnv.

◆ DataObjectToTObject() [3/3]

virtual StatusCode RecCgemSegmentCnv::DataObjectToTObject ( DataObject *  dat,
RootAddress addr 
)
protectedvirtual

Do the concrete conversion from TDS to ROOT.

Implements RootEventBaseCnv.

◆ TObjectToDataObject() [1/3]

StatusCode RecCgemSegmentCnv::TObjectToDataObject ( DataObject *&  dat)
protectedvirtual

Do the concrete conversion from ROOT to TDS.

Implements RootEventBaseCnv.

Definition at line 36 of file bak_RootCnvSvc-04-01-14/src/Rec/RecCgemSegmentCnv.cxx.

37{
38 MsgStream log(msgSvc(),"RecCgemSegmentCnv");
39 log << MSG::DEBUG << "RecCgemSegmentCnv::TObjectToDataObject" << endreq;
40
41
42 RecCgemSegmentCol* recCgemSegmentCol = new RecCgemSegmentCol;
43 refpObject = recCgemSegmentCol;
44
45
46 //convert//
47 if (!m_recCgemSegmentCol) return StatusCode::SUCCESS;
48 TIter cgemSegmentIter(m_recCgemSegmentCol);
49 TRecCgemSegment *recCgemSegmentRoot = 0;
50 while ((recCgemSegmentRoot = (TRecCgemSegment*)cgemSegmentIter.Next()))
51 {
52 int clusterid_1 = recCgemSegmentRoot->getclusterid_1();
53 int clusterid_2 = recCgemSegmentRoot->getclusterid_2();
54 int clusterid_3 = recCgemSegmentRoot->getclusterid_3();
55 int eventid = recCgemSegmentRoot->geteventid();
56 int match = recCgemSegmentRoot->getmatch();
57 int segmentid = recCgemSegmentRoot->getsegmentid();
58 double helix[5];
59 double helix_err[15];
60 for(int i = 0; i < 5; i++){
61 helix[i] = (recCgemSegmentRoot)->gethelix(i);
62 }
63 for(int i = 0; i < 15; i++){
64 helix_err[i] = (recCgemSegmentRoot)->gethelix_err(i);
65 }
66
67 RecCgemSegment* recCgemSegment = new RecCgemSegment();
68 m_common.m_rootRecCgemSegmentMap[recCgemSegmentRoot] = recCgemSegment;
69
70 recCgemSegment->setclusterid_1(clusterid_1);
71 recCgemSegment->setclusterid_2(clusterid_2);
72 recCgemSegment->setclusterid_3(clusterid_3);
73 recCgemSegment->seteventid(eventid);
74 recCgemSegment->setmatch(match);
75 recCgemSegment->setsegmentid(segmentid);
76 recCgemSegment->sethelix( helix );
77 recCgemSegment->sethelix_err( helix_err );
78
79 recCgemSegmentCol->push_back(recCgemSegment);
80 }
81 return StatusCode::SUCCESS;
82}
void sethelix(double helix[5])
void sethelix_err(double helix_err[15])
static std::map< const TObject *, const RecCgemSegment * > m_rootRecCgemSegmentMap

◆ TObjectToDataObject() [2/3]

virtual StatusCode RecCgemSegmentCnv::TObjectToDataObject ( DataObject *&  dat)
protectedvirtual

Do the concrete conversion from ROOT to TDS.

Implements RootEventBaseCnv.

◆ TObjectToDataObject() [3/3]

virtual StatusCode RecCgemSegmentCnv::TObjectToDataObject ( DataObject *&  dat)
protectedvirtual

Do the concrete conversion from ROOT to TDS.

Implements RootEventBaseCnv.

Friends And Related Function Documentation

◆ CnvFactory< RecCgemSegmentCnv >


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