00001 #ifndef HZZ2L2NU_INCLUDE_PHOTONPRESCALES_H_ 00002 #define HZZ2L2NU_INCLUDE_PHOTONPRESCALES_H_ 00003 00004 #include <memory> 00005 #include <vector> 00006 00007 #include <TTreeReaderValue.h> 00008 00009 #include <Dataset.h> 00010 #include <Options.h> 00011 #include <PhysicsObjects.h> 00012 00014 struct PhotonTrigger { 00015 bool operator<(const PhotonTrigger& photonTrg) const { 00016 return (threshold < photonTrg.threshold); 00017 } 00018 std::string name; 00019 double threshold; 00020 std::unique_ptr<TTreeReaderValue<Bool_t>> decision; 00021 std::unique_ptr<std::map<unsigned, std::map<unsigned,int>>> prescaleMap; 00022 }; 00023 00035 class PhotonPrescales { 00036 public: 00043 PhotonPrescales(Dataset &dataset, Options const &options); 00044 00051 std::vector<double> GetThresholdsBinning() const; 00052 00064 int GetPhotonPrescale(double photonPt) const; 00065 00066 private: 00073 static std::vector<PhotonTrigger> GetTriggers( 00074 Dataset &dataset, Options const &options); 00075 00079 const PhotonTrigger* FindTrigger(double photonPt) const; 00080 00082 std::vector<PhotonTrigger> photonTriggers_; 00083 00085 bool isSim_; 00086 00088 mutable TTreeReaderValue<UInt_t> run_; 00089 mutable TTreeReaderValue<UInt_t> luminosityBlock_; 00090 }; 00091 00092 #endif // HZZ2L2NU_INCLUDE_PHOTONPRESCALES_H 00093