BOSS 7.0.9
BESIII Offline Software System
Loading...
Searching...
No Matches
BesTDSWriter Class Reference

#include <BesTDSWriter.hh>

Public Member Functions

 BesTDSWriter ()
 
 ~BesTDSWriter ()
 
void SaveAll (const G4Event *, int)
 

Detailed Description

Definition at line 21 of file BesTDSWriter.hh.

Constructor & Destructor Documentation

◆ BesTDSWriter()

BesTDSWriter::BesTDSWriter ( )

Definition at line 22 of file BesTDSWriter.cc.

23{
24 m_rawWriter = new BesRawDataWriter;
25 m_mcWriter = new BesMcTruthWriter;
26}

◆ ~BesTDSWriter()

BesTDSWriter::~BesTDSWriter ( )

Definition at line 28 of file BesTDSWriter.cc.

29{
30 if(m_rawWriter)
31 delete m_rawWriter;
32 if(m_mcWriter)
33 delete m_mcWriter;
34}

Member Function Documentation

◆ SaveAll()

void BesTDSWriter::SaveAll ( const G4Event *  evt,
int  runNumber 
)

Definition at line 36 of file BesTDSWriter.cc.

37{
38 //interface to event data service
39 ISvcLocator* svcLocator = Gaudi::svcLocator();
40 IDataProviderSvc* evtSvc;
41 StatusCode sc=svcLocator->service("EventDataSvc", evtSvc);
42 if (sc.isFailure())
43 G4cout<<"Could not accesss EventDataSvc!"<<G4endl;
44
45 //save event head
46/*
47 SmartDataPtr<Event::EventHeader> eventHeader(evtSvc,"/Event/EventHeader");
48 if (!eventHeader) {
49 //G4cout<< "Could not find Event Header" << G4endl;
50 Event::EventHeader *eventHeader = new Event::EventHeader;
51 StatusCode sc = evtSvc->registerObject("/Event/EventHeader",eventHeader);
52 }
53 eventHeader->setEventNumber( evt->GetEventID() );
54 eventHeader->setRunNumber( runNumber );
55*/
56 //retrieve
57 SmartDataPtr<Event::EventHeader> aEventHeader(evtSvc,"/Event/EventHeader");
58 G4int run=aEventHeader->runNumber();
59 G4int event=aEventHeader->eventNumber();
60 //G4cout<<"BesTDSWriter: runNumber: "<<run<<" eventNumber:"<<event<<G4endl;
61
62
63 //save raw data
64 m_rawWriter->SaveDigits();
65
66 //save MC Truth
67 m_mcWriter->SaveMcTruth();
68
69}

Referenced by BesEventAction::EndOfEventAction().


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