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

#include <DumpMC.h>

Inheritance diagram for DumpMC:

Public Member Functions

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

Detailed Description

Definition at line 5 of file DumpMC.h.

Constructor & Destructor Documentation

◆ DumpMC()

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

Definition at line 9 of file DumpMC.cxx.

10 : Algorithm( name, pSvcLocator ) {}

Member Function Documentation

◆ execute()

StatusCode DumpMC::execute ( )

Definition at line 29 of file DumpMC.cxx.

29 {
30
31 MsgStream log( msgSvc(), name() );
32 log << MSG::INFO << ">>> DumpMC from execute" << endmsg;
33 std::cout << "----- DumpMC World From execute" << std::endl;
34
35 // Read Data from Transient Store
36 // SmartDataPtr<McEventCollection> mcCollptr(eventDataService(),
37 // "/Event/McEventCollection");
38 // if(!mcCollptr) {
39 // std::cout << " No McCollptr" << std::endl;
40 // }
41 // else {
42 // std::cout << " ---- Begin Iterating Over McEventCollection --- " << std::endl;
43 // McEventCollection::iterator it;
44 // for(it=mcCollptr->begin(); it!=mcCollptr->end(); it++) {
45 // std::cout << "Next event in the bag" << std::endl;
46 // std::cout << " Generator: " << (*it)->generatorName() << std::endl;
47 // (*it)->pGenEvt()->print();
48 // }
49 // }
50
51 /*
52 const McEventCollection* mcCollptr;
53 if ( m_sgSvc->retrieve(mcCollptr).isFailure() ) {
54 log << MSG::ERROR << "Could not retrieve McEventCollection"
55 << endmsg;
56 return StatusCode::FAILURE;
57 }
58
59 // Loop over all events in McEventCollection
60 McEventCollection::const_iterator itr;
61 for (itr = mcCollptr->begin(); itr!=mcCollptr->end(); ++itr) {
62 std::cout << "Next event in the bag" << std::endl;
63 int g_id = (*itr)->signal_process_id();
64 GeneratorName_print(g_id);
65 std::cout << std::endl;
66 (*itr)->print();
67 }
68 */
69
70 // End of execution for each event
71 return StatusCode::SUCCESS;
72}
IMessageSvc * msgSvc()

◆ finalize()

StatusCode DumpMC::finalize ( )

Definition at line 73 of file DumpMC.cxx.

73 {
74
75 MsgStream log( msgSvc(), name() );
76 log << MSG::INFO << ">>> DumpMC from finalize" << endmsg;
77 std::cout << "----- DumpMC World From finalize" << std::endl;
78
79 // End of finalization step
80 return StatusCode::SUCCESS;
81}

◆ initialize()

StatusCode DumpMC::initialize ( )

Definition at line 12 of file DumpMC.cxx.

12 {
13
14 MsgStream log( msgSvc(), name() );
15 log << MSG::INFO << ">>> DumpMC from Initialize" << endmsg;
16 std::cout << "----- DumpMC World From initialize" << std::endl;
17
18 /*
19 StatusCode sc = service("StoreGateSvc", m_sgSvc);
20 if (sc.isFailure()) {
21 log << MSG::ERROR << "Could not find StoreGateSvc" << endmsg;
22 return sc;
23 }
24 */
25
26 // Initialization terminated
27 return StatusCode::SUCCESS;
28}

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