BOSS 8.0.0
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.

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

Referenced by MdcDummy().

Member Function Documentation

◆ execute()

StatusCode MdcDummy::execute ( )

Definition at line 45 of file MdcDummy.cxx.

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

◆ finalize()

StatusCode MdcDummy::finalize ( )

Definition at line 131 of file MdcDummy.cxx.

131 {
132
133 MsgStream log( msgSvc(), name() );
134 log << MSG::INFO << "in finalize()" << endmsg;
135
136 return StatusCode::SUCCESS;
137}

◆ initialize()

StatusCode MdcDummy::initialize ( )

Definition at line 36 of file MdcDummy.cxx.

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

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