CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Attributes
JetIDStudiesSelector Class Reference
Inheritance diagram for JetIDStudiesSelector:
EventSelector

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)
 
boost::shared_ptr
< JetIDSelectionFunctor >
const & 
jetSel () const
 
virtual 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
 
boost::shared_ptr
< PFJetIDSelectionFunctor >
const & 
pfJetSel () const
 
index_type const & pfKin () const
 
virtual ~JetIDStudiesSelector ()
 
- Public Member Functions inherited from EventSelector
const std::vector< std::string > & description ()
 
 EventSelector ()
 
 EventSelector (const edm::ParameterSet &iConfig, edm::ConsumesCollector &&iC)
 
 EventSelector (const edm::ParameterSet &iConfig, edm::ConsumesCollector &iC)
 
const std::string & name () const
 name of the module (from configuration) More...
 
virtual bool select (const edm::Event &) const =0
 decision of the selector module More...
 
virtual ~EventSelector ()
 

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_
 
boost::shared_ptr
< JetIDSelectionFunctor
jetSel_
 
edm::InputTag jetSrc_
 
index_type pfCuts_
 
index_type pfDeltaPhi_
 
edm::Ptr< pat::JetpfJet0_
 
edm::Ptr< pat::JetpfJet1_
 
index_type pfJetID_
 
boost::shared_ptr
< PFJetIDSelectionFunctor
pfJetSel_
 
edm::InputTag pfJetSrc_
 
index_type pfKin_
 
- Protected Attributes inherited from EventSelector
std::vector< std::string > description_
 
std::string name_
 

Detailed Description

Definition at line 57 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

Constructor & Destructor Documentation

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

Definition at line 59 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

References edm::ParameterSet::getParameter(), AlCaHLTBitMon_QueryRunRegistry::string, and PatBasicFWLiteJetAnalyzer_Selector_cfg::useCalo.

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

Definition at line 99 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

99 {}

Member Function Documentation

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

Definition at line 178 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

Referenced by main().

178 { return *h_jets_; }
edm::Handle< vector< pat::Jet > > h_jets_
vector<pat::Jet> const& JetIDStudiesSelector::allPFJets ( ) const
inline

Definition at line 179 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

Referenced by main().

179 { return *h_pfjets_; }
edm::Handle< vector< pat::Jet > > h_pfjets_
index_type const& JetIDStudiesSelector::caloCuts ( ) const
inline
index_type const& JetIDStudiesSelector::caloDeltaPhi ( ) const
inline

Definition at line 191 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

Referenced by main().

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

Definition at line 181 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

Referenced by main().

181 { return *caloJet0_; }
pat::Jet const& JetIDStudiesSelector::caloJet1 ( ) const
inline

Definition at line 182 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

Referenced by main().

182 { return *caloJet1_; }
index_type const& JetIDStudiesSelector::caloJetID ( ) const
inline

Definition at line 192 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

Referenced by main().

index_type const& JetIDStudiesSelector::caloKin ( ) const
inline

Definition at line 190 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

Referenced by main().

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

Definition at line 175 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

175 { return jetSel_;}
boost::shared_ptr< JetIDSelectionFunctor > jetSel_
virtual bool JetIDStudiesSelector::operator() ( edm::EventBase const &  event,
pat::strbitset ret 
)
inlineoverridevirtual

Definition at line 101 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

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

101  {
102 
103  pat::strbitset retCaloJet = jetSel_->getBitTemplate();
104  pat::strbitset retPFJet = pfJetSel_->getBitTemplate();
105 
106 
107  if ( considerCut(caloCuts_) ) {
108  passCut(ret, caloCuts_);
109  event.getByLabel( jetSrc_, h_jets_ );
110  // Calo Cuts
111  if ( h_jets_->size() >= 2 || ignoreCut(caloKin_) ) {
112  passCut(ret, caloKin_);
113  pat::Jet const & jet0 = h_jets_->at(0);
114  pat::Jet const & jet1 = h_jets_->at(1);
115  double dphi = fabs(deltaPhi<double>( jet0.phi(),
116  jet1.phi() ) );
117 
118  if ( fabs(dphi - TMath::Pi()) < 1.0 || ignoreCut(caloDeltaPhi_) ) {
119  passCut(ret, caloDeltaPhi_);
120 
121 
122  retCaloJet.set(false);
123  bool pass0 = (*jetSel_)( jet0, retCaloJet );
124  retCaloJet.set(false);
125  bool pass1 = (*jetSel_)( jet1, retCaloJet );
126  if ( (pass0 && pass1) || ignoreCut(caloJetID_) ) {
127  passCut(ret, caloJetID_);
130 
131  return (bool)ret;
132  }// end if found 2 "loose" jet ID jets
133  }// end if delta phi
134  }// end calo kin cuts
135  }// end if calo cuts
136 
137 
138  if ( considerCut(pfCuts_) ) {
139 
140  passCut(ret, pfCuts_);
141  event.getByLabel( pfJetSrc_, h_pfjets_ );
142  // PF Cuts
143  if ( h_pfjets_->size() >= 2 || ignoreCut(pfKin_) ) {
144  passCut( ret, pfKin_);
145  pat::Jet const & jet0 = h_pfjets_->at(0);
146  pat::Jet const & jet1 = h_pfjets_->at(1);
147  double dphi = fabs(deltaPhi<double>( jet0.phi(),
148  jet1.phi() ) );
149 
150  if ( fabs(dphi - TMath::Pi()) < 1.0 || ignoreCut(pfDeltaPhi_) ) {
151  passCut(ret, pfDeltaPhi_);
152 
153 
154  retPFJet.set(false);
155  bool pass0 = (*pfJetSel_)( jet0, retPFJet );
156  retPFJet.set(false);
157  bool pass1 = (*pfJetSel_)( jet1, retPFJet );
158  if ( (pass0 && pass1) || ignoreCut(pfJetID_) ) {
159  passCut(ret, pfJetID_);
162 
163  return (bool)ret;
164  }// end if found 2 "loose" jet ID jets
165  }// end if delta phi
166  }// end pf kin cuts
167  }// end if pf cuts
168 
169 
170  setIgnored(ret);
171 
172  return false;
173  }// end of method
const double Pi
boost::shared_ptr< JetIDSelectionFunctor > jetSel_
virtual float phi() const GCC11_FINAL
momentum azimuthal angle
boost::shared_ptr< PFJetIDSelectionFunctor > pfJetSel_
edm::Handle< vector< pat::Jet > > h_jets_
strbitset & set(bool val=true)
set method of all bits
Definition: strbitset.h:144
Analysis-level calorimeter jet class.
Definition: Jet.h:70
edm::Handle< vector< pat::Jet > > h_pfjets_
index_type const& JetIDStudiesSelector::pfCuts ( ) const
inline

Definition at line 193 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

index_type const& JetIDStudiesSelector::pfDeltaPhi ( ) const
inline

Definition at line 195 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

Referenced by main().

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

Definition at line 184 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

Referenced by main().

184 { return *pfJet0_; }
pat::Jet const& JetIDStudiesSelector::pfJet1 ( ) const
inline

Definition at line 185 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

Referenced by main().

185 { return *pfJet1_; }
index_type const& JetIDStudiesSelector::pfJetID ( ) const
inline

Definition at line 196 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

Referenced by main().

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

Definition at line 176 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

176 { return pfJetSel_;}
boost::shared_ptr< PFJetIDSelectionFunctor > pfJetSel_
index_type const& JetIDStudiesSelector::pfKin ( ) const
inline

Definition at line 194 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

Member Data Documentation

index_type JetIDStudiesSelector::caloCuts_
protected

Definition at line 215 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

index_type JetIDStudiesSelector::caloDeltaPhi_
protected

Definition at line 217 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

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

Definition at line 208 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

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

Definition at line 209 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

index_type JetIDStudiesSelector::caloJetID_
protected

Definition at line 218 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

index_type JetIDStudiesSelector::caloKin_
protected

Definition at line 216 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

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

Definition at line 205 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

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

Definition at line 206 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

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

Definition at line 200 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

edm::InputTag JetIDStudiesSelector::jetSrc_
protected

Definition at line 202 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

index_type JetIDStudiesSelector::pfCuts_
protected

Definition at line 219 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

index_type JetIDStudiesSelector::pfDeltaPhi_
protected

Definition at line 221 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

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

Definition at line 211 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

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

Definition at line 212 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

index_type JetIDStudiesSelector::pfJetID_
protected

Definition at line 222 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

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

Definition at line 201 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

edm::InputTag JetIDStudiesSelector::pfJetSrc_
protected

Definition at line 203 of file PatBasicFWLiteJetAnalyzer_Selector.cc.

index_type JetIDStudiesSelector::pfKin_
protected

Definition at line 220 of file PatBasicFWLiteJetAnalyzer_Selector.cc.