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

#include <RecCgemHitCnv.h>

+ Inheritance diagram for RecCgemHitCnv:

Public Member Functions

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

 RecCgemHitCnv (ISvcLocator *svc)
 
virtual StatusCode DataObjectToTObject (DataObject *obj, RootAddress *addr)
 transformation to root
 
virtual StatusCode TObjectToDataObject (DataObject *&obj)
 transformation from root
 
 RecCgemHitCnv (ISvcLocator *svc)
 
virtual StatusCode DataObjectToTObject (DataObject *obj, RootAddress *addr)
 transformation to root
 
virtual StatusCode TObjectToDataObject (DataObject *&obj)
 transformation from root
 
 RecCgemHitCnv (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< RecCgemHitCnv >
 

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

◆ ~RecCgemHitCnv() [1/3]

virtual RecCgemHitCnv::~RecCgemHitCnv ( )
inlinevirtual

◆ RecCgemHitCnv() [1/3]

RecCgemHitCnv::RecCgemHitCnv ( ISvcLocator *  svc)
protected

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

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

◆ ~RecCgemHitCnv() [2/3]

virtual RecCgemHitCnv::~RecCgemHitCnv ( )
inlinevirtual

◆ RecCgemHitCnv() [2/3]

RecCgemHitCnv::RecCgemHitCnv ( ISvcLocator *  svc)
protected

◆ ~RecCgemHitCnv() [3/3]

virtual RecCgemHitCnv::~RecCgemHitCnv ( )
inlinevirtual

◆ RecCgemHitCnv() [3/3]

RecCgemHitCnv::RecCgemHitCnv ( ISvcLocator *  svc)
protected

Member Function Documentation

◆ classID() [1/3]

static const CLID & RecCgemHitCnv::classID ( )
inlinestatic

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

21 {
22 return CLID_RecCgemHitCol;
23 }
const CLID & CLID_RecCgemHitCol
Definition: EventModel.cxx:405

◆ classID() [2/3]

static const CLID & RecCgemHitCnv::classID ( )
inlinestatic

◆ classID() [3/3]

static const CLID & RecCgemHitCnv::classID ( )
inlinestatic

◆ DataObjectToTObject() [1/3]

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

transformation to root

Implements RootEventBaseCnv.

Definition at line 91 of file bak_RootCnvSvc-04-01-14/src/Rec/RecCgemHitCnv.cxx.

91 {
92
93 MsgStream log(msgSvc(), "RecCgemHitCnv");
94 log << MSG::DEBUG << "RecCgemHitCnv::DataObjectToTObject" << endreq;
95
96 RecCgemHitCol * cgemHitColTds=dynamic_cast<RecCgemHitCol *> (obj);
97 if (!cgemHitColTds) {
98 log << MSG::ERROR << "Could not downcast to RecCgemHitCol" << endreq;
99 return StatusCode::FAILURE;
100 }
101
102 DataObject *evt;
103 m_eds->findObject(EventModel::Recon::Event,evt);
104 if (evt==NULL) {
105 log << MSG::ERROR << "Could not get ReconEvent in TDS " << endreq;
106 return StatusCode::FAILURE;
107 }
108
109 ReconEvent * devtTds=dynamic_cast<ReconEvent *> (evt);
110 if (!devtTds) {
111 log << MSG::ERROR << "RecCgemHitCnv:Could not downcast to TDS ReconEvent" << endreq;
112 }
113
114 IOpaqueAddress *addr;
115
116 m_cnvSvc->getRecTrackCnv()->createRep(evt,addr);
118
119 const TObjArray *m_recCgemHitCol = recEvt->getRecCgemHitCol();
120 if (!m_recCgemHitCol) return StatusCode::SUCCESS;
121 recEvt->clearRecCgemHitCol(); //necessary in case there is I/O at the same time since array is static
122
123 RecCgemHitCol::const_iterator recCgemHit;
124 for (recCgemHit = cgemHitColTds->begin(); recCgemHit != cgemHitColTds->end(); recCgemHit++) {
125 Bool_t isGrouped =(*recCgemHit)->isGrouped();
126 Int_t id =(*recCgemHit)->getId();
127 Int_t trackId =(*recCgemHit)->getTrkId();
128 Double_t chisqAdd =(*recCgemHit)->getChisqAdd();
129 Int_t stat =(*recCgemHit)->getStat();
130// UInt_t cgemIdMSB =(*recCgemHit)->getCgemId().get_valueMSB();
131// UInt_t cgemIdLSB =(*recCgemHit)->getCgemId().get_valueLSB();
132 UInt_t cgemId =(*recCgemHit)->getCgemId().get_value();
133 Double_t tdc =(*recCgemHit)->getTdc();
134 Double_t adc =(*recCgemHit)->getAdc();
135 Double_t doca =(*recCgemHit)->getDoca();
136 Double_t entra =(*recCgemHit)->getEntra();
137 Double_t zhit =(*recCgemHit)->getZhit();
138 Double_t fltLen =(*recCgemHit)->getFltLen();
139
140 TRecCgemHit *recCgemHitRoot = new TRecCgemHit();
141 //m_common.m_recCgemHitMap[(*recCgemHit)] = recCgemHitRoot;
142
143 recCgemHitRoot->setIsGrouped( isGrouped );
144 recCgemHitRoot->setId( id );
145 recCgemHitRoot->setTrkId( trackId );
146 recCgemHitRoot->setChisqAdd( chisqAdd );
147 recCgemHitRoot->setStat( stat );
148// recCgemHitRoot->setCgemIdMSB( cgemIdMSB );
149// recCgemHitRoot->setCgemIdLSB( cgemIdLSB );
150 recCgemHitRoot->setCgemId( cgemId );
151 recCgemHitRoot->setTdc( tdc );
152 recCgemHitRoot->setAdc( adc );
153 recCgemHitRoot->setDoca( doca );
154 recCgemHitRoot->setEntra( entra );
155 recCgemHitRoot->setZhit( zhit );
156 recCgemHitRoot->setFltLen( fltLen );
157
158 recEvt->addRecCgemHit(recCgemHitRoot);
159 }
160 return StatusCode::SUCCESS;
161}
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.
const TObjArray * getRecCgemHitCol() const
retrieve the whole TObjArray of RecCgemHit Data
void addRecCgemHit(TRecCgemHit *Hit)
Add a Rec Cgem Hit into the Cgem data collection.
void clearRecCgemHitCol()
clear the whole array (necessary because of the consts-s)

◆ DataObjectToTObject() [2/3]

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

transformation to root

Implements RootEventBaseCnv.

◆ DataObjectToTObject() [3/3]

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

transformation to root

Implements RootEventBaseCnv.

◆ TObjectToDataObject() [1/3]

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

transformation from root

Implements RootEventBaseCnv.

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

42 {
43 // creation of TDS object from root object
44 MsgStream log(msgSvc(), "RecCgemHitCnv");
45 log << MSG::DEBUG << "RecCgemHitCnv::TObjectToDataObject" << endreq;
46
47 // create the TDS location for the RecCgemHit Collection
48 RecCgemHitCol* recCgemHitCol = new RecCgemHitCol;
49 refpObject = recCgemHitCol;
50
51 // now convert
52 if (!m_recCgemHitCol) return StatusCode::SUCCESS;
53 TIter cgemHitIter(m_recCgemHitCol);
54 TRecCgemHit *recCgemHitRoot = 0;
55 while ((recCgemHitRoot = (TRecCgemHit*)cgemHitIter.Next())) {
56 int id = recCgemHitRoot->getId();
57 int trackId = recCgemHitRoot->getTrkId();
58 double chisqAdd = recCgemHitRoot->getChisqAdd();
59 int stat = recCgemHitRoot->getStat();
60// unsigned int cgemIdMSB=recCgemHitRoot->getCgemIdMSB();
61// unsigned int cgemIdLSB=recCgemHitRoot->getCgemIdLSB();
62 unsigned int cgemId=recCgemHitRoot->getCgemId();
63 double tdc = recCgemHitRoot->getTdc();
64 double adc = recCgemHitRoot->getAdc();
65 double doca = recCgemHitRoot->getDoca();
66 double entra = recCgemHitRoot->getEntra();
67 double zhit = recCgemHitRoot->getZhit();
68 double fltLen = recCgemHitRoot->getFltLen();
69
70 RecCgemHit *recCgemHit= new RecCgemHit();
71 m_common.m_rootRecCgemHitMap[recCgemHitRoot] = recCgemHit;
72
73 recCgemHit->setId( id );
74 recCgemHit->setTrkId( trackId );
75 recCgemHit->setChisqAdd( chisqAdd );
76 recCgemHit->setStat( stat );
77// recCgemHit->setCgemId( Identifier64(cgemIdMSB,cgemIdLSB) );
78 recCgemHit->setCgemId( Identifier(cgemId) );
79 recCgemHit->setTdc( tdc );
80 recCgemHit->setAdc( adc );
81 recCgemHit->setDoca( doca );
82 recCgemHit->setEntra( entra );
83 recCgemHit->setZhit( zhit );
84 recCgemHit->setFltLen( fltLen );
85
86 recCgemHitCol->push_back(recCgemHit);
87 }
88 return StatusCode::SUCCESS;
89}
static std::map< const TObject *, const RecCgemHit * > m_rootRecCgemHitMap

◆ TObjectToDataObject() [2/3]

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

transformation from root

Implements RootEventBaseCnv.

◆ TObjectToDataObject() [3/3]

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

transformation from root

Implements RootEventBaseCnv.

Friends And Related Function Documentation

◆ CnvFactory< RecCgemHitCnv >


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