BOSS 7.1.0
BESIII Offline Software System
Loading...
Searching...
No Matches
RecEvTimeCnv Class Reference

#include <RecEvTimeCnv.h>

+ Inheritance diagram for RecEvTimeCnv:

Public Member Functions

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

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

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

Constructor & Destructor Documentation

◆ ~RecEvTimeCnv()

virtual RecEvTimeCnv::~RecEvTimeCnv ( )
inlinevirtual

Definition at line 25 of file RecEvTimeCnv.h.

25{ };

◆ RecEvTimeCnv()

RecEvTimeCnv::RecEvTimeCnv ( ISvcLocator *  svc)
protected

Definition at line 32 of file RecEvTimeCnv.cxx.

34{
35
36 // Here we associate this converter with the /Event path on the TDS.
37 MsgStream log(msgSvc(), "RecEvTimeCnv");
38 //log << MSG::DEBUG << "Constructor called for " << objType() << endreq;
39 //m_rootTreename ="Rec";
40 m_rootBranchname ="m_recEvTimeCol";
41 // declareObject(EventModel::Recon::EvTimeCol, objType(), m_rootTreename, m_rootBranchname);
42 m_adresses.push_back(&m_recEvTimeCol);
43 m_recEvTimeCol=0;
44}
IMessageSvc * msgSvc()
static const CLID & classID()
Definition: RecEvTimeCnv.h:20
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 & RecEvTimeCnv::classID ( )
inlinestatic

Definition at line 20 of file RecEvTimeCnv.h.

21 {
22 return CLID_RecEsTimeCol;
23 }
const CLID & CLID_RecEsTimeCol
Definition: EventModel.cxx:364

◆ DataObjectToTObject()

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

transformation to root

Implements RootEventBaseCnv.

Definition at line 79 of file RecEvTimeCnv.cxx.

79 {
80 MsgStream log(msgSvc(), "RecEvTimeCnv");
81 log << MSG::DEBUG << "RecEvTimeCnv::DataObjectToTObject" << endreq;
82 StatusCode sc=StatusCode::SUCCESS;
83
84 RecEsTimeCol * evTimeColTds=dynamic_cast<RecEsTimeCol *> (obj);
85 if (!evTimeColTds) {
86 log << MSG::ERROR << "Could not downcast to RecEsTimeCol" << endreq;
87 return StatusCode::FAILURE;
88 }
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 << "RecEvTimeCnv:Could not downcast to TDS ReconEvent" << endreq;
99 }
100 IOpaqueAddress *addr;
101
102 m_cnvSvc->getRecTrackCnv()->createRep(evt,addr);
104 const TObjArray *m_recEvTimeCol = recEvt->getEvTimeCol();
105 if (!m_recEvTimeCol) return sc;
106 recEvt->clearEvTimeCol(); //necessary in case there is I/O at the same time since array is static
107 RecEsTimeCol::const_iterator evTimeTds;
108 for (evTimeTds = evTimeColTds->begin(); evTimeTds != evTimeColTds->end(); evTimeTds++) {
109 //Double_t estime = (*evTimeTds)->estime();
110 //Int_t status = (*evTimeTds)->status();
111 Double_t estime = (*evTimeTds)->getTest();
112 Int_t status = (*evTimeTds)->getStat();
113 Double_t quality = (*evTimeTds)->getQuality();
114 TRecEvTime *evTimeRoot = new TRecEvTime();
115 //m_common.m_RecEvTimeMap[(*evTimeTds)] = evTimeRoot;
116
117 evTimeRoot->setTest( estime );
118 evTimeRoot->setStats( status );
119 evTimeRoot->setQuality( quality );
120
121 recEvt->addEvTime(evTimeRoot);
122 }
123
124 return StatusCode::SUCCESS;
125}
ObjectVector< RecEsTime > RecEsTimeCol
Definition: RecEsTime.h:53
#define NULL
static TRecTrackEvent * getWriteObject()
returns object to be written (maintained here for all DIGI-converters)
Definition: RecTrackCnv.h:36
RecTrackCnv * getRecTrackCnv()
Definition: RootCnvSvc.h:173
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 setStats(Int_t status)
Definition: TRecEvTime.h:30
void setQuality(Double_t quality)
Definition: TRecEvTime.h:31
void setTest(Double_t estime)
Definition: TRecEvTime.h:29
const TObjArray * getEvTimeCol() const
void addEvTime(TRecEvTime *Track)
_EXTERN_ std::string Event
Definition: EventModel.h:84

◆ TObjectToDataObject()

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

transformation from root

Implements RootEventBaseCnv.

Definition at line 46 of file RecEvTimeCnv.cxx.

46 {
47 // creation of TDS object from root object
48MsgStream log(msgSvc(), "RecEvTimeCnv");
49 log << MSG::DEBUG << "RecEvTimeCnv::TObjectToDataObject" << endreq;
50 StatusCode sc=StatusCode::SUCCESS;
51
52 // create the TDS location for the MucTrack Collection
53 RecEsTimeCol* evTimeTdsCol = new RecEsTimeCol;
54 refpObject=evTimeTdsCol;
55 // now convert
56 if (!m_recEvTimeCol) return sc;
57 TIter evTimeIter(m_recEvTimeCol);
58 TRecEvTime *evTimeRoot = 0;
59 while ((evTimeRoot = (TRecEvTime*)evTimeIter.Next())) {
60 double estime=evTimeRoot->estime();
61 int status=evTimeRoot->status();
62 double quality=evTimeRoot->quality();
63 //double estime=evTimeRoot->getTest();
64 //int status=evTimeRoot->getStat();
65
66 RecEsTime *evTimeTds = new RecEsTime();
67 m_common.m_rootRecEvTimeMap[evTimeRoot] = evTimeTds;
68 evTimeTds->setTest( estime );
69 evTimeTds->setStat( status );
70 evTimeTds->setQuality( quality );
71 evTimeTdsCol->push_back(evTimeTds);
72 }
73 delete m_recEvTimeCol;
74 m_recEvTimeCol = 0;
75
76 return StatusCode::SUCCESS;
77}
void setStat(int Stat)
Definition: RecEsTime.h:37
void setTest(double Test)
Definition: RecEsTime.h:36
void setQuality(double Quality)
Definition: RecEsTime.h:38
Double_t estime() const
Definition: TRecEvTime.h:26
Int_t status() const
Definition: TRecEvTime.h:25
Double_t quality() const
Definition: TRecEvTime.h:27
static std::map< const TObject *, const RecEsTime * > m_rootRecEvTimeMap
Definition: commonData.h:248

Friends And Related Function Documentation

◆ CnvFactory< RecEvTimeCnv >

friend class CnvFactory< RecEvTimeCnv >
friend

Definition at line 9 of file RecEvTimeCnv.h.


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