GGS(GenericGEANT4Simulation)Software  2.7.0
 All Data Structures Namespaces Files Functions Variables Typedefs Macros
GGSTMCTruthReader.cpp
Go to the documentation of this file.
1 /*
2  * GGSTMCTruthReader.cpp
3  *
4  * Created on: 25 Aug 2011
5  * Author: Nicola Mori
6  */
7 
11 
12 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
13 
14 GGSTMCTruthReader::GGSTMCTruthReader() : _mcTruthInfo(NULL), _mcTruthChain(NULL) {}
15 
16 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
17 
18 GGSTMCTruthReader::~GGSTMCTruthReader() { delete _mcTruthInfo; }
19 
20 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
21 
22 bool GGSTMCTruthReader::SetChain(TChain *mcTruthChain) {
23 
24  _mcTruthChain = mcTruthChain;
25  if (_mcTruthChain->SetBranchAddress("mcTruthInfo", &_mcTruthInfo) == 0) {
26  return true;
27  } else
28  return false;
29 }
30 
31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
32 
33 void GGSTMCTruthReader::GetEntry(Long64_t entry) {
34  if (entry != _mcTruthChain->GetEntries()) {
35  _mcTruthChain->GetEntry(entry);
36  }
37 }
void GetEntry(Long64_t entry)
~GGSTMCTruthReader()
Destructor.
bool SetChain(TChain *mcTruthChain)
Sets the chain.
GGSTMCTruthReader()
Constructor.