CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
JetHTJetPlusHOFilter Class Reference

#include <Test/BarrelJetFilter/src/BarrelJetFilter.cc>

Inheritance diagram for JetHTJetPlusHOFilter:
edm::EDFilter edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 JetHTJetPlusHOFilter (const edm::ParameterSet &)
 
 ~JetHTJetPlusHOFilter () 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
 
edm::EDGetTokenT< reco::PFClusterCollectiontok_hoht_
 
edm::EDGetTokenT< reco::PFJetCollectiontok_PFJets_
 

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

Skimming of JetHT data set for the study of HO absolute weight calculation

Skimming Efficiency : ~ 5 %

Description: [one line class summary]

Implementation: [Notes on implementation]

Definition at line 44 of file JetHTJetPlusHOFilter.cc.

Constructor & Destructor Documentation

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

Definition at line 79 of file JetHTJetPlusHOFilter.cc.

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

79  {
80 
81  tok_PFJets_ = consumes<reco::PFJetCollection>( iConfig.getParameter<edm::InputTag>("PFJets"));
82  tok_hoht_ = consumes<reco::PFClusterCollection>( iConfig.getParameter<edm::InputTag>("particleFlowClusterHO"));
83 
84 
85  //now do what ever initialization is needed
86  jtptthr = iConfig.getUntrackedParameter<double>("Ptcut", 200.0);
87  jtetath = iConfig.getUntrackedParameter<double>("Etacut",1.5);
88  hothres = iConfig.getUntrackedParameter<double>("HOcut", 8.0);
89 
90  Nevt = 0;
91  Njetp=0;
92  Npass=0;
93 
94 
95 }
edm::EDGetTokenT< reco::PFClusterCollection > tok_hoht_
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< reco::PFJetCollection > tok_PFJets_
JetHTJetPlusHOFilter::~JetHTJetPlusHOFilter ( )
override

Definition at line 98 of file JetHTJetPlusHOFilter.cc.

99 {
100 
101  // do anything here that needs to be done at desctruction time
102  // (e.g. close files, deallocate resources etc.)
103 
104 }

Member Function Documentation

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

Definition at line 169 of file JetHTJetPlusHOFilter.cc.

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

169  {
170  //The following says we do not know what parameters are allowed so do no validation
171  // Please change this to state exactly what you do use, even if it is no parameters
173  desc.setUnknown();
174  descriptions.addDefault(desc);
175 }
void addDefault(ParameterSetDescription const &psetDescription)
bool JetHTJetPlusHOFilter::filter ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 111 of file JetHTJetPlusHOFilter.cc.

References funct::abs(), delta, reco::deltaR2(), PVValHelper::eta, fastmath::etaphi(), plotBeamSpotDB::first, edm::Event::getByToken(), edm::HandleBase::isValid(), metsig::jet, TriggerAnalyzer::passed, EnergyCorrector::pt, and edm::second().

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().

112 {
113  using namespace std;
114  using namespace edm;
115  using namespace reco;
116  Nevt++;
117 
119  iEvent.getByToken(tok_PFJets_,PFJets);
120  bool passed=false;
121  vector <pair<double, double> > jetdirection;
122  vector<double> jetspt;
123  if (PFJets.isValid()) {
124  for (unsigned jet = 0; jet<PFJets->size(); jet++) {
125  if(((*PFJets)[jet].pt()<jtptthr)||(abs((*PFJets)[jet].eta())>jtetath)) continue;
126 
127  std::pair<double, double> etaphi((*PFJets)[jet].eta(),(*PFJets)[jet].phi());
128  jetdirection.push_back(etaphi);
129  jetspt.push_back((*PFJets)[jet].pt());
130  passed = true;
131  }
132  }
133 
134  if (!passed) return false;
135  Njetp++;
136  bool isJetDir=false;
137 
139  iEvent.getByToken(tok_hoht_,hoht);
140  if (hoht.isValid()) {
141  if (!(*hoht).empty()) {
142  for (PFClusterCollection::const_iterator ij=(*hoht).begin(); ij!=(*hoht).end(); ij++){
143  double hoenr = (*ij).energy();
144  if (hoenr <hothres) continue;
145 
146  const math::XYZPoint& cluster_pos = ij->position();
147 
148  double hoeta = cluster_pos.eta() ;
149  double hophi = cluster_pos.phi() ;
150 
151  for (unsigned ijet = 0; ijet< jetdirection.size(); ijet++) {
152  double delta = deltaR2(jetdirection[ijet].first, jetdirection[ijet].second, hoeta, hophi);
153  if (delta <0.5) {
154  isJetDir=true; break;
155  }
156  }
157  }
158  }
159  }
160 
161  if (isJetDir) {Npass++;}
162 
163  return isJetDir;
164 
165 }
edm::EDGetTokenT< reco::PFClusterCollection > tok_hoht_
dbl * delta
Definition: mlp_gen.cc:36
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
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
fixed size matrix
HLT enums.
edm::EDGetTokenT< reco::PFJetCollection > tok_PFJets_

Member Data Documentation

double JetHTJetPlusHOFilter::hothres
private

Definition at line 60 of file JetHTJetPlusHOFilter.cc.

bool JetHTJetPlusHOFilter::isOthHistFill
private

Definition at line 61 of file JetHTJetPlusHOFilter.cc.

double JetHTJetPlusHOFilter::jtetath
private

Definition at line 59 of file JetHTJetPlusHOFilter.cc.

double JetHTJetPlusHOFilter::jtptthr
private

Definition at line 58 of file JetHTJetPlusHOFilter.cc.

int JetHTJetPlusHOFilter::Nevt
private

Definition at line 55 of file JetHTJetPlusHOFilter.cc.

int JetHTJetPlusHOFilter::Njetp
private

Definition at line 56 of file JetHTJetPlusHOFilter.cc.

int JetHTJetPlusHOFilter::Npass
private

Definition at line 57 of file JetHTJetPlusHOFilter.cc.

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

Definition at line 64 of file JetHTJetPlusHOFilter.cc.

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

Definition at line 63 of file JetHTJetPlusHOFilter.cc.