HighLAND
BeamBunching.hxx
1 #ifndef BeamBunching_h
2 #define BeamBunching_h
3 
4 #include "BaseDataClasses.hxx"
5 
6 class BeamBunching {
7 
8 public:
9 
10  BeamBunching(){_nbunches=0;}
11  BeamBunching(const std::string& filename){ReadBeamBunchStructure(filename);}
12 
13  virtual ~BeamBunching(){}
14 
15  /// Read the bunch structure for analysis usage.
16  void ReadBeamBunchStructure(const std::string& filename);
17 
18  /// Define the Bunch Period from the run number.
19  Int_t GetBunchPeriod(const AnaEventB& event);
20 
21  /// Get the central time for bunch ibunch
22  Float_t GetBunchCentralTime(const AnaEventB& event, Int_t ibunch);
23 
24  /// Number of bunches in the run period for the current run
25  UInt_t GetNBunches(const AnaEventB& event);
26 
27  /// The run number for a given time
28  Int_t GetBunch(Float_t tTrack, Int_t run, bool isMC, bool cosmic_mode, Float_t sigma = 15., Float_t NSigmas = 4.0 ) const;
29 
30 public:
31 
32  UInt_t _nbunches;
33 
34  std::vector<Float_t> bunch_time_mc; // Bunch times in MC
35  std::vector<std::vector<Float_t> > bunch_time_data; // Bunch times in Data
36  std::vector<std::pair<int,int> > bunchrunperiod; // Last run in Data period.
37 
38 };
39 
40 #endif
UInt_t GetNBunches(const AnaEventB &event)
Number of bunches in the run period for the current run.
Int_t GetBunchPeriod(const AnaEventB &event)
Define the Bunch Period from the run number.
Float_t GetBunchCentralTime(const AnaEventB &event, Int_t ibunch)
Get the central time for bunch ibunch.
void ReadBeamBunchStructure(const std::string &filename)
Read the bunch structure for analysis usage.
Definition: BeamBunching.cxx:8
Int_t GetBunch(Float_t tTrack, Int_t run, bool isMC, bool cosmic_mode, Float_t sigma=15., Float_t NSigmas=4.0) const
The run number for a given time.