er  dev
ERUnpack.h
1 #ifndef ERUnpack_H
2 #define ERUnpack_H
3 
4 #include <tuple>
5 
6 #include "TString.h"
7 #include "TClonesArray.h"
8 #include "TMatrixD.h"
9 #include "TChain.h"
10 
11 #include "FairUnpack.h"
12 
13 #include "SetupConfiguration.h"
14 
15 #include "ERBeamTimeCommon.h"
16 
17 class ERUnpack : public FairUnpack {
18  public:
19 
20  ERUnpack(const TString& detector_name);
21  virtual ~ERUnpack() = default;
22  virtual Bool_t Init(){return kTRUE;}
23  virtual Bool_t Init(const SetupConfiguration*, TChain& input_chain_of_events);
24  virtual Bool_t DoUnpack(Int_t* data, Int_t size);
25  virtual void Reset();
26  TString DetectorName() { return detector_name_; }
27  Bool_t IsInited() { return inited_; }
28  protected:
29  virtual void ConnectToInputBranches(TChain& input_chain_of_events,
30  const std::vector<TString>& branch_names);
31  virtual void UnpackSignalFromStations() = 0;
32  virtual std::vector<TString> InputBranchNames() const = 0;
33  void UnpackStation(SignalsAndChannelCount signals_from_station,
34  ChannelToSignal& channel_to_signal);
35  void UnpackAmpTimeStation(SignalsAndChannelCount signals_from_amplitude_station,
36  SignalsAndChannelCount signals_from_time_station,
37  ChannelToAmpTime& channel_to_signals,
38  bool skip_alone_channels = true);
39  void UnpackAmpTimeTACStation(SignalsAndChannelCount signals_from_amplitude_station,
40  SignalsAndChannelCount signals_from_time_station,
41  SignalsAndChannelCount signals_from_tac_station,
42  ChannelToAmpTimeTac& channel_to_signals,
43  bool skip_alone_channels = true);
44  const SetupConfiguration* setup_configuration_;
45  bool inited_ = false;
46  TString detector_name_;
47  std::map<TString, SignalsAndChannelCount> signals_from_stations_;
48  std::map<TString, TClonesArray*> digi_collections_;
49  ClassDef(ERUnpack, 0)
50 };
51 
52 #endif