HerdSoftware  0.1.1
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 
72 class CaloAcceptanceCut : public Algorithm {
73 public:
78  CaloAcceptanceCut(const std::string &name);
79 
84  bool Initialize();
85 
90  bool Process();
91 
96  bool Finalize();
97 
98 private:
99 
106  bool _GetAcceptanceType(const TrackInfoForCalo &trackInfo);
107 
108  observer_ptr<EventDataStore> _evStore;
109 
111 };
112 
113 } // namespace Herd
114 
115 #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:110
void Dump()
Definition: CaloAcceptanceCut.h:30
An algorithm that reject events out of Calo acceptance.
Definition: CaloAcceptanceCut.h:72
const std::array< std::string, RefFrame::NDirections > DirectionName
Definition: RefFrame.h:75
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:69
observer_ptr< EventDataStore > _evStore
Pointer to the event data store.
Definition: CaloAcceptanceCut.h:108
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