4#include "GaudiKernel/MsgStream.h"
5#include "GaudiKernel/DataObject.h"
7#include "TClonesArray.h"
28 MsgStream log(
msgSvc(),
"HltInfCnv");
39 MsgStream log(
msgSvc(),
"HltInfCnv");
40 log << MSG::DEBUG <<
"HltInfCnv::TObjectToDataObject" << endreq;
41 StatusCode sc=StatusCode::SUCCESS;
48 if(!m_hltInf)
return sc;
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;
75 std::vector<Int_t> mdcRoot=m_hltInf->
getMdcData();
76 if(mdcRoot.size()!=nmdc) {
79 std::vector<Int_t>::iterator it=mdcRoot.begin();
80 for(;it!=mdcRoot.end();it++){
84 std::vector<Int_t> tofRoot=m_hltInf->
getTofData();
85 if(tofRoot.size()!=ntof) {
89 for(;it!=tofRoot.end();it++){
93 std::vector<Int_t> emcRoot=m_hltInf->
getEmcData();
94 if(emcRoot.size()!=nemc) {
98 for(;it!=emcRoot.end();it++){
102 std::vector<Int_t> mucRoot=m_hltInf->
getMucData();
103 if(mucRoot.size()!=nmuc) {
107 for(;it!=mucRoot.end();it++){
111 std::vector<Int_t> conRoot=m_hltInf->
getConData();
112 if(conRoot.size()!=ncon) {
116 for(;it!=conRoot.end();it++){
132 return StatusCode::SUCCESS;
137 MsgStream log(
msgSvc(),
"HltInfCnv");
138 log << MSG::DEBUG <<
"HltInfCnv::DataObjectToTObject" << endreq;
139 StatusCode sc=StatusCode::SUCCESS;
143 log << MSG::ERROR <<
"Could not downcast to HltInf" << endreq;
144 return StatusCode::FAILURE;
150 log << MSG::ERROR <<
"Could not get HltInf in TDS " << endreq;
151 return StatusCode::FAILURE;
156 log << MSG::ERROR <<
"HltInfCnv:Could not downcast to TDS HltInf" << endreq;
159 IOpaqueAddress *addr;
164 const TObject *tHltInf = hltInf->
getHltInf();
165 if (!tHltInf)
return sc;
174 Int_t ncon = hltInfCnvTds->
getNCON();
188 std::vector<Int_t> mdcRoot;
189 std::vector<uint32_t>::iterator it= mdcTds.begin();
190 for(;it!=mdcTds.end();it++){
192 mdcRoot.push_back(
data);
197 std::vector<Int_t> tofRoot;
198 for(it= tofTds.begin();it!=tofTds.end();it++){
200 tofRoot.push_back(
data);
205 std::vector<Int_t> emcRoot;
206 for(it= emcTds.begin();it!=emcTds.end();it++){
208 emcRoot.push_back(
data);
213 std::vector<Int_t> mucRoot;
214 for(it= mucTds.begin();it!=mucTds.end();it++){
216 mucRoot.push_back(
data);
221 std::vector<Int_t> conRoot;
222 for(it= conTds.begin();it!=conTds.end();it++){
224 conRoot.push_back(
data);
230 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 THltEvent * getWriteObject()
returns object to be written (maintained here for all DIGI-converters)
static unsigned int getID_MUC_MAX()
static unsigned int getID_EMC_MAX()
static unsigned int getID_MDC_MAX()
static unsigned int getID_TOF_MAX()
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.
Base class for all Root Converters.
std::vector< void * > m_adresses
each converter knows the corresponding adresses
IDataProviderSvc * m_eds
pointer to eventdataservice
std::string m_rootBranchname
root branchname (may be concatenated of severals)
virtual StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress)
Convert the transient object to the requested representation.
void addHltInf(THltInf *hltInf)
const THltInf * getHltInf() const
void setTotalEnergy(const Double_t etot)
vector< Int_t > getMucData() const
Int_t getCriteriaTable() const
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)
Int_t getEventType() const
Double_t getTotalEnergy() const
void setTofData(const vector< Int_t > &vec)
vector< Int_t > getEmcData() const
vector< Int_t > getMdcData() const
vector< Int_t > getTofData() const
vector< Int_t > getConData() const
void setEmcData(const vector< Int_t > &vec)
Int_t getAlgProcess() const
void setConData(const vector< Int_t > &vec)
_EXTERN_ std::string Event