BOSS 7.0.2
BESIII Offline Software System
Loading...
Searching...
No Matches
HltRawCnv Class Reference

Concrete converter for the HltRaw collection. More...

#include <HltRawCnv.h>

+ Inheritance diagram for HltRawCnv:

Public Member Functions

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

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

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 HltRaw collection.

Definition at line 19 of file Event/RootCnvSvc/RootCnvSvc-02-01-12/RootCnvSvc/Hlt/HltRawCnv.h.

Constructor & Destructor Documentation

◆ ~HltRawCnv() [1/2]

virtual HltRawCnv::~HltRawCnv ( )
inlinevirtual

◆ HltRawCnv() [1/2]

HltRawCnv::HltRawCnv ( ISvcLocator *  svc)
protected

Definition at line 25 of file HltRawCnv.cxx.

27{
28 // Here we associate this converter with the /Event path on the TDS.
29 MsgStream log(msgSvc(), "HltRawCnv");
30 //log << MSG::DEBUG << "Constructor called for " << objType() << endreq;
31 m_rootBranchname ="m_hltRawCol";
32 //declareObject(EventModel::Hlt::HltRawCol, objType(), m_rootTreename, m_rootBranchname);
33 m_adresses.push_back(&m_hltRawCol);
34 m_hltRawCol=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)

◆ ~HltRawCnv() [2/2]

virtual HltRawCnv::~HltRawCnv ( )
inlinevirtual

◆ HltRawCnv() [2/2]

HltRawCnv::HltRawCnv ( ISvcLocator *  svc)
protected

Member Function Documentation

◆ classID() [1/2]

static const CLID & HltRawCnv::classID ( )
inlinestatic

Definition at line 24 of file Event/RootCnvSvc/RootCnvSvc-02-01-12/RootCnvSvc/Hlt/HltRawCnv.h.

25 {
26 return CLID_HltRawCol;
27 }
const CLID & CLID_HltRawCol
Definition: EventModel.cxx:285

◆ classID() [2/2]

static const CLID & HltRawCnv::classID ( )
inlinestatic

Definition at line 24 of file InstallArea/include/RootCnvSvc/RootCnvSvc/Hlt/HltRawCnv.h.

25 {
26 return CLID_HltRawCol;
27 }

◆ DataObjectToTObject() [1/2]

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

transformation to root

Implements RootEventBaseCnv.

Definition at line 78 of file HltRawCnv.cxx.

78 {
79
80 MsgStream log(msgSvc(), "HltRawCnv");
81 log << MSG::DEBUG << "HltRawCnv::DataObjectToTObject" << endreq;
82 StatusCode sc=StatusCode::SUCCESS;
83
84 HltRawCol * hltRawColTds=dynamic_cast<HltRawCol *> (obj);
85 if (!hltRawColTds) {
86 log << MSG::ERROR << "Could not downcast to HltRawCol" << endreq;
87 return StatusCode::FAILURE;
88 }
89
90 DataObject *evt;
91 m_eds->findObject(EventModel::Hlt::Event,evt);
92 if (evt==NULL) {
93 log << MSG::ERROR << "Could not get HltEvent in TDS " << endreq;
94 return StatusCode::FAILURE;
95 }
96 HltEvent * devtTds=dynamic_cast<HltEvent *> (evt);
97 if (!devtTds) {
98 log << MSG::ERROR << "HltRawCnv:Could not downcast to TDS HltEvent" << endreq;
99 }
100
101 IOpaqueAddress *addr;
102
103
104 m_cnvSvc->getHltCnv()->createRep(evt,addr);
105
106 //createRep(evt,addr);
107
109
110 const TObjArray *m_hltRawCol = recEvt->getHltRawCol();
111 if (!m_hltRawCol) return sc;
112 recEvt->clearHltRawCol(); //necessary in case there is I/O at the same time since array is static
113 HltRawCol::const_iterator hltRawTds;
114
115 for (hltRawTds = hltRawColTds->begin(); hltRawTds != hltRawColTds->end(); hltRawTds++) {
116 UInt_t time = (*hltRawTds)->getTimeChannel();
117 UInt_t charge = (*hltRawTds)->getChargeChannel();
118 UInt_t id = (*hltRawTds)->getIntId();
119
120 THltRaw *hltRawRoot = new THltRaw();
121 //m_common.m_hltRawMap[(*hltRawTds)] = hltRawRoot;
122
123 hltRawRoot->initialize(id, time ,charge);
124 recEvt->addHltRaw(hltRawRoot);
125 }
126
127 return StatusCode::SUCCESS;
128}
Double_t time
ObjectVector< HltRaw > HltRawCol
static THltEvent * 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 * getHltRawCol() const
Definition: THltEvent.cxx:73
void addHltRaw(THltRaw *hltRaw)
HltRaw.
Definition: THltEvent.cxx:65
void initialize(UInt_t id, UInt_t time=0, UInt_t charge=0)
Definition: TRawData.cxx:34

◆ DataObjectToTObject() [2/2]

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

transformation to root

Implements RootEventBaseCnv.

◆ TObjectToDataObject() [1/2]

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

transformation from root

Implements RootEventBaseCnv.

Definition at line 38 of file HltRawCnv.cxx.

38 {
39 // creation of TDS object from root object
40
41 MsgStream log(msgSvc(), "HltRawCnv");
42 log << MSG::DEBUG << "HltRawCnv::TObjectToDataObject" << endreq;
43 StatusCode sc=StatusCode::SUCCESS;
44
45 // create the TDS location for the HltRaw Collection
46 HltRawCol* hltRawTdsCol = new HltRawCol;
47 refpObject=hltRawTdsCol;
48// sc = m_eds->registerObject(EventModel::Hlt::HltRawCol, hltRawTdsCol);
49// if (sc.isFailure()) {
50// log << "Failed to register HltRaw Collection" << endreq;
51// return StatusCode::FAILURE;
52// }
53
54
55 // now convert
56 if (!m_hltRawCol) return sc;
57 TIter hltRawIter(m_hltRawCol);
58 THltRaw *hltRawRoot = 0;
59 while ((hltRawRoot = (THltRaw*)hltRawIter.Next())) {
60 unsigned int id = hltRawRoot->getIntId();
61 unsigned int time = hltRawRoot->getTimeChannel();
62 unsigned int charge = hltRawRoot->getChargeChannel();
63
64 HltRaw *hltRawTds = new HltRaw(id);
65 m_common.m_rootHltRawMap[hltRawRoot] = hltRawTds;
66
67 hltRawTds->setTimeChannel(time);
68 hltRawTds->setChargeChannel(charge);
69
70 hltRawTdsCol->push_back(hltRawTds);
71 }
72 //m_hltRawCol->Delete(); // wensp add 2005/12/30
73 delete m_hltRawCol;
74 m_hltRawCol = 0;
75 return StatusCode::SUCCESS;
76}
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
UInt_t getChargeChannel() const
Definition: TRawData.cxx:60
UInt_t getTimeChannel() const
Definition: TRawData.cxx:55
static std::map< const TObject *, const HltRaw * > m_rootHltRawMap

◆ TObjectToDataObject() [2/2]

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

transformation from root

Implements RootEventBaseCnv.

Friends And Related Function Documentation

◆ CnvFactory< HltRawCnv >

friend class CnvFactory< HltRawCnv >
friend

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