24 #include "TLorentzVector.h" 52 bool isMatched(
double hltJetEta,
double hltJetPhi,
double OffJetEta,
double OffJetPhi);
61 const bool doDirectBalancevsReferencePt =
true,
65 const double directbalance_,
66 const double Difjetref_,
67 const double Assymetry_,
68 const double ReferencePt_,
70 const bool doDirectBalancevsReferencePt =
true);
138 : folderName_(iConfig.getParameter<
std::
string>(
"FolderName")),
139 processName_(iConfig.getParameter<
std::
string>(
"processName")),
144 jetInputTag_(iConfig.getParameter<
edm::
InputTag>(
"jets")),
146 correctorToken_(mayConsume<
reco::JetCorrector>(iConfig.getParameter<
edm::
InputTag>(
"corrector"))),
147 muon_pt(iConfig.getParameter<double>(
"muonpt")),
148 muon_eta(iConfig.getParameter<double>(
"muoneta")),
149 pt_cut(iConfig.getParameter<double>(
"ptcut")),
150 Z_DM(iConfig.getParameter<double>(
"Z_Dmass")),
151 Z_Pt(iConfig.getParameter<double>(
"Z_pt")),
152 dphi_cut(iConfig.getParameter<double>(
"DeltaPhi")),
153 offline_cut(iConfig.getParameter<double>(
"OfflineCut")),
154 isMuonPath_(iConfig.getParameter<
bool>(
"isMuonPath")),
155 directbalance_Binning(iConfig.getParameter<
edm::
ParameterSet>(
"histoPSet")
156 .getParameter<
std::
vector<double> >(
"directbalanceBinning")),
175 histtitle_obtag =
"Z ";
176 histname =
"DiMuonMass";
177 histtitle =
"DiMuonMass";
180 hist_obtag =
"Photon";
181 histtitle_obtag =
"Photon";
184 histname =
"DPhi" + hist_obtag +
"Jet";
185 histtitle =
"DPhi " + hist_obtag +
" Jet";
221 "(HE Inner) lowRefPt",
229 "(HE Outer) lowRefPt",
252 "HEInner_mediumRefPt",
253 "(HE Inner) mediumRefPt",
260 "HEOuter_mediumRefPt",
261 "(HE Outer) mediumRefPt",
285 "(HE Inner) highRefPt",
293 "(HE Outer) highRefPt",
322 if (!aodTriggerEvent.
isValid())
331 if (!(hltcfgIndex ==
index)) {
332 edm::LogInfo(
"ZGammaplusJetsMonitor") <<
" Error in trigger index";
338 edm::LogInfo(
"ZGammaplusJetsMonitor") <<
" Trigger accepted";
342 edm::LogInfo(
"ZGammaplusJetsMonitor") <<
" Trigger did not pass";
349 if (!(module_size == module_names.size())) {
350 edm::LogInfo(
"ZGammaplusJetsMonitor") <<
"ERROR IN MODULES COUNTING";
353 if (module_size == 0) {
354 edm::LogInfo(
"ZGammaplusJetsMonitor") <<
"no modules in this path ?!?!";
361 edm::LogInfo(
"ZGammaplusJetsMonitor") <<
" ModuleFilter " << moduleFilter;
365 edm::LogInfo(
"ZGammaplusJetsMonitor") <<
" filter index " << filterIndex_ <<
" | filter size " 367 if (filterIndex_ >= aodTriggerEvent->
sizeFilters()) {
371 edm::LogInfo(
"ZGammaplusJetsMonitor") <<
" filter label|filter index" <<
moduleName <<
"|" << filterIndex_;
382 edm::LogInfo(
"ZGammaplusJetsMonitor") <<
" idx: " <<
idx <<
"| vid " << VIDS_[
idx] <<
"|" 383 <<
" keys " << KEYS_[
idx] <<
"triggerobject: " 384 <<
" obj_id " << TO.
id() <<
" Pt " << TO.
pt() <<
" eta " << TO.
eta()
385 <<
" phi " << TO.
phi() <<
" mass " << TO.
mass();
387 if (VIDS_[0] == 81) {
388 for (
const auto&
key : KEYS_) {
394 if (VIDS_[0] == 83 && nK_ < 2) {
395 edm::LogInfo(
"ZGammaplusJetsMonitor") <<
" under 2 objects cant have a dimuon";
398 for (
const auto&
key : KEYS_) {
399 double pt = TOC[
key].pt();
400 double eta = TOC[
key].eta();
401 double phi = TOC[
key].phi();
403 int id = TOC[
key].id();
404 unsigned int kCnt0 = 0;
410 v1.SetPtEtaPhiM(0., 0., 0., 0.);
412 unsigned int kCnt1 = 0;
413 for (
const auto& key1 : KEYS_) {
414 if (
key != key1 && kCnt1 > kCnt0) {
416 double pt2 = TOC[key1].pt();
417 double eta2 = TOC[key1].eta();
418 double phi2 = TOC[key1].phi();
419 double mass2 = TOC[key1].mass();
420 int id2 = TOC[key1].id();
422 if ((
id +
id2) == 0) {
426 v2.SetPtEtaPhiM(
pt2,
eta2, phi2, mass2);
428 v2.SetPtEtaPhiM(0., 0., 0., 0.0);
462 <<
" Module Index " << moduleIndex - 1 <<
" Module Name " 463 << module_names[moduleIndex - 1];
464 assert(moduleIndex < module_size);
467 const std::string& ImoduleLabel = module_names[moduleIndex - 1];
469 edm::LogInfo(
"ZGammaplusJetsMonitor") << ImoduleLabel <<
" | " << ImoduleType;
472 if (filterIndex >= aodTriggerEvent->
sizeFilters()) {
485 <<
" idx " <<
idx <<
" vid " << VIDS[
idx] <<
"/" 486 <<
" keys " << KEYS[
idx] <<
": " 487 <<
" obj_id " << TO_.
id() <<
" " << TO_.
pt() <<
" " << TO_.
eta() <<
" " << TO_.
phi() <<
" " << TO_.
mass();
489 for (
const auto&
key : KEYS) {
500 dphi = 2 *
M_PI - dphi;
510 double leading_JetPt = -10.0;
511 double leading_JetEta = -10.0;
512 double leading_JetPhi = -10.0;
517 <<
"skipping events because the collection " <<
jetInputTag_.
label().c_str() <<
" is not available";
520 for (
auto const&
j : *jetHandle) {
523 double cor_jet =
jec *
j.pt();
524 if (cor_jet > leading_JetPt) {
525 leading_JetPt = cor_jet;
526 leading_JetEta =
j.eta();
527 leading_JetPhi =
j.phi();
529 }
else if (!Corrector.
isValid() && ind == 0) {
530 leading_JetPt =
j.pt();
531 leading_JetEta =
j.eta();
532 leading_JetPhi =
j.phi();
598 if (refPt >= 30. && refPt < 50.)
605 if (refPt >= 50. && refPt < 100.)
647 double DRMatched2 = 0.16;
648 double dR2 =
deltaR2(hltJetEta, hltJetPhi, OffJetEta, OffJetPhi);
649 if (
dR2 < DRMatched2)
655 const double directbalance_,
656 const double Difjetref_,
657 const double Asymmetry_,
658 const double ReferencePt_,
660 const bool doDirectBalancevsReferencePt) {
661 a_me[0].numerator->Fill(directbalance_);
662 a_me[1].numerator->Fill(Difjetref_);
663 a_me[2].numerator->Fill(Asymmetry_);
664 a_me[3].numerator->Fill(ReferencePt_);
665 a_me[4].numerator->Fill(Jetpt_);
666 if (doDirectBalancevsReferencePt) {
667 a_me[5].numerator->Fill(ReferencePt_, directbalance_);
678 const bool doDirectBalancevsReferencePt,
679 const bool bookDen) {
682 const std::string hSubN = h_subOptName.empty() ?
"" :
"_" + h_subOptName;
688 hName =
"DirectBalance" + hSubN;
689 hTitle =
" DirectBalance " + hSubT;
691 setMETitle(a_me[0],
"HLTJetPt/" + h_Name +
"Pt",
"events");
693 hName =
"JetPt1_minus_" + h_Name +
"Pt" + hSubN;
694 hTitle =
"LeadingJet Pt minus " + h_Name +
" Pt " + hSubT;
695 bookME(Ibooker, a_me[1], hName, hTitle, nbin_DifJetRef, minbin_DifJetRef, maxbin_DifJetRef, bookDen);
696 setMETitle(a_me[1],
"Pt dif [GeV]",
"events");
698 hName = h_Name +
"JetAsymmetry" + hSubN;
699 hTitle = h_Title +
" Jet Asymmetry " + hSubT;
703 hName = h_Name +
"pT" + hSubN;
704 hTitle = h_Title +
" pT " + hSubT;
706 setMETitle(a_me[3], h_Title +
" pT [GeV]",
"events / [GeV]");
708 hName =
"JetpT" + hSubN;
709 hTitle =
"Jet pT " + hSubN;
711 setMETitle(a_me[4], hTitle +
" [GeV]",
"events / [GeV]");
713 if (doDirectBalancevsReferencePt) {
714 hName =
"DirectBalanceVs" + h_Name +
"Pt" + hSubN;
715 hTitle =
"Direct Balance vs " + h_Title +
" Pt " + hSubT;
717 setMETitle(a_me[5], h_Title +
" pt",
"Direct Balance");
734 edm::LogInfo(
"ZGammaplusJetsMonitor::dqmBeginRun ") << PATHNAME;
735 if (TString(PATHNAME).Contains(
pattern)) {
759 desc.add<
double>(
"muonpt", 20.);
760 desc.add<
double>(
"muoneta", 2.3);
761 desc.add<
double>(
"ptcut", 30.);
762 desc.add<
double>(
"Z_Dmass", 20.);
763 desc.add<
double>(
"Z_pt", 30.);
764 desc.add<
double>(
"DeltaPhi", 2.7);
765 desc.add<
double>(
"OfflineCut", 20.0);
766 desc.add<
bool>(
"isMuonPath",
true);
770 std::vector<double>
bins = {
771 -3.99, -3.97, -3.95, -3.93, -3.91, -3.89, -3.87, -3.85, -3.83, -3.81, -3.79, -3.77, -3.75, -3.73, -3.71, -3.69,
772 -3.67, -3.65, -3.63, -3.61, -3.59, -3.57, -3.55, -3.53, -3.51, -3.49, -3.47, -3.45, -3.43, -3.41, -3.39, -3.37,
773 -3.35, -3.33, -3.31, -3.29, -3.27, -3.25, -3.23, -3.21, -3.19, -3.17, -3.15, -3.13, -3.11, -3.09, -3.07, -3.05,
774 -3.03, -3.01, -2.99, -2.97, -2.95, -2.93, -2.91, -2.89, -2.87, -2.85, -2.83, -2.81, -2.79, -2.77, -2.75, -2.73,
775 -2.71, -2.69, -2.67, -2.65, -2.63, -2.61, -2.59, -2.57, -2.55, -2.53, -2.51, -2.49, -2.47, -2.45, -2.43, -2.41,
776 -2.39, -2.37, -2.35, -2.33, -2.31, -2.29, -2.27, -2.25, -2.23, -2.21, -2.19, -2.17, -2.15, -2.13, -2.11, -2.09,
777 -2.07, -2.05, -2.03, -2.01, -1.99, -1.97, -1.95, -1.93, -1.91, -1.89, -1.87, -1.85, -1.83, -1.81, -1.79, -1.77,
778 -1.75, -1.73, -1.71, -1.69, -1.67, -1.65, -1.63, -1.61, -1.59, -1.57, -1.55, -1.53, -1.51, -1.49, -1.47, -1.45,
779 -1.43, -1.41, -1.39, -1.37, -1.35, -1.33, -1.31, -1.29, -1.27, -1.25, -1.23, -1.21, -1.19, -1.17, -1.15, -1.13,
780 -1.11, -1.09, -1.07, -1.05, -1.03, -1.01, -0.99, -0.97, -0.95, -0.93, -0.91, -0.89, -0.87, -0.85, -0.83, -0.81,
781 -0.79, -0.77, -0.75, -0.73, -0.71, -0.69, -0.67, -0.65, -0.63, -0.61, -0.59, -0.57, -0.55, -0.53, -0.51, -0.49,
782 -0.47, -0.45, -0.43, -0.41, -0.39, -0.37, -0.35, -0.33, -0.31, -0.29, -0.27, -0.25, -0.23, -0.21, -0.19, -0.17,
783 -0.15, -0.13, -0.11, -0.09, -0.07, -0.05, -0.03, -0.01, 0.01, 0.03, 0.05, 0.07, 0.09, 0.11, 0.13, 0.15,
784 0.17, 0.19, 0.21, 0.23, 0.25, 0.27, 0.29, 0.31, 0.33, 0.35, 0.37, 0.39, 0.41, 0.43, 0.45, 0.47,
785 0.49, 0.51, 0.53, 0.55, 0.57, 0.59, 0.61, 0.63, 0.65, 0.67, 0.69, 0.71, 0.73, 0.75, 0.77, 0.79,
786 0.81, 0.83, 0.85, 0.87, 0.89, 0.91, 0.93, 0.95, 0.97, 0.99, 1.01, 1.03, 1.05, 1.07, 1.09, 1.11,
787 1.13, 1.15, 1.17, 1.19, 1.21, 1.23, 1.25, 1.27, 1.29, 1.31, 1.33, 1.35, 1.37, 1.39, 1.41, 1.43,
788 1.45, 1.47, 1.49, 1.51, 1.53, 1.55, 1.57, 1.59, 1.61, 1.63, 1.65, 1.67, 1.69, 1.71, 1.73, 1.75,
789 1.77, 1.79, 1.81, 1.83, 1.85, 1.87, 1.89, 1.91, 1.93, 1.95, 1.97, 1.99, 2.01, 2.03, 2.05, 2.07,
790 2.09, 2.11, 2.13, 2.15, 2.17, 2.19, 2.21, 2.23, 2.25, 2.27, 2.29, 2.31, 2.33, 2.35, 2.37, 2.39,
791 2.41, 2.43, 2.45, 2.47, 2.49, 2.51, 2.53, 2.55, 2.57, 2.59, 2.61, 2.63, 2.65, 2.67, 2.69, 2.71,
792 2.73, 2.75, 2.77, 2.79, 2.81, 2.83, 2.85, 2.87, 2.89, 2.91, 2.93, 2.95, 2.97, 2.99, 3.01, 3.03,
793 3.05, 3.07, 3.09, 3.11, 3.13, 3.15, 3.17, 3.19, 3.21, 3.23, 3.25, 3.27, 3.29, 3.31, 3.33, 3.35,
794 3.37, 3.39, 3.41, 3.43, 3.45, 3.47, 3.49, 3.51, 3.53, 3.55, 3.57, 3.59, 3.61, 3.63, 3.65, 3.67,
795 3.69, 3.71, 3.73, 3.75, 3.77, 3.79, 3.81, 3.83, 3.85, 3.87, 3.89, 3.91, 3.93, 3.95, 3.97, 3.99,
796 4.01, 4.03, 4.05, 4.07, 4.09, 4.11, 4.13, 4.15, 4.17, 4.19, 4.21, 4.23, 4.25, 4.27, 4.29, 4.31,
797 4.33, 4.35, 4.37, 4.39, 4.41, 4.43, 4.45, 4.47, 4.49, 4.51, 4.53, 4.55, 4.57, 4.59, 4.61, 4.63,
798 4.65, 4.67, 4.69, 4.71, 4.73, 4.75, 4.77, 4.79, 4.81, 4.83, 4.85, 4.87, 4.89, 4.91, 4.93, 4.95,
799 4.97, 4.99, 5.01, 5.03, 5.05, 5.07, 5.09, 5.11, 5.13, 5.15, 5.17, 5.19, 5.21, 5.23, 5.25, 5.27,
800 5.29, 5.31, 5.33, 5.35, 5.37, 5.39, 5.41, 5.43, 5.45, 5.47, 5.49, 5.51, 5.53, 5.55, 5.57, 5.59,
801 5.61, 5.63, 5.65, 5.67, 5.69, 5.71, 5.73, 5.75, 5.77, 5.79, 5.81, 5.83, 5.85, 5.87, 5.89, 5.91,
802 5.93, 5.95, 5.97, 5.99};
804 histoPSet.add<std::vector<double> >(
"directbalanceBinning",
bins);
806 std::vector<double> bins_ = {12, 15, 20, 25, 30, 35, 40, 45, 50, 60, 70,
807 85, 105, 130, 175, 230, 300, 400, 500, 700, 1000, 1500};
808 histoPSet.add<std::vector<double> >(
"TrObjPtBinning", bins_);
809 std::vector<double> Jbins_ = {
810 0., 20., 40., 60., 80., 90., 100., 110., 120., 130., 140., 150., 160.,
811 170., 180., 190., 200., 220., 240., 260., 280., 300., 350., 400., 450., 1000.};
812 histoPSet.add<std::vector<double> >(
"jetptBinning", Jbins_);
816 descriptions.
add(
"zgammajetsmonitoring",
desc);
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const Keys & filterKeys(trigger::size_type index) const
const edm::InputTag jetInputTag_
bool isForward(double eta)
const edm::EDGetTokenT< reco::JetCorrector > correctorToken_
ObjME a_ME_HF_highRefPt[6]
virtual void setCurrentFolder(std::string const &fullpath)
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
ObjME a_ME_HE_O_highRefPt[6]
std::vector< double > directbalance_Binning
ObjME a_ME_HF_mediumRefPt[6]
const edm::EDGetTokenT< edm::TriggerResults > triggerResultsToken_
trigger::size_type sizeFilters() const
HLTConfigProvider hltConfig_
std::vector< double > v_jetphi
bool isMatched(double hltJetEta, double hltJetPhi, double OffJetEta, double OffJetPhi)
bool islowRefPt(double RefPt)
const std::string moduleType(const std::string &module) const
C++ class name of module.
ObjME a_ME_HE_O_mediumRefPt[6]
dqm::reco::MonitorElement MonitorElement
MEbinning DifJetRefPT_Binning
ObjME a_ME_HB_highRefPt[6]
std::vector< double > trigobj_eta
std::vector< double > v_jeteta
Log< level::Error, false > LogError
ObjME a_ME_HB_mediumRefPt[6]
double correction(const LorentzVector &fJet) const
get correction using Jet information only
~ZGammaplusJetsMonitor() override
void setMETitle(ObjME &me, const std::string &titleX, const std::string &titleY)
std::vector< double > trigobj_phi
const std::string processName_
void dqmBeginRun(edm::Run const &iRun, edm::EventSetup const &iSetup) override
unsigned int triggerIndex(std::string_view name) const
Single trigger physics object (e.g., an isolated muon)
void bookMESub(DQMStore::IBooker &, ObjME *a_me, const int len_, const std::string &h_Name, const std::string &h_Title, const std::string &h_subOptName, const std::string &h_subOptTitle, const bool doDirectBalancevsReferencePt=true, const bool bookDen=false)
dqm::reco::DQMStore DQMStore
ALPAKA_FN_ACC static ALPAKA_FN_INLINE float dR2(Position4 pos1, Position4 pos2)
unsigned int size() const
number of trigger paths in trigger table
const std::vector< std::string > & moduleLabels(unsigned int trigger) const
label(s) of module(s) on a trigger path
const edm::EDGetTokenT< trigger::TriggerEvent > triggerEventObject_
MonitorElement * numerator
Abs< T >::type abs(const T &t)
bool isEndCapOuter(double eta)
const TriggerObjectCollection & getObjects() const
key
prepare the HTCondor submission files and eventually submit them
#define DEFINE_FWK_MODULE(type)
unsigned int triggerIndex(const std::string &triggerName) const
slot position of trigger path in trigger table (0 to size-1)
static std::string const triggerResults
ZGammaplusJetsMonitor(const edm::ParameterSet &)
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
Log< level::Info, false > LogInfo
const Vids & filterIds(trigger::size_type index) const
std::vector< double > v_jetpt
bool ismediumRefPt(double RefPt)
trigger::size_type filterIndex(const edm::InputTag &filterTag) const
find index of filter in data-member vector from filter tag
ObjME a_ME_HE_I_highRefPt[6]
std::vector< double > trigobj_pt
std::vector< size_type > Keys
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d'tor
const edm::EDGetTokenT< reco::PFJetCollection > jetToken_
const std::string pathName
void add(std::string const &label, ParameterSetDescription const &psetDescription)
ObjME a_ME_HE_O_lowRefPt[6]
bool ishighRefPt(double RefPt)
ObjME a_ME_HE_I_lowRefPt[6]
const std::vector< std::string > & triggerNames() const
names of trigger paths
void fillME(ObjME *a_me, const double directbalance_, const double Difjetref_, const double Assymetry_, const double ReferencePt_, const double Jetpt_, const bool doDirectBalancevsReferencePt=true)
void bookME(DQMStore::IBooker &, ObjME &me, const std::string &histname, const std::string &histtitle, const uint nbins, const double xmin, const double xmax, const bool bookDen=true)
void analyze(edm::Event const &iEvent, edm::EventSetup const &iSetup) override
ObjME a_ME_HF_lowRefPt[6]
std::vector< PFJet > PFJetCollection
collection of PFJet objects
std::vector< double > jetpt_Binning
const std::string moduleName
bool isBarrel(double eta)
Log< level::Warning, false > LogWarning
static std::string const triggerPaths
ObjME a_ME_HB_lowRefPt[6]
const std::string folderName_
ObjME a_ME_HE_I_mediumRefPt[6]
bool isEndCapInner(double eta)
bool passTrig(const float objEta, float objPhi, const trigger::TriggerEvent &trigEvt, const std::string &filterName, const std::string &processName)
std::vector< double > TrObjPt_Binning