HerdSoftware  0.3.2
CaloAcceptanceCut.h
Go to the documentation of this file.
1 /*
2  * CaloAcceptanceCut.h
3  *
4  * Created on: 03 June 2019
5  * Author: Lorenzo Pacini
6  */
7 
8 #ifndef HERD_CALOACCEPTANCECUT_H_
9 #define HERD_CALOACCEPTANCECUT_H_
10 
11 #include "algorithm/Algorithm.h"
12 #include "common/DirectionsArray.h"
14 
15 using namespace EA;
16 
17 namespace Herd {
18 
20 struct MCAccOption {
21  MCAccOption() : _trackLengthCaloCm(0), _trackLengthCaloX0(0) {
22  std::for_each(RefFrame::Directions.begin(), RefFrame::Directions.end(), [&](auto &itDir) {
23  if (itDir == RefFrame::Direction::Zneg)
24  _selectSurfCalo[itDir] = 0;
25  else
26  _selectSurfCalo[itDir] = 1;
27  });
28  };
29 
30  void Dump() {
31  std::cout << _trackLengthCaloCm << " ; " << _trackLengthCaloCm << " ; ";
32  auto itName = RefFrame::DirectionName.begin();
33  std::for_each(RefFrame::Directions.begin(), RefFrame::Directions.end(), [&](auto &itDir) {
34  std::cout << *itName << "_flag: " << _selectSurfCalo[itDir] << " ; ";
35  itName++;
36  });
37  std::cout << std::endl;
38  };
39 
40  float _trackLengthCaloCm;
44 };
45 
77 class CaloAcceptanceCut : public Algorithm {
78 public:
83  CaloAcceptanceCut(const std::string &name);
84 
89  bool Initialize() override;
90 
95  bool Process() override;
96 
101  bool Finalize() override;
102 
103 private:
104 
111  bool _GetAcceptanceType(const TrackInfoForCalo &trackInfo);
112 
113  observer_ptr<EventDataStore> _evStore;
114 
116 };
117 
118 } // namespace Herd
119 
120 #endif /* HERD_CALOACCEPTANCECUT_H_ */
Container of information about the track inside the Calo.
Definition: TrackInfoForCalo.h:28
CssGeoParams.h CssGeoParams class declaration.
Definition: CaloPDCalibrationAlgo.h:24
MCAccOption _mcAccOpt
Container of options for the cut.
Definition: CaloAcceptanceCut.h:115
void Dump()
Definition: CaloAcceptanceCut.h:30
An algorithm that reject events out of Calo acceptance.
Definition: CaloAcceptanceCut.h:77
const std::array< std::string, RefFrame::NDirections > DirectionName
Definition: RefFrame.h:80
DirectionsArray< int > _selectSurfCalo
A flag for each calo surfaces which indicates if this surface is valid entrance.
Definition: CaloAcceptanceCut.h:43
constexpr std::array< RefFrame::Direction, RefFrame::NDirections > Directions
Definition: RefFrame.h:74
observer_ptr< EventDataStore > _evStore
Pointer to the event data store.
Definition: CaloAcceptanceCut.h:113
float _trackLengthCaloCm
Track length [cm];.
Definition: CaloAcceptanceCut.h:38
Class which contains the options for CaloAcceptnaceCut.
Definition: CaloAcceptanceCut.h:20
float _trackLengthCaloX0
Track length [X0].
Definition: CaloAcceptanceCut.h:41
MCAccOption()
Definition: CaloAcceptanceCut.h:21