er  dev
ERDecayer.cxx
1 #include "ERDecayer.h"
2 
3 #include<iostream>
4 
5 using namespace std;
6 
7 ERDecayer::ERDecayer(){
8 }
9 
10 ERDecayer::~ERDecayer(){
11 }
12 
13 Bool_t ERDecayer::Stepping(){
14  for (vector<ERDecay*>::iterator it = fDecays.begin(); it != fDecays.end(); ++it){
15  ERDecay* decay = (*it);
16  if (!decay->Stepping())
17  return kFALSE;
18  }
19  return kTRUE;
20 }
21 
22 Bool_t ERDecayer::Init(){
23  for (vector<ERDecay*>::iterator it = fDecays.begin(); it != fDecays.end(); ++it){
24  ERDecay* decay = (*it);
25  cout << "Decay " << decay->GetName() << " initialized!" << endl;
26  if (!decay->Init())
27  return kFALSE;
28  }
29  return kTRUE;
30 }
31 
32 void ERDecayer::BeginEvent(){
33  for (vector<ERDecay*>::iterator it = fDecays.begin(); it != fDecays.end(); ++it){
34  ERDecay* decay = (*it);
35  decay->BeginEvent();
36  }
37 }
38 
39 void ERDecayer::FinishEvent(){
40  for (vector<ERDecay*>::iterator it = fDecays.begin(); it != fDecays.end(); ++it){
41  ERDecay* decay = (*it);
42  decay->FinishEvent();
43  }
44 }
45 
46 void ERDecayer::AddDecay(ERDecay* decay) {
47  cout << "Decay " << decay->GetName() << " added!" << endl;
48  fDecays.push_back(decay);
49 }
50 
51 ClassImp(ERDecayer)