er  dev
ERDigibuilder.h
1 #ifndef ERDigibuilder_H
2 #define ERDigibuilder_H
3 
4 #include <vector>
5 #include <map>
6 #include <memory>
7 
8 #include "TString.h"
9 #include "TFile.h"
10 #include "TTree.h"
11 #include "TCut.h"
12 #include "TH1I.h"
13 #include "TChain.h"
14 
15 #include "FairSource.h"
16 
17 #include "SetupConfiguration.h"
18 
19 #include "ERUnpack.h"
20 
22 
23 class ERDigibuilder : public FairSource {
24  public:
25  ERDigibuilder();
26  ERDigibuilder(const TString& tree_name);
27  virtual Bool_t Init();
28  virtual Int_t ReadEvent(UInt_t=0);
29  virtual void Close();
30  virtual void Reset();
31  virtual Source_Type GetSourceType() { return kFILE; }
32  virtual void SetParUnpackers() {}
33  virtual Bool_t InitUnpackers();
34  virtual Bool_t ReInitUnpackers() { return kTRUE; }
35  void AddUnpack(ERUnpack* unpack){ unpacks_[unpack->DetectorName()].reset(unpack); }
36  void AddFile(const TString& path);
37  void SetUserCut(const TCut& cut, bool hold_events_count = true);
38  private:
39  bool LoadEvent(uint event_number);
40  void ApplyUserCut();
41  static uint EventNumber();
42  bool UserCutIsDefined() const;
43  bool EventShouldBeProcessed(const uint event_number, ERBeamTimeEventHeader*) const;
44  static void CheckEventHeader();
45  void ConnectEventCommon();
46  TChain input_chain_of_events_;
47  std::map<TString, std::unique_ptr<ERUnpack>> unpacks_;
50  SetupConfiguration* setup_configuration_ = nullptr;
51  EventCommon* common_part_of_event_ = nullptr;
52  TCut user_cut_;
53  bool hold_events_count_ = true;
54  TH1I* events_for_processing_ = nullptr;
55  ClassDef(ERDigibuilder, 1)
56 };
57 
58 #endif
SetupConfiguration * setup_configuration_
Definition: ERDigibuilder.h:50