8 #ifndef ERDigiCleaner_H 9 #define ERDigiCleaner_H 13 #include <unordered_map> 16 #include "TClonesArray.h" 22 #include "ERBeamTimeEventHeader.h" 23 #include "ERBeamTimeCommon.h" 26 using MultiplicityRange = std::pair<ushort, ushort>;
31 TString fDetectorName;
33 TMatrixD* fPreviousTimeCalibration =
nullptr;
34 TMatrixD* fTimeCalibration =
nullptr;
35 TMatrixD* fPreviousAmpCalibration =
nullptr;
36 TMatrixD* fAmpCalibration =
nullptr;
37 TMatrixD* fPreviousTACCalibration =
nullptr;
38 TMatrixD* fTACCalibration =
nullptr;
39 ChannelMapping* fSim2RawChannelMapping =
nullptr;
41 TMatrixD* previousTimeCalibration, TMatrixD* timeCalibration,
42 TMatrixD* previousAmpCalibration, TMatrixD* ampCalibration,
43 TMatrixD* previousTACCalibration =
nullptr, TMatrixD* TACCalibration =
nullptr,
44 ChannelMapping* raw2SimChannelMapping =
nullptr);
49 TString fDetectorName;
51 std::map<ERChannel, TCutG*> fChannelGCuts;
52 std::map<ERChannel, Double_t> fChannelMinAmp;
53 std::map<ERChannel, Double_t> fChannelMaxAmp;
54 std::map<ERChannel, Double_t> fChannelMinTime;
55 std::map<ERChannel, Double_t> fChannelMaxTime;
56 ChannelMapping* fSim2RawChannelMapping =
nullptr;
57 StationCuts(
const TString& detectorName,
const TString& stationName,
58 const std::map<ERChannel, TCutG*>& channelGCuts,
59 const std::map<ERChannel, Double_t>& channelMinAmp,
60 const std::map<ERChannel, Double_t>& channelMaxAmp,
61 const std::map<ERChannel, Double_t>& channelMinTime,
62 const std::map<ERChannel, Double_t>& channelMaxTime,
63 const ChannelMapping* raw2SimChannelMapping =
nullptr);
74 virtual InitStatus
Init();
77 virtual void Exec(Option_t* opt);
82 void Recalibrate(
const TString& detectorName,
const TString& stationName,
83 const TString& previousTimeCalFile,
const TString& timeCalFile,
84 const TString& previousAmpCalFile,
const TString& ampCalFile,
85 ChannelMapping* raw2SimChannelMapping =
nullptr);
86 void RecalibrateWithTAC(
const TString& detectorName,
const TString& stationName,
87 const TString& previousTimeCalFile,
const TString& timeCalFile,
88 const TString& previousAmpCalFile,
const TString& ampCalFile,
89 const TString& previousTACCalFile,
const TString& TACCalFile,
90 ChannelMapping* raw2SimChannelMapping =
nullptr);
91 void SetLonelyMWPCClusterCondition() { fLonelyMWPCClusterCondition =
true; }
92 void SetStationMultiplicity(
const TString& detectorName,
const TString& stationName,
93 ushort minMultiplicity, ushort maxMultiplicity) {
94 fStationsMultiplicities[std::make_pair(detectorName, stationName)] = std::make_pair(minMultiplicity, maxMultiplicity);
96 void SetChannelCuts(
const TString& detectorName,
const TString& stationName,
97 const std::map<ERChannel, TCutG*>& GCuts,
98 const std::map<ERChannel, Double_t>& MinAmp,
99 const std::map<ERChannel, Double_t>& MaxAmp,
100 const std::map<ERChannel, Double_t>& MinTime,
101 const std::map<ERChannel, Double_t>& MaxTime,
102 const ChannelMapping* raw2SimChannelMapping =
nullptr);
104 bool AreFewClustersInMWPC();
105 void Recalibration();
106 void ApplyChannelCuts();
107 void ApplyStationMultiplicities();
108 void CopyEventHeader();
109 std::pair<std::string, TClonesArray*> GetBranchNameAndDigis(
110 const TString& detectorName,
const TString& stationName);
112 std::list<RecalibrationTask> fStationsRecalibrations;
113 std::list<StationCuts> fStationsCuts;
114 std::map<std::pair<TString, TString>, MultiplicityRange> fStationsMultiplicities;
115 bool fLonelyMWPCClusterCondition =
false;
117 std::unordered_map<std::string, TClonesArray*> fInputDigis;
virtual void Exec(Option_t *opt)
virtual InitStatus Init()
Base abstract class for all tasks in er.