BOSS 7.0.5
BESIII Offline Software System
Loading...
Searching...
No Matches
MucDigiCnv Class Reference

#include <MucDigiCnv.h>

+ Inheritance diagram for MucDigiCnv:

Public Member Functions

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

Protected Member Functions

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

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

◆ ~MucDigiCnv() [1/2]

virtual MucDigiCnv::~MucDigiCnv ( )
inlinevirtual

◆ MucDigiCnv() [1/2]

MucDigiCnv::MucDigiCnv ( ISvcLocator *  svc)
protected

Definition at line 25 of file MucDigiCnv.cxx.

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

◆ ~MucDigiCnv() [2/2]

virtual MucDigiCnv::~MucDigiCnv ( )
inlinevirtual

◆ MucDigiCnv() [2/2]

MucDigiCnv::MucDigiCnv ( ISvcLocator *  svc)
protected

Member Function Documentation

◆ classID() [1/2]

static const CLID & MucDigiCnv::classID ( )
inlinestatic

Definition at line 20 of file Event/RootCnvSvc/RootCnvSvc-03-00-06/RootCnvSvc/Digi/MucDigiCnv.h.

21 {
22 return CLID_MucDigiCol;
23 }
const CLID & CLID_MucDigiCol
Definition: EventModel.cxx:244

◆ classID() [2/2]

static const CLID & MucDigiCnv::classID ( )
inlinestatic

Definition at line 20 of file InstallArea/include/RootCnvSvc/RootCnvSvc/Digi/MucDigiCnv.h.

21 {
22 return CLID_MucDigiCol;
23 }

◆ DataObjectToTObject() [1/2]

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

transformation to root

Implements RootEventBaseCnv.

Definition at line 74 of file MucDigiCnv.cxx.

74 {
75
76 MsgStream log(msgSvc(), "MucDigiCnv");
77 log << MSG::DEBUG << "MucDigiCnv::DataObjectToTObject" << endreq;
78 StatusCode sc=StatusCode::SUCCESS;
79
80 MucDigiCol * mucDigiColTds=dynamic_cast<MucDigiCol *> (obj);
81 if (!mucDigiColTds) {
82 log << MSG::ERROR << "Could not downcast to MucDigiCol" << endreq;
83 return StatusCode::FAILURE;
84 }
85
86 DataObject *evt;
87 m_eds->findObject(EventModel::Digi::Event,evt);
88 if (evt==NULL) {
89 log << MSG::ERROR << "Could not get DigiEvent in TDS " << endreq;
90 return StatusCode::FAILURE;
91 }
92 DigiEvent * devtTds=dynamic_cast<DigiEvent *> (evt);
93 if (!devtTds) {
94 log << MSG::ERROR << "MucDigiCnv:Could not downcast to TDS DigiEvent" << endreq;
95 }
96 IOpaqueAddress *addr;
97
98 m_cnvSvc->getDigiCnv()->createRep(evt,addr);
100
101 const TObjArray *m_mucDigiCol = recEvt->getMucDigiCol();
102 if (!m_mucDigiCol) return sc;
103 recEvt->clearMucDigiCol(); //necessary in case there is I/O at the same time since array is static
104 MucDigiCol::const_iterator mucDigiTds;
105
106 for (mucDigiTds = mucDigiColTds->begin(); mucDigiTds != mucDigiColTds->end(); mucDigiTds++) {
107 UInt_t time = (*mucDigiTds)->getTimeChannel();
108 UInt_t charge = (*mucDigiTds)->getChargeChannel();
109 UInt_t id = (*mucDigiTds)->getIntId();
110 Int_t trackIndex = (*mucDigiTds)->getTrackIndex();
111
112 TMucDigi *mucDigiRoot = new TMucDigi();
113 //m_common.m_mucDigiMap[(*mucDigiTds)] = mucDigiRoot;
114
115 mucDigiRoot->initialize(id, time ,charge);
116 mucDigiRoot->setTrackIndex(trackIndex);
117 recEvt->addMucDigi(mucDigiRoot);
118 }
119
120 return StatusCode::SUCCESS;
121}
Double_t time
ObjectVector< MucDigi > MucDigiCol
static TDigiEvent * getWriteObject()
returns object to be written (maintained here for all DIGI-converters)
IDataProviderSvc * m_eds
pointer to eventdataservice
virtual StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress)
Convert the transient object to the requested representation.
const TObjArray * getMucDigiCol() const
retrieve the whole TObjArray of MucDigi Data
void addMucDigi(TMucDigi *digi)
Add a MucDigi into the MUC Data collection.
Definition: TDigiEvent.cxx:153
void initialize(UInt_t id, UInt_t time=0, UInt_t charge=0)
Definition: TRawData.cxx:34
void setTrackIndex(const int trackIndex)
Definition: TRawData.cxx:41
float charge

◆ DataObjectToTObject() [2/2]

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

transformation to root

Implements RootEventBaseCnv.

◆ TObjectToDataObject() [1/2]

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

transformation from root

Implements RootEventBaseCnv.

Definition at line 38 of file MucDigiCnv.cxx.

38 {
39 // creation of TDS object from root object
40
41 MsgStream log(msgSvc(), "MucDigiCnv");
42 log << MSG::DEBUG << "MucDigiCnv::TObjectToDataObject" << endreq;
43 StatusCode sc=StatusCode::SUCCESS;
44
45 // create the TDS location for the MucDigi Collection
46 MucDigiCol* mucDigiTdsCol = new MucDigiCol;
47 refpObject=mucDigiTdsCol;
48
49
50 // now convert
51 if (!m_mucDigiCol) return sc;
52 TIter mucDigiIter(m_mucDigiCol);
53 TMucDigi *mucDigiRoot = 0;
54 while ((mucDigiRoot = (TMucDigi*)mucDigiIter.Next())) {
55 unsigned int id = mucDigiRoot->getIntId();
56 unsigned int time = mucDigiRoot->getTimeChannel();
57 unsigned int charge = mucDigiRoot->getChargeChannel();
58 int trackIndex = mucDigiRoot->getTrackIndex();
59
60 MucDigi *mucDigiTds = new MucDigi(id);
61 m_common.m_rootMucDigiMap[mucDigiRoot] = mucDigiTds;
62
63 mucDigiTds->setTimeChannel(time);
64 mucDigiTds->setChargeChannel(charge);
65 mucDigiTds->setTrackIndex(trackIndex);
66 mucDigiTdsCol->push_back(mucDigiTds);
67 }
68 //m_mucDigiCol->Delete(); // wensp add 2005/12/30
69 delete m_mucDigiCol;
70 m_mucDigiCol = 0;
71 return StatusCode::SUCCESS;
72}
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
UInt_t getIntId() const
Definition: TRawData.cxx:50
int getTrackIndex() const
Definition: TRawData.cxx:45
UInt_t getChargeChannel() const
Definition: TRawData.cxx:60
UInt_t getTimeChannel() const
Definition: TRawData.cxx:55
static std::map< const TObject *, const MucDigi * > m_rootMucDigiMap

◆ TObjectToDataObject() [2/2]

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

transformation from root

Implements RootEventBaseCnv.

Friends And Related Function Documentation

◆ CnvFactory< MucDigiCnv >


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