4#include "GaudiKernel/MsgStream.h"
5#include "GaudiKernel/DataObject.h"
7#include "TClonesArray.h"
9#include "EventModel/EventModel.h"
10#include "Identifier/HltID.h"
11#include "HltEvent/HltEvent.h"
12#include "HltEvent/HltInf.h"
13#include "RootEventData/THltEvent.h"
14#include "RootEventData/THltInf.h"
15#include "RootCnvSvc/Hlt/HltCnv.h"
16#include "RootCnvSvc/Hlt/HltInfCnv.h"
17#include "RootCnvSvc/RootAddress.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)&0XFF;
68 uint32_t ncgem= nsub>>32;
77 std::vector<Int_t> mdcRoot=m_hltInf->
getMdcData();
78 if(mdcRoot.size()!=nmdc) {
81 std::vector<Int_t>::iterator it=mdcRoot.begin();
82 for(;it!=mdcRoot.end();it++){
86 std::vector<Int_t> cgemRoot=m_hltInf->
getCgemData();
87 if(cgemRoot.size()!=ncgem) {
91 for(;it!=cgemRoot.end();it++){
95 std::vector<Int_t> tofRoot=m_hltInf->
getTofData();
96 if(tofRoot.size()!=ntof) {
100 for(;it!=tofRoot.end();it++){
104 std::vector<Int_t> emcRoot=m_hltInf->
getEmcData();
105 if(emcRoot.size()!=nemc) {
109 for(;it!=emcRoot.end();it++){
113 std::vector<Int_t> mucRoot=m_hltInf->
getMucData();
114 if(mucRoot.size()!=nmuc) {
118 for(;it!=mucRoot.end();it++){
122 std::vector<Int_t> conRoot=m_hltInf->
getConData();
123 if(conRoot.size()!=ncon) {
127 for(;it!=conRoot.end();it++){
143 return StatusCode::SUCCESS;
148 MsgStream log(
msgSvc(),
"HltInfCnv");
149 log << MSG::DEBUG <<
"HltInfCnv::DataObjectToTObject" << endreq;
150 StatusCode sc=StatusCode::SUCCESS;
154 log << MSG::ERROR <<
"Could not downcast to HltInf" << endreq;
155 return StatusCode::FAILURE;
161 log << MSG::ERROR <<
"Could not get HltInf in TDS " << endreq;
162 return StatusCode::FAILURE;
167 log << MSG::ERROR <<
"HltInfCnv:Could not downcast to TDS HltInf" << endreq;
170 IOpaqueAddress *addr;
175 const TObject *tHltInf = hltInf->
getHltInf();
176 if (!tHltInf)
return sc;
185 Int_t ncon = hltInfCnvTds->
getNCON();
199 std::vector<Int_t> mdcRoot;
200 std::vector<uint32_t>::iterator it= mdcTds.begin();
201 for(;it!=mdcTds.end();it++){
203 mdcRoot.push_back(
data);
208 std::vector<Int_t> cgemRoot;
210 for(;it!=cgemTds.end();it++){
212 cgemRoot.push_back(
data);
217 std::vector<Int_t> tofRoot;
218 for(it= tofTds.begin();it!=tofTds.end();it++){
220 tofRoot.push_back(
data);
225 std::vector<Int_t> emcRoot;
226 for(it= emcTds.begin();it!=emcTds.end();it++){
228 emcRoot.push_back(
data);
233 std::vector<Int_t> mucRoot;
234 for(it= mucTds.begin();it!=mucTds.end();it++){
236 mucRoot.push_back(
data);
241 std::vector<Int_t> conRoot;
242 for(it= conTds.begin();it!=conTds.end();it++){
244 conRoot.push_back(
data);
250 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_CGEM_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)
virtual void push_cgem(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.
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)
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)
vector< Int_t > getCgemData() const
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 setCgemData(const vector< Int_t > &vec)
void setEmcData(const vector< Int_t > &vec)
Int_t getAlgProcess() const
void setConData(const vector< Int_t > &vec)
_EXTERN_ std::string Event