CbmRoot
CbmDigitizeBase.cxx
Go to the documentation of this file.
1 
5 #include "CbmDigitizeBase.h"
6 
7 #include <FairEventHeader.h> // for FairEventHeader
8 #include <FairRootManager.h> // for FairRootManager
9 #include <FairRunAna.h> // for FairRunAna
10 #include <FairTask.h> // for FairTask
11 
12 #include <TGenericClassInfo.h> // for TGenericClassInfo
13 
14 #include <cassert> // for assert
15 
16 // ----- Default constructor --------------------------------------------
18  : FairTask("Digitizer")
19  , fEventMode(kFALSE)
20  , fProduceNoise(kTRUE)
21  , fCreateMatches(kTRUE)
22  , fCurrentInput(-1)
23  , fCurrentEvent(-1)
24  , fCurrentMCEntry(-1)
25  , fCurrentEventTime(0.) {}
26 // --------------------------------------------------------------------------
27 
28 
29 // ----- Default constructor --------------------------------------------
31  : FairTask(name)
32  , fEventMode(kFALSE)
33  , fProduceNoise(kTRUE)
34  , fCreateMatches(kTRUE)
35  , fCurrentInput(-1)
36  , fCurrentEvent(-1)
37  , fCurrentMCEntry(-1)
38  , fCurrentEventTime(0.) {}
39 // --------------------------------------------------------------------------
40 
41 
42 // ----- Destructor -----------------------------------------------------
44 // --------------------------------------------------------------------------
45 
46 
47 // ----- Get event information ------------------------------------------
49 
50  // --- The event number is taken from the FairRootManager
51  fCurrentEvent = FairRootManager::Instance()->GetEntryNr();
52 
53  if (FairRunAna::Instance()) {
54  FairEventHeader* event = FairRunAna::Instance()->GetEventHeader();
55  assert(event);
56  fCurrentInput = event->GetInputFileId();
57  fCurrentMCEntry = event->GetMCEntryNumber();
58  fCurrentEventTime = event->GetEventTime();
59  } //? FairRunAna
60  else { // no FairRunAna
61  fCurrentInput = -1;
62  fCurrentMCEntry = -1;
63  fCurrentEventTime = 0.;
64  } //? not FairRunAna
65 }
66 // --------------------------------------------------------------------------
67 
68 
CbmDigitizeBase.h
CbmDigitizeBase::GetEventInfo
void GetEventInfo()
Get event information.
Definition: CbmDigitizeBase.cxx:48
CbmDigitizeBase::fCurrentMCEntry
Int_t fCurrentMCEntry
Number of current MC event.
Definition: CbmDigitizeBase.h:164
CbmDigitizeBase::~CbmDigitizeBase
virtual ~CbmDigitizeBase()
Destructor.
Definition: CbmDigitizeBase.cxx:43
fCurrentMCEntry
Int_t fCurrentMCEntry
Definition: CbmTofDigitize.cxx:82
CbmDigitizeBase::CbmDigitizeBase
CbmDigitizeBase()
Constructor.
Definition: CbmDigitizeBase.cxx:17
CbmDigitizeBase::fCurrentEvent
Int_t fCurrentEvent
Number of current input.
Definition: CbmDigitizeBase.h:163
CbmDigitizeBase::fCurrentInput
Int_t fCurrentInput
Flag for creation of links to MC.
Definition: CbmDigitizeBase.h:162
ClassImp
ClassImp(CbmConverterManager) InitStatus CbmConverterManager
Definition: CbmConverterManager.cxx:12
CbmDigitizeBase::fCurrentEventTime
Double_t fCurrentEventTime
Number of current MC entry.
Definition: CbmDigitizeBase.h:165
CbmDigitizeBase
Abstract base class for CBM digitisation tasks.
Definition: CbmDigitizeBase.h:26