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

#include <RecCgemSegmentCnv.h>

+ Inheritance diagram for RecCgemSegmentCnv:

Public Member Functions

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.
 
TObject * getReadObject () const
 get the object to be read
 
- Public Member Functions inherited from Converter< Ty1, Ty2 >
destinationoperator (const source &) const
 

Static Public Member Functions

static const CLID & classID ()
 
- Static Public Member Functions inherited from RootEventBaseCnv
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.
 
- Protected Member Functions inherited from Converter< Ty1, Ty2 >
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
 
- 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

Definition at line 15 of file RecCgemSegmentCnv.h.

Constructor & Destructor Documentation

◆ ~RecCgemSegmentCnv()

virtual RecCgemSegmentCnv::~RecCgemSegmentCnv ( )
inlinevirtual

Definition at line 26 of file RecCgemSegmentCnv.h.

26{ };

◆ RecCgemSegmentCnv()

RecCgemSegmentCnv::RecCgemSegmentCnv ( ISvcLocator * svc)
protected

Definition at line 26 of file 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}
IMessageSvc * msgSvc()
static const CLID & classID()
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)

Member Function Documentation

◆ classID()

static const CLID & RecCgemSegmentCnv::classID ( )
inlinestatic

Definition at line 21 of file RecCgemSegmentCnv.h.

22 {
24 }
const CLID & CLID_RecCgemSegmentCol

◆ DataObjectToTObject()

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

Do the concrete conversion from TDS to ROOT.

Implements RootEventBaseCnv.

Definition at line 83 of file 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)
Definition RecTrackCnv.h:36
RecTrackCnv * getRecTrackCnv()
Definition RootCnvSvc.h:166
RootCnvSvc * m_cnvSvc
IDataProviderSvc * m_eds
pointer to eventdataservice
virtual StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress)
Convert the transient object to the requested representation.
void setsegmentid(Int_t segmentid)
void sethelix_err(Double_t helix_err[15])
void seteventid(Int_t eventid)
void setmatch(Int_t match)
void sethelix(Double_t helix[5])
void setclusterid_1(Int_t clusterid_1)
void setclusterid_2(Int_t clusterid_2)
void setclusterid_3(Int_t clusterid_3)
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)
_EXTERN_ std::string Event
Definition EventModel.h:90

◆ TObjectToDataObject()

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

Do the concrete conversion from ROOT to TDS.

Implements RootEventBaseCnv.

Definition at line 36 of file 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 setclusterid_2(const int clusterId_2)
void setmatch(const int match)
void setsegmentid(const int segmentId)
void setclusterid_1(const int clusterId_1)
void seteventid(const int eventId)
void setclusterid_3(const int clusterId_3)
void sethelix(double helix[5])
void sethelix_err(double helix_err[15])
Int_t geteventid(void) const
Int_t getclusterid_3(void) const
Int_t getmatch(void) const
Int_t getsegmentid(void) const
Int_t getclusterid_2(void) const
Int_t getclusterid_1(void) const
static std::map< const TObject *, const RecCgemSegment * > m_rootRecCgemSegmentMap
Definition commonData.h:247

Friends And Related Symbol Documentation

◆ CnvFactory< RecCgemSegmentCnv >

friend class CnvFactory< RecCgemSegmentCnv >
friend

Definition at line 9 of file RecCgemSegmentCnv.h.


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