CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Attributes
JetIDStudiesSelector Class Reference
Inheritance diagram for JetIDStudiesSelector:

Public Member Functions

vector< pat::Jet > const & allCaloJets () const
 
vector< pat::Jet > const & allPFJets () const
 
index_type const & caloCuts () const
 
index_type const & caloDeltaPhi () const
 
pat::Jet const & caloJet0 () const
 
pat::Jet const & caloJet1 () const
 
index_type const & caloJetID () const
 
index_type const & caloKin () const
 
 JetIDStudiesSelector (edm::ParameterSet const &caloJetIdParams, edm::ParameterSet const &pfJetIdParams, edm::ParameterSet const &params)
 
std::shared_ptr< JetIDSelectionFunctor > const & jetSel () const
 
bool operator() (edm::EventBase const &event, pat::strbitset &ret) override
 
index_type const & pfCuts () const
 
index_type const & pfDeltaPhi () const
 
pat::Jet const & pfJet0 () const
 
pat::Jet const & pfJet1 () const
 
index_type const & pfJetID () const
 
std::shared_ptr< PFJetIDSelectionFunctor > const & pfJetSel () const
 
index_type const & pfKin () const
 
 ~JetIDStudiesSelector () override
 

Protected Attributes

index_type caloCuts_
 
index_type caloDeltaPhi_
 
edm::Ptr< pat::JetcaloJet0_
 
edm::Ptr< pat::JetcaloJet1_
 
index_type caloJetID_
 
index_type caloKin_
 
edm::Handle< vector< pat::Jet > > h_jets_
 
edm::Handle< vector< pat::Jet > > h_pfjets_
 
std::shared_ptr< JetIDSelectionFunctorjetSel_
 
edm::InputTag jetSrc_
 
index_type pfCuts_
 
index_type pfDeltaPhi_
 
edm::Ptr< pat::JetpfJet0_
 
edm::Ptr< pat::JetpfJet1_
 
index_type pfJetID_
 
std::shared_ptr< PFJetIDSelectionFunctorpfJetSel_
 
edm::InputTag pfJetSrc_
 
index_type pfKin_
 

Detailed Description

Definition at line 55 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

Constructor & Destructor Documentation

◆ JetIDStudiesSelector()

JetIDStudiesSelector::JetIDStudiesSelector ( edm::ParameterSet const &  caloJetIdParams,
edm::ParameterSet const &  pfJetIdParams,
edm::ParameterSet const &  params 
)
inline

Definition at line 57 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

References submitPVValidationJobs::params, push_back(), AlCaHLTBitMon_QueryRunRegistry::string, and HLT_2023v12_cff::useCalo.

60  : jetSel_(new JetIDSelectionFunctor(caloJetIdParams)),
61  pfJetSel_(new PFJetIDSelectionFunctor(pfJetIdParams)),
62  jetSrc_(params.getParameter<edm::InputTag>("jetSrc")),
63  pfJetSrc_(params.getParameter<edm::InputTag>("pfJetSrc")) {
64  bool useCalo = params.getParameter<bool>("useCalo");
65 
66  push_back("Calo Cuts");
67  push_back("Calo Kin Cuts");
68  push_back("Calo Delta Phi");
69  push_back("Calo Jet ID");
70  push_back("PF Cuts");
71  push_back("PF Kin Cuts");
72  push_back("PF Delta Phi");
73  push_back("PF Jet ID");
74 
75  set("Calo Cuts", useCalo);
76  set("Calo Kin Cuts", useCalo);
77  set("Calo Delta Phi", useCalo);
78  set("Calo Jet ID", useCalo);
79  set("PF Cuts", !useCalo);
80  set("PF Kin Cuts", !useCalo);
81  set("PF Delta Phi", !useCalo);
82  set("PF Jet ID", !useCalo);
83 
84  // Indices for fast caching
85  caloCuts_ = index_type(&bits_, std::string("Calo Cuts"));
86  caloKin_ = index_type(&bits_, std::string("Calo Kin Cuts"));
87  caloDeltaPhi_ = index_type(&bits_, std::string("Calo Delta Phi"));
88  caloJetID_ = index_type(&bits_, std::string("Calo Jet ID"));
89  pfCuts_ = index_type(&bits_, std::string("PF Cuts"));
90  pfKin_ = index_type(&bits_, std::string("PF Kin Cuts"));
91  pfDeltaPhi_ = index_type(&bits_, std::string("PF Delta Phi"));
92  pfJetID_ = index_type(&bits_, std::string("PF Jet ID"));
93  }
PF Jet selector for pat::Jets.
Jet selector for pat::Jets and for CaloJets.
std::shared_ptr< JetIDSelectionFunctor > jetSel_
std::shared_ptr< PFJetIDSelectionFunctor > pfJetSel_
deadvectors [0] push_back({0.0175431, 0.538005, 6.80997, 13.29})

◆ ~JetIDStudiesSelector()

JetIDStudiesSelector::~JetIDStudiesSelector ( )
inlineoverride

Definition at line 95 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

95 {}

Member Function Documentation

◆ allCaloJets()

vector<pat::Jet> const& JetIDStudiesSelector::allCaloJets ( ) const
inline

Definition at line 165 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

Referenced by main().

165 { return *h_jets_; }
edm::Handle< vector< pat::Jet > > h_jets_

◆ allPFJets()

vector<pat::Jet> const& JetIDStudiesSelector::allPFJets ( ) const
inline

Definition at line 166 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

Referenced by main().

166 { return *h_pfjets_; }
edm::Handle< vector< pat::Jet > > h_pfjets_

◆ caloCuts()

index_type const& JetIDStudiesSelector::caloCuts ( ) const
inline

Definition at line 175 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

◆ caloDeltaPhi()

index_type const& JetIDStudiesSelector::caloDeltaPhi ( ) const
inline

Definition at line 177 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

Referenced by main().

◆ caloJet0()

pat::Jet const& JetIDStudiesSelector::caloJet0 ( ) const
inline

Definition at line 168 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

Referenced by main().

168 { return *caloJet0_; }

◆ caloJet1()

pat::Jet const& JetIDStudiesSelector::caloJet1 ( ) const
inline

Definition at line 169 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

Referenced by main().

169 { return *caloJet1_; }

◆ caloJetID()

index_type const& JetIDStudiesSelector::caloJetID ( ) const
inline

Definition at line 178 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

Referenced by main().

◆ caloKin()

index_type const& JetIDStudiesSelector::caloKin ( ) const
inline

Definition at line 176 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

Referenced by main().

◆ jetSel()

std::shared_ptr<JetIDSelectionFunctor> const& JetIDStudiesSelector::jetSel ( ) const
inline

Definition at line 162 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

162 { return jetSel_; }
std::shared_ptr< JetIDSelectionFunctor > jetSel_

◆ operator()()

bool JetIDStudiesSelector::operator() ( edm::EventBase const &  event,
pat::strbitset ret 
)
inlineoverride

Definition at line 97 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

References reco::LeafCandidate::phi(), Pi, runTheMatrix::ret, and pat::strbitset::set().

97  {
98  pat::strbitset retCaloJet = jetSel_->getBitTemplate();
99  pat::strbitset retPFJet = pfJetSel_->getBitTemplate();
100 
101  if (considerCut(caloCuts_)) {
102  passCut(ret, caloCuts_);
103  event.getByLabel(jetSrc_, h_jets_);
104  // Calo Cuts
105  if (h_jets_->size() >= 2 || ignoreCut(caloKin_)) {
106  passCut(ret, caloKin_);
107  pat::Jet const& jet0 = h_jets_->at(0);
108  pat::Jet const& jet1 = h_jets_->at(1);
109  double dphi = fabs(deltaPhi<double>(jet0.phi(), jet1.phi()));
110 
111  if (fabs(dphi - TMath::Pi()) < 1.0 || ignoreCut(caloDeltaPhi_)) {
112  passCut(ret, caloDeltaPhi_);
113 
114  retCaloJet.set(false);
115  bool pass0 = (*jetSel_)(jet0, retCaloJet);
116  retCaloJet.set(false);
117  bool pass1 = (*jetSel_)(jet1, retCaloJet);
118  if ((pass0 && pass1) || ignoreCut(caloJetID_)) {
119  passCut(ret, caloJetID_);
122 
123  return (bool)ret;
124  } // end if found 2 "loose" jet ID jets
125  } // end if delta phi
126  } // end calo kin cuts
127  } // end if calo cuts
128 
129  if (considerCut(pfCuts_)) {
130  passCut(ret, pfCuts_);
131  event.getByLabel(pfJetSrc_, h_pfjets_);
132  // PF Cuts
133  if (h_pfjets_->size() >= 2 || ignoreCut(pfKin_)) {
134  passCut(ret, pfKin_);
135  pat::Jet const& jet0 = h_pfjets_->at(0);
136  pat::Jet const& jet1 = h_pfjets_->at(1);
137  double dphi = fabs(deltaPhi<double>(jet0.phi(), jet1.phi()));
138 
139  if (fabs(dphi - TMath::Pi()) < 1.0 || ignoreCut(pfDeltaPhi_)) {
140  passCut(ret, pfDeltaPhi_);
141 
142  retPFJet.set(false);
143  bool pass0 = (*pfJetSel_)(jet0, retPFJet);
144  retPFJet.set(false);
145  bool pass1 = (*pfJetSel_)(jet1, retPFJet);
146  if ((pass0 && pass1) || ignoreCut(pfJetID_)) {
147  passCut(ret, pfJetID_);
150 
151  return (bool)ret;
152  } // end if found 2 "loose" jet ID jets
153  } // end if delta phi
154  } // end pf kin cuts
155  } // end if pf cuts
156 
157  setIgnored(ret);
158 
159  return false;
160  } // end of method
const double Pi
ret
prodAgent to be discontinued
edm::Handle< vector< pat::Jet > > h_jets_
std::shared_ptr< JetIDSelectionFunctor > jetSel_
strbitset & set(bool val=true)
set method of all bits
Definition: strbitset.h:126
Analysis-level calorimeter jet class.
Definition: Jet.h:77
std::shared_ptr< PFJetIDSelectionFunctor > pfJetSel_
edm::Handle< vector< pat::Jet > > h_pfjets_
double phi() const final
momentum azimuthal angle

◆ pfCuts()

index_type const& JetIDStudiesSelector::pfCuts ( ) const
inline

Definition at line 179 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

◆ pfDeltaPhi()

index_type const& JetIDStudiesSelector::pfDeltaPhi ( ) const
inline

Definition at line 181 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

Referenced by main().

◆ pfJet0()

pat::Jet const& JetIDStudiesSelector::pfJet0 ( ) const
inline

Definition at line 171 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

Referenced by main().

171 { return *pfJet0_; }

◆ pfJet1()

pat::Jet const& JetIDStudiesSelector::pfJet1 ( ) const
inline

Definition at line 172 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

Referenced by main().

172 { return *pfJet1_; }

◆ pfJetID()

index_type const& JetIDStudiesSelector::pfJetID ( ) const
inline

Definition at line 182 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

Referenced by main().

◆ pfJetSel()

std::shared_ptr<PFJetIDSelectionFunctor> const& JetIDStudiesSelector::pfJetSel ( ) const
inline

Definition at line 163 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

163 { return pfJetSel_; }
std::shared_ptr< PFJetIDSelectionFunctor > pfJetSel_

◆ pfKin()

index_type const& JetIDStudiesSelector::pfKin ( ) const
inline

Definition at line 180 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

Member Data Documentation

◆ caloCuts_

index_type JetIDStudiesSelector::caloCuts_
protected

Definition at line 200 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

◆ caloDeltaPhi_

index_type JetIDStudiesSelector::caloDeltaPhi_
protected

Definition at line 202 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

◆ caloJet0_

edm::Ptr<pat::Jet> JetIDStudiesSelector::caloJet0_
protected

Definition at line 193 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

◆ caloJet1_

edm::Ptr<pat::Jet> JetIDStudiesSelector::caloJet1_
protected

Definition at line 194 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

◆ caloJetID_

index_type JetIDStudiesSelector::caloJetID_
protected

Definition at line 203 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

◆ caloKin_

index_type JetIDStudiesSelector::caloKin_
protected

Definition at line 201 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

◆ h_jets_

edm::Handle<vector<pat::Jet> > JetIDStudiesSelector::h_jets_
protected

Definition at line 190 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

◆ h_pfjets_

edm::Handle<vector<pat::Jet> > JetIDStudiesSelector::h_pfjets_
protected

Definition at line 191 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

◆ jetSel_

std::shared_ptr<JetIDSelectionFunctor> JetIDStudiesSelector::jetSel_
protected

Definition at line 185 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

◆ jetSrc_

edm::InputTag JetIDStudiesSelector::jetSrc_
protected

Definition at line 187 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

◆ pfCuts_

index_type JetIDStudiesSelector::pfCuts_
protected

Definition at line 204 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

◆ pfDeltaPhi_

index_type JetIDStudiesSelector::pfDeltaPhi_
protected

Definition at line 206 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

◆ pfJet0_

edm::Ptr<pat::Jet> JetIDStudiesSelector::pfJet0_
protected

Definition at line 196 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

◆ pfJet1_

edm::Ptr<pat::Jet> JetIDStudiesSelector::pfJet1_
protected

Definition at line 197 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

◆ pfJetID_

index_type JetIDStudiesSelector::pfJetID_
protected

Definition at line 207 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

◆ pfJetSel_

std::shared_ptr<PFJetIDSelectionFunctor> JetIDStudiesSelector::pfJetSel_
protected

Definition at line 186 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

◆ pfJetSrc_

edm::InputTag JetIDStudiesSelector::pfJetSrc_
protected

Definition at line 188 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

◆ pfKin_

index_type JetIDStudiesSelector::pfKin_
protected

Definition at line 205 of file PatBasicFWLiteJetAnalyzer_Selector.cc.