00001 #ifndef HZZ2L2NU_INCLUDE_PHOTONTREES_H_
00002 #define HZZ2L2NU_INCLUDE_PHOTONTREES_H_
00003
00004 #include <optional>
00005 #include <string>
00006 #include <vector>
00007
00008 #include <boost/program_options.hpp>
00009 #include <TFile.h>
00010 #include <TTree.h>
00011 #include <TTreeReaderValue.h>
00012
00013 #include <Dataset.h>
00014 #include <EventTrees.h>
00015 #include <GJetsWeight.h>
00016 #include <GenPhotonBuilder.h>
00017 #include <Options.h>
00018 #include <PhotonBuilder.h>
00019 #include <PhotonPrescales.h>
00020 #include <PhotonWeight.h>
00021
00022
00023 class PhotonTrees final : public EventTrees {
00024 public:
00025 PhotonTrees(Options const &options, Dataset &dataset);
00026
00028 static boost::program_options::options_description OptionsDescription();
00029
00031 bool ProcessEvent();
00032
00033 private:
00034 enum class JetCat : int {
00035 kEq0J,
00036 kGEq1J,
00037 kVbf
00038 };
00039
00040 Photon const *CheckPhotons() const;
00041
00042 void FillMoreVariables(std::vector<Jet> const &jets);
00043
00044 static double constexpr kNominalMZ_ = 91.1876;
00045
00047 bool storeMoreVariables_;
00048
00049 std::optional<GenPhotonBuilder> genPhotonBuilder_;
00050
00051 TTreeReaderValue<ULong64_t> srcEvent_;
00052
00053 PhotonBuilder photonBuilder_;
00054
00055 PhotonPrescales photonPrescales_;
00056 std::vector<PhotonTrigger> photonTriggers_;
00057
00058 PhotonWeight photonWeight_;
00059
00060 GJetsWeight gJetsWeight_;
00061
00062 std::string labelWGamma_ = "";
00063 std::string labelZGamma_ = "";
00064
00065 Int_t jetCat_, numPVGood_;
00066 Float_t photonPt_, photonEta_, photonPhi_, photonMass_;
00067 Float_t missPt_, missPhi_;
00068 Float_t mT_, triggerWeight_, photonReweighting_, photonNvtxReweighting_;
00069 Float_t meanWeight_;
00070
00071 TTreeReaderValue<int> srcNumPVGood_;
00072
00073 ULong64_t event_;
00074 static int const maxSize_ = 32;
00075 Int_t jetSize_;
00076 Float_t jetPt_[maxSize_], jetEta_[maxSize_], jetPhi_[maxSize_],
00077 jetMass_[maxSize_];
00078
00079 bool isQCD_;
00080
00081
00082 std::vector<std::string> v_jetCat_;
00083 bool applyNvtxWeights_, applyPtWeights_, applyMassLineshape_;
00084 bool applyMeanWeights_;
00085 std::map<TString, std::map<double, std::pair<double, double>>> nVtxWeight_map_;
00086 std::map<TString, std::map<double, std::pair<double, double>>> ptWeight_map_;
00087 std::map<TString, std::map<double, double>> meanWeight_map_;
00088 std::map<TString, TH1 *> lineshapeMassWeight_map_;
00089 };
00090
00091 #endif // HZZ2L2NU_INCLUDE_PHOTONTREES_H_