4#include "GaudiKernel/DataObject.h"
5#include "GaudiKernel/MsgStream.h"
7#include "TClonesArray.h"
9#include "EventModel/EventModel.h"
10#include "HltEvent/HltEvent.h"
11#include "HltEvent/HltInf.h"
12#include "Identifier/HltID.h"
13#include "RootCnvSvc/Hlt/HltCnv.h"
14#include "RootCnvSvc/Hlt/HltInfCnv.h"
15#include "RootCnvSvc/RootAddress.h"
16#include "RootEventData/THltEvent.h"
17#include "RootEventData/THltInf.h"
24 MsgStream log(
msgSvc(),
"HltInfCnv" );
35 MsgStream log(
msgSvc(),
"HltInfCnv" );
36 log << MSG::DEBUG <<
"HltInfCnv::TObjectToDataObject" << endmsg;
37 StatusCode sc = StatusCode::SUCCESS;
41 refpObject = hltInfTds;
44 if ( !m_hltInf )
return sc;
47 int alg = m_hltInf->getAlgProcess();
48 int cri = m_hltInf->getCriteriaTable();
49 int ver = m_hltInf->getVersion();
50 float etot = m_hltInf->getTotalEnergy();
59 uint32_t nsub = m_hltInf->getNumber();
60 uint32_t ncon = m_hltInf->getNCON();
61 uint32_t nmdc = nsub & 0XFF;
62 uint32_t ntof = ( nsub >> 8 ) & 0XFF;
63 uint32_t nemc = ( nsub >> 16 ) & 0XFF;
64 uint32_t nmuc = nsub >> 24;
67 {
throw exception(); }
71 std::vector<Int_t> mdcRoot = m_hltInf->getMdcData();
72 if ( mdcRoot.size() != nmdc ) {
throw exception(); }
73 std::vector<Int_t>::iterator it = mdcRoot.begin();
74 for ( ; it != mdcRoot.end(); it++ )
79 std::vector<Int_t> tofRoot = m_hltInf->getTofData();
80 if ( tofRoot.size() != ntof ) {
throw exception(); }
82 for ( ; it != tofRoot.end(); it++ )
87 std::vector<Int_t> emcRoot = m_hltInf->getEmcData();
88 if ( emcRoot.size() != nemc ) {
throw exception(); }
90 for ( ; it != emcRoot.end(); it++ )
95 std::vector<Int_t> mucRoot = m_hltInf->getMucData();
96 if ( mucRoot.size() != nmuc ) {
throw exception(); }
98 for ( ; it != mucRoot.end(); it++ )
103 std::vector<Int_t> conRoot = m_hltInf->getConData();
104 if ( conRoot.size() != ncon ) {
throw exception(); }
105 it = conRoot.begin();
106 for ( ; it != conRoot.end(); it++ )
123 return StatusCode::SUCCESS;
128 MsgStream log(
msgSvc(),
"HltInfCnv" );
129 log << MSG::DEBUG <<
"HltInfCnv::DataObjectToTObject" << endmsg;
130 StatusCode sc = StatusCode::SUCCESS;
135 log << MSG::ERROR <<
"Could not downcast to HltInf" << endmsg;
136 return StatusCode::FAILURE;
143 log << MSG::ERROR <<
"Could not get HltInf in TDS " << endmsg;
144 return StatusCode::FAILURE;
149 { log << MSG::ERROR <<
"HltInfCnv:Could not downcast to TDS HltInf" << endmsg; }
151 IOpaqueAddress* addr;
152 m_cnvSvc->getHltCnv()->createRep( evt, addr );
156 const TObject* tHltInf = hltInf->
getHltInf();
157 if ( !tHltInf )
return sc;
166 Int_t ncon = hltInfCnvTds->
getNCON();
179 std::vector<Int_t> mdcRoot;
180 std::vector<uint32_t>::iterator it = mdcTds.begin();
181 for ( ; it != mdcTds.end(); it++ )
184 mdcRoot.push_back(
data );
189 std::vector<Int_t> tofRoot;
190 for ( it = tofTds.begin(); it != tofTds.end(); it++ )
193 tofRoot.push_back(
data );
198 std::vector<Int_t> emcRoot;
199 for ( it = emcTds.begin(); it != emcTds.end(); it++ )
202 emcRoot.push_back(
data );
207 std::vector<Int_t> mucRoot;
208 for ( it = mucTds.begin(); it != mucTds.end(); it++ )
211 mucRoot.push_back(
data );
216 std::vector<Int_t> conRoot;
217 for ( it = conTds.begin(); it != conTds.end(); it++ )
220 conRoot.push_back(
data );
226 return StatusCode::SUCCESS;
void setAlgProcess(const unsigned int i)
void setCriteriaTable(const unsigned int i)
float getTotalEnergy() const
uint32_t getCriteriaTable() const
void setNumber(const unsigned int i)
void setNCON(const unsigned int i)
uint32_t getVersion() const
uint32_t getNumber() const
uint32_t getEventType() const
uint32_t getAlgProcess() const
void setEventType(const unsigned int i)
void setTotalEnergy(const float etot)
void setVersion(const unsigned int i)
static unsigned int getID_MUC_MAX()
static unsigned int getID_EMC_MAX()
static unsigned int getID_MDC_MAX()
static unsigned int getID_TOF_MAX()
static const CLID & classID()
HltInfCnv(ISvcLocator *svc)
virtual StatusCode TObjectToDataObject(DataObject *&obj)
transformation from root
virtual StatusCode DataObjectToTObject(DataObject *obj, RootAddress *addr)
transformation to root
virtual void push_muc(uint32_t data)
virtual void push_mdc(uint32_t data)
std::vector< uint32_t > & getDataVec(const Identifier &)
virtual void push_tof(uint32_t data)
virtual void push_con(uint32_t data)
virtual void push_emc(uint32_t data)
Definition of a Root address, derived from IOpaqueAddress.
IDataProviderSvc * m_eds
pointer to eventdataservice
std::vector< void * > m_adresses
each converter knows the corresponding adresses
std::string m_rootBranchname
root branchname (may be concatenated of severals)
RootEventBaseCnv(const CLID &clid, ISvcLocator *svc)
void addHltInf(THltInf *hltInf)
const THltInf * getHltInf() const
void setTotalEnergy(const Double_t etot)
void setVersion(const Int_t i)
void setNCON(const Int_t i)
void setNumber(const Int_t i)
void setEventType(const Int_t i)
void setCriteriaTable(const Int_t i)
void setAlgProcess(const Int_t i)
void setMucData(const vector< Int_t > &vec)
void setMdcData(const vector< Int_t > &vec)
void setTofData(const vector< Int_t > &vec)
void setEmcData(const vector< Int_t > &vec)
void setConData(const vector< Int_t > &vec)
_EXTERN_ std::string Event