CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
SinglePhotonJetPlusHOFilter Class Reference
Inheritance diagram for SinglePhotonJetPlusHOFilter:
edm::EDFilter edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 SinglePhotonJetPlusHOFilter (const edm::ParameterSet &)
 
 ~SinglePhotonJetPlusHOFilter () override
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDFilter () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::EDFilter
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 

Private Member Functions

bool filter (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

double hothres
 
bool isOthHistFill
 
double jtetath
 
double jtptthr
 
int Nevt
 
int Njetp
 
int Npass
 
double pho_Ptcut
 
edm::EDGetTokenT< reco::PFClusterCollectiontok_hoht_
 
edm::EDGetTokenT< reco::PFJetCollectiontok_PFJets_
 
edm::EDGetTokenT< edm::View< reco::Photon > > tok_photons_
 

Additional Inherited Members

- Public Types inherited from edm::EDFilter
typedef EDFilter ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 53 of file SinglePhotonJetPlusHOFilter.cc.

Constructor & Destructor Documentation

SinglePhotonJetPlusHOFilter::SinglePhotonJetPlusHOFilter ( const edm::ParameterSet iConfig)
explicit

Definition at line 91 of file SinglePhotonJetPlusHOFilter.cc.

References edm::ParameterSet::getParameter(), and edm::ParameterSet::getUntrackedParameter().

91  {
92 
93  tok_PFJets_ = consumes<reco::PFJetCollection>( iConfig.getParameter<edm::InputTag>("PFJets"));
94  tok_hoht_ = consumes<reco::PFClusterCollection>( iConfig.getParameter<edm::InputTag>("particleFlowClusterHO"));
95  tok_photons_ = consumes<edm::View<reco::Photon> > ( iConfig.getParameter<edm::InputTag>("Photons"));
96 
97  //now do what ever initialization is needed
98  jtptthr = iConfig.getUntrackedParameter<double>("Ptcut", 90.0);
99  jtetath = iConfig.getUntrackedParameter<double>("Etacut",1.5);
100  hothres = iConfig.getUntrackedParameter<double>("HOcut", 5);
101  pho_Ptcut = iConfig.getUntrackedParameter<double>("Pho_Ptcut",120) ;
102 
103  Nevt = 0;
104  Njetp=0;
105  Npass=0;
106 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< reco::PFClusterCollection > tok_hoht_
edm::EDGetTokenT< reco::PFJetCollection > tok_PFJets_
edm::EDGetTokenT< edm::View< reco::Photon > > tok_photons_
SinglePhotonJetPlusHOFilter::~SinglePhotonJetPlusHOFilter ( )
override

Definition at line 108 of file SinglePhotonJetPlusHOFilter.cc.

109 {
110 
111  // do anything here that needs to be done at desctruction time
112  // (e.g. close files, deallocate resources etc.)
113 
114 }

Member Function Documentation

void SinglePhotonJetPlusHOFilter::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 207 of file SinglePhotonJetPlusHOFilter.cc.

References edm::ConfigurationDescriptions::addDefault(), DEFINE_FWK_MODULE, and edm::ParameterSetDescription::setUnknown().

207  {
208  //The following says we do not know what parameters are allowed so do no validation
209  // Please change this to state exactly what you do use, even if it is no parameters
211  desc.setUnknown();
212  descriptions.addDefault(desc);
213 }
void addDefault(ParameterSetDescription const &psetDescription)
bool SinglePhotonJetPlusHOFilter::filter ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 118 of file SinglePhotonJetPlusHOFilter.cc.

References funct::abs(), delta, hiPixelPairStep_cff::deltaPhi, reco::deltaR2(), PVValHelper::eta, fastmath::etaphi(), funct::false, plotBeamSpotDB::first, edm::Event::getByToken(), edm::HandleBase::isValid(), metsig::jet, electrons_cff::matched, TriggerAnalyzer::passed, muons_cff::photons, EnergyCorrector::pt, edm::second(), and funct::true.

Referenced by Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::filter(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::find(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::setDataAccessor(), and Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::switchCenterView().

119 {
120  using namespace std;
121  using namespace edm;
122  using namespace reco;
123 
124  Nevt++;
125 
127  iEvent.getByToken(tok_PFJets_,PFJets);
128  bool passed=false;
129  vector <pair<double, double> > jetdirection;
130  vector<double> jetspt;
131  if (PFJets.isValid()) {
132  for (unsigned jet = 0; jet<PFJets->size(); jet++) {
133  if(((*PFJets)[jet].pt()<jtptthr)||(abs((*PFJets)[jet].eta())>jtetath)) continue;
134 
135  std::pair<double, double> etaphi((*PFJets)[jet].eta(),(*PFJets)[jet].phi());
136  jetdirection.push_back(etaphi);
137  jetspt.push_back((*PFJets)[jet].pt());
138  passed = true;
139  }
140  }
141  if (!passed) return passed;
142 
144  iEvent.getByToken(tok_photons_, photons);
145  bool pho_passed=false ;
146  vector <pair<double,double> > phodirection ;
147  vector<double> phopT ;
148 
149  if(photons.isValid()){
150 
152  for( gamma1 = photons->begin(); gamma1 != photons->end(); gamma1++ ) {
153  if(gamma1->pt()<pho_Ptcut) continue ;
154  std::pair<double,double> etaphi_pho(gamma1->eta(),gamma1->phi());
155  phodirection.push_back(etaphi_pho) ;
156  phopT.push_back(gamma1->pt()) ;
157 
158  pho_passed =true ;
159  }
160  }
161 
162  if (!pho_passed) return false;
163  Njetp++;
164  bool isJetDir=false;
165 
167  iEvent.getByToken(tok_hoht_,hoht);
168  if (hoht.isValid()) {
169  if (!(*hoht).empty()) {
170  for (unsigned ijet = 0; ijet< jetdirection.size(); ijet++) {
171 
172  bool matched=false;
173  for (unsigned iph=0; iph<phodirection.size(); iph++) {
174  if(abs(deltaPhi(phodirection[iph].second, jetdirection[ijet].second))>2.0) {
175  matched=true; break;
176  }
177  }
178  if (matched) {
179  for (PFClusterCollection::const_iterator ij=(*hoht).begin(); ij!=(*hoht).end(); ij++){
180  double hoenr = (*ij).energy();
181  if (hoenr <hothres) continue;
182 
183  const math::XYZPoint& cluster_pos = ij->position();
184 
185  double hoeta = cluster_pos.eta() ;
186  double hophi = cluster_pos.phi() ;
187 
188  double delta = deltaR2(jetdirection[ijet].first, jetdirection[ijet].second, hoeta, hophi);
189  if (delta <0.5) {
190  isJetDir=true; break;
191  }
192  }
193  }
194  if (isJetDir) { break;}
195  }
196  }
197  }
198 
199  if (isJetDir) {Npass++;}
200 
201  return isJetDir;
202 
203 }
dbl * delta
Definition: mlp_gen.cc:36
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
edm::EDGetTokenT< reco::PFClusterCollection > tok_hoht_
U second(std::pair< T, U > const &p)
std::pair< T, T > etaphi(T x, T y, T z)
Definition: FastMath.h:128
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool isValid() const
Definition: HandleBase.h:74
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:16
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
edm::EDGetTokenT< reco::PFJetCollection > tok_PFJets_
edm::EDGetTokenT< edm::View< reco::Photon > > tok_photons_
fixed size matrix
HLT enums.
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:86

Member Data Documentation

double SinglePhotonJetPlusHOFilter::hothres
private

Definition at line 70 of file SinglePhotonJetPlusHOFilter.cc.

bool SinglePhotonJetPlusHOFilter::isOthHistFill
private

Definition at line 72 of file SinglePhotonJetPlusHOFilter.cc.

double SinglePhotonJetPlusHOFilter::jtetath
private

Definition at line 69 of file SinglePhotonJetPlusHOFilter.cc.

double SinglePhotonJetPlusHOFilter::jtptthr
private

Definition at line 68 of file SinglePhotonJetPlusHOFilter.cc.

int SinglePhotonJetPlusHOFilter::Nevt
private

Definition at line 65 of file SinglePhotonJetPlusHOFilter.cc.

int SinglePhotonJetPlusHOFilter::Njetp
private

Definition at line 66 of file SinglePhotonJetPlusHOFilter.cc.

int SinglePhotonJetPlusHOFilter::Npass
private

Definition at line 67 of file SinglePhotonJetPlusHOFilter.cc.

double SinglePhotonJetPlusHOFilter::pho_Ptcut
private

Definition at line 71 of file SinglePhotonJetPlusHOFilter.cc.

edm::EDGetTokenT<reco::PFClusterCollection> SinglePhotonJetPlusHOFilter::tok_hoht_
private

Definition at line 75 of file SinglePhotonJetPlusHOFilter.cc.

edm::EDGetTokenT<reco::PFJetCollection> SinglePhotonJetPlusHOFilter::tok_PFJets_
private

Definition at line 74 of file SinglePhotonJetPlusHOFilter.cc.

edm::EDGetTokenT<edm::View<reco::Photon> > SinglePhotonJetPlusHOFilter::tok_photons_
private

Definition at line 76 of file SinglePhotonJetPlusHOFilter.cc.