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

#include <RecCgemDedxHitCnv.h>

+ Inheritance diagram for RecCgemDedxHitCnv:

Public Member Functions

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

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

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

◆ ~RecCgemDedxHitCnv() [1/3]

virtual RecCgemDedxHitCnv::~RecCgemDedxHitCnv ( )
inlinevirtual

◆ RecCgemDedxHitCnv() [1/3]

RecCgemDedxHitCnv::RecCgemDedxHitCnv ( ISvcLocator *  svc)
protected

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

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

◆ ~RecCgemDedxHitCnv() [2/3]

virtual RecCgemDedxHitCnv::~RecCgemDedxHitCnv ( )
inlinevirtual

◆ RecCgemDedxHitCnv() [2/3]

RecCgemDedxHitCnv::RecCgemDedxHitCnv ( ISvcLocator *  svc)
protected

◆ ~RecCgemDedxHitCnv() [3/3]

virtual RecCgemDedxHitCnv::~RecCgemDedxHitCnv ( )
inlinevirtual

◆ RecCgemDedxHitCnv() [3/3]

RecCgemDedxHitCnv::RecCgemDedxHitCnv ( ISvcLocator *  svc)
protected

Member Function Documentation

◆ classID() [1/3]

static const CLID & RecCgemDedxHitCnv::classID ( )
inlinestatic

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

21 {
23 }
const CLID & CLID_RecCgemDedxHitCol
Definition: EventModel.cxx:415

◆ classID() [2/3]

static const CLID & RecCgemDedxHitCnv::classID ( )
inlinestatic

◆ classID() [3/3]

static const CLID & RecCgemDedxHitCnv::classID ( )
inlinestatic

◆ DataObjectToTObject() [1/3]

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

transformation to root

Implements RootEventBaseCnv.

Definition at line 81 of file bak_RootCnvSvc-04-01-14/src/Rec/RecCgemDedxHitCnv.cxx.

81 {
82 MsgStream log(msgSvc(), "RecCgemDedxHitCnv");
83 log << MSG::DEBUG << "RecCgemDedxHitCnv::DataObjectToTObject" << endreq;
84 StatusCode sc=StatusCode::SUCCESS;
85 RecCgemDedxHitCol * recCgemDedxHitCol=dynamic_cast<RecCgemDedxHitCol *> (obj);
86 if (!recCgemDedxHitCol) {
87 log << MSG::ERROR << "Could not downcast to RecCgemDedxHitCol" << endreq;
88 return StatusCode::FAILURE;
89 }
90 DataObject *evt;
91 m_eds->findObject(EventModel::Recon::Event,evt);
92 if (evt==NULL) {
93 log << MSG::ERROR << "Could not get RecEvent in TDS " << endreq;
94 return StatusCode::FAILURE;
95 }
96 ReconEvent * devtTds=dynamic_cast<ReconEvent *> (evt);
97 if (!devtTds) {
98 log << MSG::ERROR << "RecCgemDedxHitCnv:Could not downcast to TDS RecEvent" << endreq;
99 }
100 IOpaqueAddress *addr;
101 m_cnvSvc->getRecTrackCnv()->createRep(evt,addr);
103 const TObjArray *m_recCgemDedxHitCol = recEvt->getRecCgemDedxHitCol();
104 if (!m_recCgemDedxHitCol) return sc;
105 recEvt->clearRecCgemDedxHitCol(); //necessary in case there is I/O at the same time since array is static
106 RecCgemDedxHitCol::const_iterator recCgemDedxHit;
107 for (recCgemDedxHit = recCgemDedxHitCol->begin(); recCgemDedxHit != recCgemDedxHitCol->end(); recCgemDedxHit++) {
108 int trackId = (*recCgemDedxHit)->getTrkId();
109// UInt_t cgemIdMSB =(*recCgemDedxHit)->getCgemId().get_valueMSB();
110// UInt_t cgemIdLSB =(*recCgemDedxHit)->getCgemId().get_valueLSB();
111 UInt_t cgemId =(*recCgemDedxHit)->getCgemId().get_value();
112 double pathlength = (*recCgemDedxHit)->getPathLength();
113 log << MSG::DEBUG<<"check Reconstrunction of dE/dx Hit root"<<" pathlength is : "<<pathlength<<endreq;
114 TRecCgemDedxHit *recCgemDedxHitRoot = new TRecCgemDedxHit();
115 //m_common.m_recCgemDedxHitMap[(*recCgemDedxHit)] = recCgemDedxHitRoot;
116 recCgemDedxHitRoot->setTrkId(trackId);
117// recCgemDedxHitRoot->setCgemIdMSB( cgemIdMSB );
118// recCgemDedxHitRoot->setCgemIdLSB( cgemIdLSB );
119 recCgemDedxHitRoot->setCgemId( cgemId );
120
121 recCgemDedxHitRoot->setPathLength( pathlength);
122 log << MSG::DEBUG<<"check Reconstrunction of dE/dx Hit root"<<" pathlength 2 is : "<<(*recCgemDedxHit)->getPathLength()<<endreq;
123 recEvt->addRecCgemDedxHit(recCgemDedxHitRoot);
124 }
125
126 return StatusCode::SUCCESS;
127}
ObjectVector< RecCgemDedxHit > RecCgemDedxHitCol
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 * getRecCgemDedxHitCol() const
retrieve the whole TObjArray of Dedx Data
void addRecCgemDedxHit(TRecCgemDedxHit *Track)
Add a Dedx into the TOF Data collection.

◆ DataObjectToTObject() [2/3]

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

transformation to root

Implements RootEventBaseCnv.

◆ DataObjectToTObject() [3/3]

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

transformation to root

Implements RootEventBaseCnv.

◆ TObjectToDataObject() [1/3]

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

transformation from root

Implements RootEventBaseCnv.

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

42 {
43 // creation of TDS object from root object
44 MsgStream log(msgSvc(), "RecCgemDedxHitCnv");
45 log << MSG::DEBUG << "RecCgemDedxHitCnv::TObjectToDataObject" << endreq;
46 StatusCode sc=StatusCode::SUCCESS;
47 // create the TDS location for the Dedx Collection
48 RecCgemDedxHitCol* recCgemDedxHitCol = new RecCgemDedxHitCol;
49 refpObject=recCgemDedxHitCol;
50
51 // now convert
52 if (!m_recCgemDedxHitCol) return sc;
53 TIter dedxIter(m_recCgemDedxHitCol);
54 TRecCgemDedxHit *recCgemDedxHitRoot = 0;
55 while ((recCgemDedxHitRoot = (TRecCgemDedxHit*)dedxIter.Next())) {
56 int trackId = recCgemDedxHitRoot->trkId();
57// unsigned int cgemIdMSB(recCgemDedxHitRoot->cgemIdMSB());
58// unsigned int cgemIdLSB(recCgemDedxHitRoot->cgemIdLSB());
59 unsigned int cgemId(recCgemDedxHitRoot->cgemId());
60 double pathlength = recCgemDedxHitRoot->pathLength();
61 log << MSG::DEBUG<<"check Reconstrunction of dE/dx Hit root"<<" pathlength is : "<<pathlength<<endreq;
62 RecCgemDedxHit *recCgemDedxHit = new RecCgemDedxHit();
63 m_common.m_rootRecCgemDedxHitMap[recCgemDedxHitRoot] = recCgemDedxHit;
64 recCgemDedxHit->setTrkId(trackId);
65// recCgemDedxHit->setCgemId( Identifier64(cgemIdMSB,cgemIdLSB) );
66 recCgemDedxHit->setCgemId( Identifier(cgemId) );
67 recCgemDedxHit->setPathLength( pathlength);
68 // log << MSG::DEBUG<<"check Reconstrunction of dE/dx Hit root"<<" pathlength 2 is : "<<(*recdedxhit)->getPathLength()<<endreq;
69 recCgemDedxHitCol->push_back(recCgemDedxHit);
70 //delete dedxTds;
71 // dedxTds = NULL;
72 }
73 //m_dedxCol->Delete();
74 delete m_recCgemDedxHitCol;
75 m_recCgemDedxHitCol = 0;
76
77 return StatusCode::SUCCESS;
78}
static std::map< const TObject *, const RecCgemDedxHit * > m_rootRecCgemDedxHitMap

◆ TObjectToDataObject() [2/3]

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

transformation from root

Implements RootEventBaseCnv.

◆ TObjectToDataObject() [3/3]

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

transformation from root

Implements RootEventBaseCnv.

Friends And Related Function Documentation

◆ CnvFactory< RecCgemDedxHitCnv >


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