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

Concrete converter for the HltInf. More...

#include <HltInfCnv.h>

+ Inheritance diagram for HltInfCnv:

Public Member Functions

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

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

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

Definition at line 20 of file Event/RootCnvSvc/bak_RootCnvSvc-04-01-14/RootCnvSvc/Hlt/HltInfCnv.h.

Constructor & Destructor Documentation

◆ ~HltInfCnv() [1/3]

virtual HltInfCnv::~HltInfCnv ( )
inlinevirtual

◆ HltInfCnv() [1/3]

HltInfCnv::HltInfCnv ( ISvcLocator *  svc)
protected

Definition at line 23 of file bak_RootCnvSvc-04-01-14/src/Hlt/HltInfCnv.cxx.

24 : RootEventBaseCnv(classID(), svc),
25 m_old(false)
26{
27 // Here we associate this converter with the /Event path on the TDS.
28 MsgStream log(msgSvc(), "HltInfCnv");
29 //log << MSG::DEBUG << "Constructor called for " << objType() << endreq;
30 m_rootBranchname ="m_hltInf";
31 //declareObject(EventModel::MC::HltInf, objType(), m_rootTreename, m_rootBranchname);
32 m_adresses.push_back(&m_hltInf);
33 m_hltInf=0;
34}
std::vector< void * > m_adresses
each converter knows the corresponding adresses
std::string m_rootBranchname
root branchname (may be concatenated of severals)

◆ ~HltInfCnv() [2/3]

virtual HltInfCnv::~HltInfCnv ( )
inlinevirtual

◆ HltInfCnv() [2/3]

HltInfCnv::HltInfCnv ( ISvcLocator *  svc)
protected

◆ ~HltInfCnv() [3/3]

virtual HltInfCnv::~HltInfCnv ( )
inlinevirtual

◆ HltInfCnv() [3/3]

HltInfCnv::HltInfCnv ( ISvcLocator *  svc)
protected

Member Function Documentation

◆ classID() [1/3]

static const CLID & HltInfCnv::classID ( )
inlinestatic

Definition at line 25 of file Event/RootCnvSvc/bak_RootCnvSvc-04-01-14/RootCnvSvc/Hlt/HltInfCnv.h.

26 {
27 return CLID_HltInf;
28 }
const CLID & CLID_HltInf
Definition: EventModel.cxx:330

◆ classID() [2/3]

static const CLID & HltInfCnv::classID ( )
inlinestatic

Definition at line 25 of file Event/RootCnvSvc/RootCnvSvc-04-01-15/RootCnvSvc/Hlt/HltInfCnv.h.

26 {
27 return CLID_HltInf;
28 }

◆ classID() [3/3]

static const CLID & HltInfCnv::classID ( )
inlinestatic

Definition at line 25 of file InstallArea/include/RootCnvSvc/RootCnvSvc/Hlt/HltInfCnv.h.

26 {
27 return CLID_HltInf;
28 }

◆ DataObjectToTObject() [1/3]

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

transformation to root

Implements RootEventBaseCnv.

Definition at line 146 of file bak_RootCnvSvc-04-01-14/src/Hlt/HltInfCnv.cxx.

146 {
147
148 MsgStream log(msgSvc(), "HltInfCnv");
149 log << MSG::DEBUG << "HltInfCnv::DataObjectToTObject" << endreq;
150 StatusCode sc=StatusCode::SUCCESS;
151
152 HltInf * hltInfCnvTds=dynamic_cast<HltInf*> (obj);
153 if (!hltInfCnvTds) {
154 log << MSG::ERROR << "Could not downcast to HltInf" << endreq;
155 return StatusCode::FAILURE;
156 }
157
158 DataObject *evt;
159 m_eds->findObject(EventModel::Hlt::Event,evt);
160 if (evt==NULL) {
161 log << MSG::ERROR << "Could not get HltInf in TDS " << endreq;
162 return StatusCode::FAILURE;
163 }
164
165 HltEvent * devtTds=dynamic_cast<HltEvent *> (evt);
166 if (!devtTds) {
167 log << MSG::ERROR << "HltInfCnv:Could not downcast to TDS HltInf" << endreq;
168 }
169
170 IOpaqueAddress *addr;
171 m_cnvSvc->getHltCnv()->createRep(evt,addr);
172
174
175 const TObject *tHltInf = hltInf->getHltInf();
176 if (!tHltInf) return sc;
177 hltInf->clearHltInf();
178
179 Int_t type = hltInfCnvTds->getEventType();
180 Int_t alg = hltInfCnvTds->getAlgProcess();
181 Int_t cri = hltInfCnvTds->getCriteriaTable();
182 Int_t ver = hltInfCnvTds->getVersion();
183 Double_t etot = hltInfCnvTds->getTotalEnergy();
184 Int_t nsub = hltInfCnvTds->getNumber();
185 Int_t ncon = hltInfCnvTds->getNCON();
186
187 THltInf *hltInfRoot = new THltInf();
188
189 hltInfRoot->setEventType(type);
190 hltInfRoot->setAlgProcess(alg);
191 hltInfRoot->setCriteriaTable(cri);
192 hltInfRoot->setVersion(ver);
193 hltInfRoot->setTotalEnergy(etot);
194 hltInfRoot->setNumber(nsub);
195 hltInfRoot->setNCON(ncon);
196
197
198 std::vector<uint32_t> mdcTds=hltInfCnvTds->getDataVec(HltID::MDC);
199 std::vector<Int_t> mdcRoot;
200 std::vector<uint32_t>::iterator it= mdcTds.begin();
201 for(;it!=mdcTds.end();it++){
202 Int_t data=*it;
203 mdcRoot.push_back(data);
204 }
205 hltInfRoot->setMdcData(mdcRoot);
206
207 std::vector<uint32_t> cgemTds=hltInfCnvTds->getDataVec(HltID::CGEM);
208 std::vector<Int_t> cgemRoot;
209 it= cgemTds.begin();
210 for(;it!=cgemTds.end();it++){
211 Int_t data=*it;
212 cgemRoot.push_back(data);
213 }
214 hltInfRoot->setCgemData(cgemRoot);
215
216 std::vector<uint32_t> tofTds=hltInfCnvTds->getDataVec(HltID::TOF);
217 std::vector<Int_t> tofRoot;
218 for(it= tofTds.begin();it!=tofTds.end();it++){
219 Int_t data=*it;
220 tofRoot.push_back(data);
221 }
222 hltInfRoot->setTofData(tofRoot);
223
224 std::vector<uint32_t> emcTds=hltInfCnvTds->getDataVec(HltID::EMC);
225 std::vector<Int_t> emcRoot;
226 for(it= emcTds.begin();it!=emcTds.end();it++){
227 Int_t data=*it;
228 emcRoot.push_back(data);
229 }
230 hltInfRoot->setEmcData(emcRoot);
231
232 std::vector<uint32_t> mucTds=hltInfCnvTds->getDataVec(HltID::MUC);
233 std::vector<Int_t> mucRoot;
234 for(it= mucTds.begin();it!=mucTds.end();it++){
235 Int_t data=*it;
236 mucRoot.push_back(data);
237 }
238 hltInfRoot->setMucData(mucRoot);
239
240 std::vector<uint32_t> conTds=hltInfCnvTds->getDataVec(HltID::CON);
241 std::vector<Int_t> conRoot;
242 for(it= conTds.begin();it!=conTds.end();it++){
243 Int_t data=*it;
244 conRoot.push_back(data);
245 }
246 hltInfRoot->setConData(conRoot);
247
248 hltInf->addHltInf(hltInfRoot);
249
250 return StatusCode::SUCCESS;
251}
TTree * data
Double_t etot
static THltEvent * getWriteObject()
returns object to be written (maintained here for all DIGI-converters)
std::vector< uint32_t > & getDataVec(const Identifier &)
Definition: HltInf.cxx:71
virtual StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress)
Convert the transient object to the requested representation.
const THltInf * getHltInf() const

◆ DataObjectToTObject() [2/3]

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

transformation to root

Implements RootEventBaseCnv.

◆ DataObjectToTObject() [3/3]

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

transformation to root

Implements RootEventBaseCnv.

◆ TObjectToDataObject() [1/3]

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

transformation from root

Implements RootEventBaseCnv.

Definition at line 36 of file bak_RootCnvSvc-04-01-14/src/Hlt/HltInfCnv.cxx.

36 {
37 // creation of TDS object from root object
38
39 MsgStream log(msgSvc(), "HltInfCnv");
40 log << MSG::DEBUG << "HltInfCnv::TObjectToDataObject" << endreq;
41 StatusCode sc=StatusCode::SUCCESS;
42
43 // create the TDS location for the trigger data
44 HltInf* hltInfTds = new HltInf;
45 refpObject=hltInfTds;
46
47 // now convert
48 if(!m_hltInf) return sc;
49
50 int evt = m_hltInf->getEventType();
51 int alg = m_hltInf->getAlgProcess();
52 int cri = m_hltInf->getCriteriaTable();
53 int ver = m_hltInf->getVersion();
54 float etot = m_hltInf->getTotalEnergy();
55 hltInfTds->setEventType(evt);
56 hltInfTds->setAlgProcess(alg);
57 hltInfTds->setCriteriaTable(cri);
58 hltInfTds->setVersion(ver);
59 hltInfTds->setTotalEnergy(etot);
60
61 try{
62 uint32_t nsub= m_hltInf->getNumber();
63 uint32_t ncon= m_hltInf->getNCON();
64 uint32_t nmdc= nsub &0XFF;
65 uint32_t ntof=(nsub>>8 )&0XFF;
66 uint32_t nemc=(nsub>>16)&0XFF;
67 uint32_t nmuc=(nsub>>24)&0XFF;
68 uint32_t ncgem= nsub>>32;
69 if(nmuc>HltID::getID_MUC_MAX()+1 || nemc>HltID::getID_EMC_MAX()+1
70 ||ntof>HltID::getID_TOF_MAX()+1 || nmdc>HltID::getID_MDC_MAX()+1
71 || ncgem>HltID::getID_CGEM_MAX()+1){
72 throw exception();
73 }
74 hltInfTds->setNumber(nsub);
75 hltInfTds->setNCON(ncon);
76
77 std::vector<Int_t> mdcRoot=m_hltInf->getMdcData();
78 if(mdcRoot.size()!=nmdc) {
79 throw exception();
80 }
81 std::vector<Int_t>::iterator it=mdcRoot.begin();
82 for(;it!=mdcRoot.end();it++){
83 uint32_t data=*it;
84 hltInfTds->push_mdc(data);
85 }
86 std::vector<Int_t> cgemRoot=m_hltInf->getCgemData();
87 if(cgemRoot.size()!=ncgem) {
88 throw exception();
89 }
90 it=cgemRoot.begin();
91 for(;it!=cgemRoot.end();it++){
92 uint32_t data=*it;
93 hltInfTds->push_cgem(data);
94 }
95 std::vector<Int_t> tofRoot=m_hltInf->getTofData();
96 if(tofRoot.size()!=ntof) {
97 throw exception();
98 }
99 it=tofRoot.begin();
100 for(;it!=tofRoot.end();it++){
101 uint32_t data=*it;
102 hltInfTds->push_tof(data);
103 }
104 std::vector<Int_t> emcRoot=m_hltInf->getEmcData();
105 if(emcRoot.size()!=nemc) {
106 throw exception();
107 }
108 it=emcRoot.begin();
109 for(;it!=emcRoot.end();it++){
110 uint32_t data=*it;
111 hltInfTds->push_emc(data);
112 }
113 std::vector<Int_t> mucRoot=m_hltInf->getMucData();
114 if(mucRoot.size()!=nmuc) {
115 throw exception();
116 }
117 it=mucRoot.begin();
118 for(;it!=mucRoot.end();it++){
119 uint32_t data=*it;
120 hltInfTds->push_muc(data);
121 }
122 std::vector<Int_t> conRoot=m_hltInf->getConData();
123 if(conRoot.size()!=ncon) {
124 throw exception();
125 }
126 it=conRoot.begin();
127 for(;it!=conRoot.end();it++){
128 uint32_t data=*it;
129 hltInfTds->push_con(data);
130 }
131 }
132 catch(...){
133 //log << MSG::ERROR << "***********************************************************" << endreq;
134 //log << MSG::ERROR << "Input ROOT object is older version, please reconstrut again" << endreq;
135 //log << MSG::ERROR << " or check out old RootCnvSvc! (mailto: [email protected])" << endreq;
136 //log << MSG::WARNING << "***** Continuing run may cause a little memory leakage ****" << endreq;
137 //m_old=true;
138 }
139
140 delete m_hltInf;
141 m_hltInf = 0;
142
143 return StatusCode::SUCCESS;
144}
virtual void push_muc(uint32_t data)
virtual void push_mdc(uint32_t data)
virtual void push_cgem(uint32_t data)
virtual void push_tof(uint32_t data)
virtual void push_con(uint32_t data)
virtual void push_emc(uint32_t data)

◆ TObjectToDataObject() [2/3]

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

transformation from root

Implements RootEventBaseCnv.

◆ TObjectToDataObject() [3/3]

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

transformation from root

Implements RootEventBaseCnv.

Friends And Related Function Documentation

◆ CnvFactory< HltInfCnv >


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