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

Concrete converter for the CgemDigi collection. More...

#include <CgemDigiCnv.h>

+ Inheritance diagram for CgemDigiCnv:

Public Member Functions

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

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

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

Concrete converter for the CgemDigi collection.

Definition at line 19 of file Event/RootCnvSvc/bak_RootCnvSvc-04-01-14/RootCnvSvc/Digi/CgemDigiCnv.h.

Constructor & Destructor Documentation

◆ ~CgemDigiCnv() [1/3]

virtual CgemDigiCnv::~CgemDigiCnv ( )
inlinevirtual

◆ CgemDigiCnv() [1/3]

CgemDigiCnv::CgemDigiCnv ( ISvcLocator *  svc)
protected

Definition at line 25 of file bak_RootCnvSvc-04-01-14/src/Digi/CgemDigiCnv.cxx.

27{
28 // Here we associate this converter with the /Event path on the TDS.
29 MsgStream log(msgSvc(), "CgemDigiCnv");
30//myModify
31 log << MSG::INFO << "My Message::CgemDigiCnv:RootEventBaseCnv" << endreq;
32
33 //log << MSG::DEBUG << "Constructor called for " << objType() << endreq;
34 m_rootBranchname ="m_cgemDigiCol";
35 //declareObject(EventModel::Digi::CgemDigiCol, objType(), m_rootTreename, m_rootBranchname);
36 m_adresses.push_back(&m_cgemDigiCol);
37 m_cgemDigiCol=0;
38
39//myModify
40 log << MSG::INFO << "My Message::CgemDigiCnv:RootEventBaseCnv-finished" << endreq;
41
42}
std::vector< void * > m_adresses
each converter knows the corresponding adresses
std::string m_rootBranchname
root branchname (may be concatenated of severals)

◆ ~CgemDigiCnv() [2/3]

virtual CgemDigiCnv::~CgemDigiCnv ( )
inlinevirtual

◆ CgemDigiCnv() [2/3]

CgemDigiCnv::CgemDigiCnv ( ISvcLocator *  svc)
protected

◆ ~CgemDigiCnv() [3/3]

virtual CgemDigiCnv::~CgemDigiCnv ( )
inlinevirtual

◆ CgemDigiCnv() [3/3]

CgemDigiCnv::CgemDigiCnv ( ISvcLocator *  svc)
protected

Member Function Documentation

◆ classID() [1/3]

static const CLID & CgemDigiCnv::classID ( )
inlinestatic

Definition at line 24 of file Event/RootCnvSvc/bak_RootCnvSvc-04-01-14/RootCnvSvc/Digi/CgemDigiCnv.h.

25 {
26 return CLID_CgemDigiCol;
27 }
const CLID & CLID_CgemDigiCol
Definition: EventModel.cxx:278

◆ classID() [2/3]

static const CLID & CgemDigiCnv::classID ( )
inlinestatic

◆ classID() [3/3]

static const CLID & CgemDigiCnv::classID ( )
inlinestatic

Definition at line 24 of file InstallArea/include/RootCnvSvc/RootCnvSvc/Digi/CgemDigiCnv.h.

25 {
26 return CLID_CgemDigiCol;
27 }

◆ DataObjectToTObject() [1/3]

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

transformation to root

Implements RootEventBaseCnv.

Definition at line 102 of file bak_RootCnvSvc-04-01-14/src/Digi/CgemDigiCnv.cxx.

102 {
103
104 MsgStream log(msgSvc(), "CgemDigiCnv");
105 //myModify
106 log << MSG::INFO << "My Message::CgemDigiCnv::DataObjectToTObject()" << endreq;
107
108 log << MSG::DEBUG << "CgemDigiCnv::DataObjectToTObject" << endreq;
109 StatusCode sc=StatusCode::SUCCESS;
110
111 CgemDigiCol * cgemDigiColTds=dynamic_cast<CgemDigiCol *> (obj);
112 if (!cgemDigiColTds) {
113 log << MSG::ERROR << "Could not downcast to CgemDigiCol" << endreq;
114 //myModify
115 log << MSG::INFO << "My Message::CgemDigiCnv::DataObjectToTObject()-finished" << endreq;
116
117 return StatusCode::FAILURE;
118 }
119
120 DataObject *evt;
121 m_eds->findObject(EventModel::Digi::Event,evt);
122 if (evt==NULL) {
123 log << MSG::ERROR << "Could not get DigiEvent in TDS " << endreq;
124//myModify
125 log << MSG::INFO << "My Message::CgemDigiCnv::DataObjectToTObject()-finished" << endreq;
126
127 return StatusCode::FAILURE;
128 }
129 DigiEvent * devtTds=dynamic_cast<DigiEvent *> (evt);
130 if (!devtTds) {
131//myModify
132 log << MSG::INFO << "My Message::CgemDigiCnv::DataObjectToTObject()-finished" << endreq;
133
134 log << MSG::ERROR << "CgemDigiCnv:Could not downcast to TDS DigiEvent" << endreq;
135 }
136
137 IOpaqueAddress *addr;
138
139
140 m_cnvSvc->getDigiCnv()->createRep(evt,addr);
141
142 //createRep(evt,addr);
143
145
146 const TObjArray *m_cgemDigiCol = recEvt->getCgemDigiCol();
147 if (!m_cgemDigiCol) return sc;
148 recEvt->clearCgemDigiCol(); //necessary in case there is I/O at the same time since array is static
149 CgemDigiCol::const_iterator cgemDigiTds;
150
151 for (cgemDigiTds=cgemDigiColTds->begin(); cgemDigiTds!=cgemDigiColTds->end(); cgemDigiTds++)
152 {
153 UInt_t overflow = (*cgemDigiTds)->getOverflow();
154 UInt_t time = (*cgemDigiTds)->getTimeChannel();
155 UInt_t charge = (*cgemDigiTds)->getChargeChannel();
156 UInt_t id = (*cgemDigiTds)->getIntId();
157 Int_t trackIndex = (*cgemDigiTds)->getTrackIndex();
158
159 TCgemDigi *cgemDigiRoot = new TCgemDigi();
160 //m_common.m_cgemDigiMap[(*cgemDigiTds)] = cgemDigiRoot;
161 //myModify
162 log << MSG::INFO << "My Message::CgemDigiCnv::DataObjectToTObject: "
163 << "id=" << id
164 << ",time=" << time
165 << ",charge=" << charge
166 << ",overflow=" << overflow << endreq;
167
168 cgemDigiRoot->initialize(id, time ,charge);
169 cgemDigiRoot->setOverflow(overflow);
170 cgemDigiRoot->setTrackIndex(trackIndex);
171 recEvt->addCgemDigi(cgemDigiRoot);
172 }
173
174 //myModify
175 log << MSG::INFO << "My Message::CgemDigiCnv::DataObjectToTObject()-finished" << endreq;
176
177 return StatusCode::SUCCESS;
178}
Double_t time
static TDigiEvent * 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 setOverflow(const UInt_t overflow)
void clearCgemDigiCol()
clear the whole array (necessary because of the consts-s)
const TObjArray * getCgemDigiCol() const
retrieve the whole TObjArray of TkrDigi Data
void addCgemDigi(TCgemDigi *digi)
Add a TkrDigi into the TKR data collection.
void initialize(UInt_t id, UInt_t time=0, UInt_t charge=0)
void setTrackIndex(const int trackIndex)

◆ DataObjectToTObject() [2/3]

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

transformation to root

Implements RootEventBaseCnv.

◆ DataObjectToTObject() [3/3]

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

transformation to root

Implements RootEventBaseCnv.

◆ TObjectToDataObject() [1/3]

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

transformation from root

Implements RootEventBaseCnv.

Definition at line 44 of file bak_RootCnvSvc-04-01-14/src/Digi/CgemDigiCnv.cxx.

44 {
45 // creation of TDS object from root object
46
47 MsgStream log(msgSvc(), "CgemDigiCnv");
48//myModify
49 log << MSG::INFO << "My Message::CgemDigiCnv::TObjectToDataObject()" << endreq;
50
51 log << MSG::DEBUG << "CgemDigiCnv::TObjectToDataObject" << endreq;
52 StatusCode sc=StatusCode::SUCCESS;
53
54 // create the TDS location for the CgemDigi Collection
55 CgemDigiCol* cgemDigiTdsCol = new CgemDigiCol;
56 refpObject=cgemDigiTdsCol;
57// sc = m_eds->registerObject(EventModel::Digi::CgemDigiCol, cgemDigiTdsCol);
58// if (sc.isFailure()) {
59// log << "Failed to register CgemDigi Collection" << endreq;
60// return StatusCode::FAILURE;
61// }
62
63 // now convert
64 if (!m_cgemDigiCol) return sc;
65 TIter cgemDigiIter(m_cgemDigiCol);
66 TCgemDigi *cgemDigiRoot = 0;
67 while ((cgemDigiRoot = (TCgemDigi*)cgemDigiIter.Next()))
68 {
69 unsigned int id = cgemDigiRoot->getIntId();
70 unsigned int time = cgemDigiRoot->getTimeChannel();
71 unsigned int charge = cgemDigiRoot->getChargeChannel();
72 unsigned int overflow = cgemDigiRoot->getOverflow();
73 unsigned int trackIndex = cgemDigiRoot->getTrackIndex();
74
75 CgemDigi *cgemDigiTds = new CgemDigi(id);
76 m_common.m_rootCgemDigiMap[cgemDigiRoot] = cgemDigiTds;
77
78 //myModify
79 log << MSG::INFO << "My Message::CgemDigiCnv::TObjectToDataObject: "
80 << "id=" << id
81 << ",time=" << time
82 << ",charge=" << charge
83 << ",overflow=" << overflow << endreq;
84
85 cgemDigiTds->setTimeChannel(time);
86 cgemDigiTds->setChargeChannel(charge);
87 cgemDigiTds->setOverflow(overflow);
88 cgemDigiTds->setTrackIndex(trackIndex);
89
90 cgemDigiTdsCol->push_back(cgemDigiTds);
91 }
92 //m_cgemDigiCol->Delete(); // wensp add 2005/12/30
93 delete m_cgemDigiCol;
94 m_cgemDigiCol = 0;
95
96 //myModify
97 log << MSG::INFO << "My Message::CgemDigiCnv::TObjectToDataObject()-finished" << endreq;
98
99 return StatusCode::SUCCESS;
100}
void setTrackIndex(const int trackIndex)
Definition: RawData.cxx:35
void setChargeChannel(const unsigned int chargeChannel)
Definition: RawData.cxx:30
void setTimeChannel(const unsigned int timeChannel)
Definition: RawData.cxx:25
static std::map< const TObject *, const CgemDigi * > m_rootCgemDigiMap

◆ TObjectToDataObject() [2/3]

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

transformation from root

Implements RootEventBaseCnv.

◆ TObjectToDataObject() [3/3]

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

transformation from root

Implements RootEventBaseCnv.

Friends And Related Function Documentation

◆ CnvFactory< CgemDigiCnv >


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