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

#include <RecCgemDedxHitCnv.h>

+ Inheritance diagram for RecCgemDedxHitCnv:

Public Member Functions

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
 
- 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

 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
 

Friends

class CnvFactory< RecCgemDedxHitCnv >
 

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 RecCgemDedxHitCnv.h.

Constructor & Destructor Documentation

◆ ~RecCgemDedxHitCnv()

virtual RecCgemDedxHitCnv::~RecCgemDedxHitCnv ( )
inlinevirtual

Definition at line 25 of file RecCgemDedxHitCnv.h.

25{ };

◆ RecCgemDedxHitCnv()

RecCgemDedxHitCnv::RecCgemDedxHitCnv ( ISvcLocator *  svc)
protected

Definition at line 28 of file 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}
IMessageSvc * msgSvc()
static const CLID & classID()
Base class for all Root Converters.
std::vector< void * > m_adresses
each converter knows the corresponding adresses
std::string m_rootBranchname
root branchname (may be concatenated of severals)

Member Function Documentation

◆ classID()

static const CLID & RecCgemDedxHitCnv::classID ( )
inlinestatic

Definition at line 20 of file RecCgemDedxHitCnv.h.

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

◆ DataObjectToTObject()

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

transformation to root

Implements RootEventBaseCnv.

Definition at line 81 of file 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)
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 setCgemId(UInt_t cgemid)
void setTrkId(Int_t trkid)
void setPathLength(double pathlength)
const TObjArray * getRecCgemDedxHitCol() const
retrieve the whole TObjArray of Dedx Data
void clearRecCgemDedxHitCol()
clear the whole array
void addRecCgemDedxHit(TRecCgemDedxHit *Track)
Add a Dedx into the TOF Data collection.
_EXTERN_ std::string Event
Definition: EventModel.h:90

◆ TObjectToDataObject()

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

transformation from root

Implements RootEventBaseCnv.

Definition at line 42 of file 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}
void setTrkId(int trkid)
void setCgemId(Identifier cgemid)
void setPathLength(double pathlength)
const UInt_t cgemId() const
const Double_t pathLength(void) const
const Int_t trkId(void) const
static std::map< const TObject *, const RecCgemDedxHit * > m_rootRecCgemDedxHitMap
Definition: commonData.h:285

Friends And Related Function Documentation

◆ CnvFactory< RecCgemDedxHitCnv >

friend class CnvFactory< RecCgemDedxHitCnv >
friend

Definition at line 9 of file RecCgemDedxHitCnv.h.


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