BOSS 7.0.6
BESIII Offline Software System
Loading...
Searching...
No Matches
MdcDummy Class Reference

#include <MdcDummy.h>

+ Inheritance diagram for MdcDummy:

Public Member Functions

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

Detailed Description

Definition at line 4 of file MdcDummy.h.

Constructor & Destructor Documentation

◆ MdcDummy()

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

Definition at line 28 of file MdcDummy.cxx.

28 :
29 Algorithm(name, pSvcLocator)
30{
31 // Declare the properties
32 declareProperty("FittingMethod", m_fittingMethod = 2);
33 declareProperty("ConfigFile", m_configFile = "MDCConfig.xml");
34}

Member Function Documentation

◆ execute()

StatusCode MdcDummy::execute ( )

Definition at line 47 of file MdcDummy.cxx.

47 {
48
49 MsgStream log(msgSvc(), name());
50 log << MSG::INFO << "in execute()" << endreq;
51
52 // Part 1: Get the event header, print out event and run number
53 int event, run;
54
55 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),"/Event/EventHeader");
56 if (!eventHeader) {
57 log << MSG::FATAL << "Could not find Event Header" << endreq;
58 return( StatusCode::FAILURE);
59 }
60 log << MSG::INFO << "MdcDummy: retrieved event: " << eventHeader->eventNumber() << " run: " << eventHeader->runNumber() << endreq;
61
62 int digiId;
63
64 //Part 2: Retrieve MC truth
65 SmartDataPtr<DecayMode> decayMode(eventSvc(),"/Event/MC/DecayMode");
66 if (!decayMode) {
67 log << MSG::FATAL << "Could not find DecayMode" << endreq;
68 return( StatusCode::FAILURE);
69 }
70 unsigned int size = 10;
71 int decayId[10];
72 decayMode->getData(decayId, size);
73
74 for (unsigned int index =0; index<10; index++) {
75 log << MSG::INFO
76 << " Decay Mode = " << decayId[index]
77 << endreq;
78 }
79
80 //Part 3: Retrieve MDC digi
81 SmartDataPtr<MdcDigiCol> mdcDigiCol(eventSvc(),"/Event/Digi/MdcDigiCol");
82 if (!mdcDigiCol) {
83 log << MSG::FATAL << "Could not find MDC digi" << endreq;
84 return( StatusCode::FAILURE);
85 }
86
87 MdcDigiCol::iterator iter1 = mdcDigiCol->begin();
88 digiId = 0;
89 for (;iter1 != mdcDigiCol->end(); iter1++, digiId++) {
90 log << MSG::INFO << "MDC digit No: " << digiId << endreq;
91
92 log << MSG::INFO
93 << " time_channel = " << (*iter1)->getTimeChannel()
94 << " charge_channel = " << (*iter1)->getChargeChannel()
95 << endreq;
96 }
97
98
99 //Part 4: Retrieve TOF digi
100 SmartDataPtr<TofDigiCol> tofDigiCol(eventSvc(),"/Event/Digi/TofDigiCol");
101 if (!tofDigiCol) {
102 log << MSG::FATAL << "Could not find TOF digi" << endreq;
103 return( StatusCode::FAILURE);
104 }
105
106 TofDigiCol::iterator iter2 = tofDigiCol->begin();
107 digiId = 0;
108 for (;iter2 != tofDigiCol->end(); iter2++, digiId++) {
109 log << MSG::INFO << "TOF digit No: " << digiId << endreq;
110
111 }
112
113 //Part 5: Retrieve EMC digi
114 SmartDataPtr<EmcDigiCol> emcDigiCol(eventSvc(),"/Event/Digi/EmcDigiCol");
115 if (!emcDigiCol) {
116 log << MSG::FATAL << "Could not find EMC digi" << endreq;
117 return( StatusCode::FAILURE);
118 }
119
120 EmcDigiCol::iterator iter3 = emcDigiCol->begin();
121 digiId = 0;
122 for (;iter3 != emcDigiCol->end(); iter3++, digiId++) {
123 log << MSG::INFO << "Emc digit No: " << digiId << endreq;
124
125 log << MSG::INFO
126 << " time_channel = " << (*iter3)->getTimeChannel()
127 << " charge_channel = " << (*iter3)->getChargeChannel()
128 << endreq;
129 }
130
131
132 return StatusCode::SUCCESS;
133}
IMessageSvc * msgSvc()

◆ finalize()

StatusCode MdcDummy::finalize ( )

Definition at line 136 of file MdcDummy.cxx.

136 {
137
138 MsgStream log(msgSvc(), name());
139 log << MSG::INFO << "in finalize()" << endreq;
140
141 return StatusCode::SUCCESS;
142}

◆ initialize()

StatusCode MdcDummy::initialize ( )

Definition at line 37 of file MdcDummy.cxx.

37 {
38
39 MsgStream log(msgSvc(), name());
40 log << MSG::INFO << "in initialize()" << endreq;
41
42
43 return StatusCode::SUCCESS;
44}

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