BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
DstHltMaker Class Reference

#include <DstHltMaker.h>

Inheritance diagram for DstHltMaker:

Public Member Functions

 DstHltMaker (const std::string &name, ISvcLocator *pSvcLocator)
StatusCode initialize ()
StatusCode execute ()
StatusCode finalize ()

Detailed Description

Definition at line 4 of file DstHltMaker.h.

Constructor & Destructor Documentation

◆ DstHltMaker()

DstHltMaker::DstHltMaker ( const std::string & name,
ISvcLocator * pSvcLocator )

Definition at line 22 of file DstHltMaker.cxx.

23 : Algorithm( name, pSvcLocator ) {
24 // Declare the properties
25 // declareProperty("FittingMethod", m_fittingMethod = 2);
26 // declareProperty("ConfigFile", m_configFile = "MDCConfig.xml");
27}

Referenced by DstHltMaker().

Member Function Documentation

◆ execute()

StatusCode DstHltMaker::execute ( )

Definition at line 41 of file DstHltMaker.cxx.

41 {
42
43 MsgStream log( msgSvc(), name() );
44 log << MSG::INFO << "in execute()" << endmsg;
45
46 // Part 1: Get the event header, print out event and run number
47
48 SmartDataPtr<Event::EventHeader> eventHeader( eventSvc(), "/Event/EventHeader" );
49 if ( !eventHeader )
50 {
51 log << MSG::FATAL << "Could not find Event Header" << endmsg;
52 return ( StatusCode::FAILURE );
53 }
54
55 int eventId = eventHeader->eventNumber();
56 int runId = eventHeader->runNumber();
57 log << MSG::INFO << "DstHltMaker: retrieved event: "
58 << " Event Number " << eventId << " run: " << runId << endmsg;
59
60 StatusCode sc = StatusCode::SUCCESS;
61
62 // register ReconEvent Data Object to TDS; 2005/09/14
63 // HltEvent* hltEvt = new HltEvent();
64 // sc = eventSvc()->registerObject(EventModel::Hlt::Event, hltEvt);
65
66 // Part 2: Retrieve
67 DstHltInf* dstHltInf = new DstHltInf();
68 SmartDataPtr<HltInf> recHltInf( eventSvc(), "/Event/Hlt/HltInf" );
69 // SmartDataPtr<DstHltInf> recHltInf(eventSvc(),"/Event/Hlt/DstHltInf");
70 if ( !recHltInf )
71 {
72 log << MSG::DEBUG << "Could not find HltInf" << endmsg;
73 // return StatusCode::SUCCESS;
74 }
75 else
76 {
77 dstHltInf->setEventType( recHltInf->getEventType() );
78 dstHltInf->setAlgProcess( recHltInf->getAlgProcess() );
79 dstHltInf->setCriteriaTable( recHltInf->getCriteriaTable() );
80 dstHltInf->setVersion( recHltInf->getVersion() );
81 dstHltInf->setTotalEnergy( recHltInf->getTotalEnergy() );
82 dstHltInf->setNumber( recHltInf->getNumber() );
83 dstHltInf->setNCON( recHltInf->getNCON() );
84 m_ntot++;
85 }
86 DataObject* aDstHltInfEvent;
87 eventSvc()->findObject( "/Event/Hlt/DstHltInf", aDstHltInfEvent );
88 if ( aDstHltInfEvent != NULL )
89 {
90 SmartDataPtr<DstHltInf> hltInf( eventSvc(), "/Event/Hlt/DstHltInf" );
91 log << MSG::DEBUG << "old type=" << hltInf->getEventType()
92 << ", alg=" << hltInf->getAlgProcess() << ", criteria=" << hltInf->getCriteriaTable()
93 << ", version=" << hltInf->getVersion() << ", energy=" << hltInf->getTotalEnergy()
94 << endmsg;
95 // then unregister DstHltInf
96 sc = eventSvc()->unregisterObject( "/Event/Hlt/DstHltInf" );
97 delete aDstHltInfEvent; // it must be delete to avoid memory leakage
98 log << MSG::INFO << "Old DstHltInf has been unregistered" << endmsg;
99 if ( sc != StatusCode::SUCCESS )
100 {
101 log << MSG::FATAL << "Could not unregister DstHltInf" << endmsg;
102 return ( StatusCode::FAILURE );
103 }
104 }
105 sc = eventSvc()->registerObject( EventModel::Hlt::DstHltInf, dstHltInf );
106
107 log << MSG::DEBUG << "Event No." << eventId << " = " << dstHltInf->getEventType() << " "
108 << dstHltInf->getAlgProcess() << " " << dstHltInf->getCriteriaTable() << " "
109 << dstHltInf->getVersion() << " " << dstHltInf->getTotalEnergy() << endmsg;
110
111 return sc;
112}
IMessageSvc * msgSvc()
void setAlgProcess(const unsigned int i)
void setCriteriaTable(const unsigned int i)
void setNumber(const unsigned int i)
void setNCON(const unsigned int i)
void setEventType(const unsigned int i)
void setTotalEnergy(const float etot)
void setVersion(const unsigned int i)

◆ finalize()

StatusCode DstHltMaker::finalize ( )

Definition at line 115 of file DstHltMaker.cxx.

115 {
116
117 MsgStream log( msgSvc(), name() );
118 log << MSG::DEBUG << "==> Finalize DstHltMaker" << endmsg;
119 log << MSG::ALWAYS << m_ntot << " events are converted." << endmsg;
120
121 return StatusCode::SUCCESS;
122}

◆ initialize()

StatusCode DstHltMaker::initialize ( )

Definition at line 30 of file DstHltMaker.cxx.

30 {
31
32 MsgStream log( msgSvc(), name() );
33 log << MSG::INFO << "in initialize()" << endmsg;
34
35 m_ntot = 0;
36
37 return StatusCode::SUCCESS;
38}

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