CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
JetVertexChecker Class Reference

#include <RecoBTag/JetVertexChecker/src/JetVertexChecker.cc>

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

Public Member Functions

 JetVertexChecker (const edm::ParameterSet &)
 
 ~JetVertexChecker ()
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
virtual ~EDFilter ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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 &)
 

Private Member Functions

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

Private Attributes

edm::InputTag m_associator
 
edm::InputTag m_beamSpot
 
double m_cutMinPt
 
double m_cutMinPtRatio
 
bool m_doFilter
 
int32_t m_maxNjets
 
edm::InputTag m_primaryVertexProducer
 

Additional Inherited Members

- Public Types inherited from edm::EDFilter
typedef EDFilter ModuleType
 
typedef WorkerT< EDFilterWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Protected Member Functions inherited from edm::EDFilter
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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 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

Description: [one line class summary]

Implementation: [Notes on implementation]

Definition at line 48 of file JetVertexChecker.cc.

Constructor & Destructor Documentation

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

Definition at line 80 of file JetVertexChecker.cc.

References edm::ParameterSet::getParameter(), m_associator, m_beamSpot, m_cutMinPt, m_cutMinPtRatio, m_doFilter, and m_maxNjets.

81 {
82  //now do what ever initialization is needed
83  m_beamSpot = iConfig.getParameter<edm::InputTag>("beamSpot");
84  m_associator = iConfig.getParameter<edm::InputTag>("jetTracks");
85  m_doFilter = iConfig.getParameter<bool>("doFilter");
86  m_cutMinPt = iConfig.getParameter<double>("minPt");
87  m_cutMinPtRatio = iConfig.getParameter<double>("minPtRatio");
88  m_maxNjets = iConfig.getParameter<int32_t>("maxNJetsToCheck");
89  produces<std::vector<reco::CaloJet> >();
90  produces<reco::VertexCollection >();
91 }
T getParameter(std::string const &) const
edm::InputTag m_beamSpot
edm::InputTag m_associator
JetVertexChecker::~JetVertexChecker ( )

Definition at line 94 of file JetVertexChecker.cc.

95 {
96 
97  // do anything here that needs to be done at desctruction time
98  // (e.g. close files, deallocate resources etc.)
99 
100 }

Member Function Documentation

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

Definition at line 161 of file JetVertexChecker.cc.

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

161  {
162  //The following says we do not know what parameters are allowed so do no validation
163  // Please change this to state exactly what you do use, even if it is no parameters
165  desc.setUnknown();
166  descriptions.addDefault(desc);
167 }
void addDefault(ParameterSetDescription const &psetDescription)
bool JetVertexChecker::filter ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::EDFilter.

Definition at line 109 of file JetVertexChecker.cc.

References SiPixelRawToDigiRegional_cfi::beamSpot, edm::RefVector< C, T, F >::begin(), alignCSCRings::e, edm::RefVector< C, T, F >::end(), edm::Event::getByLabel(), i, m_associator, m_beamSpot, m_cutMinPt, m_cutMinPtRatio, m_doFilter, m_maxNjets, AlCaHLTBitMon_ParallelJobs::p, edm::Event::put(), query::result, and testEve_cfg::tracks.

110 {
111  using namespace edm;
113  iEvent.getByLabel(m_associator, jetTracksAssociation);
114  std::auto_ptr<std::vector<reco::CaloJet> > pOut(new std::vector<reco::CaloJet> );
115 
116  bool result=true;
117  int i = 0;
118  //limit to first two jets
119  for(reco::JetTracksAssociationCollection::const_iterator it = jetTracksAssociation->begin();
120  it != jetTracksAssociation->end() && i < m_maxNjets; it++, i++) {
121  if(fabs(it->first->eta()) < 2.4)
122  {
123  reco::TrackRefVector tracks = it->second;
124  math::XYZVector jetMomentum = it->first->momentum();
125  math::XYZVector trMomentum;
126  for(reco::TrackRefVector::const_iterator itTrack = tracks.begin(); itTrack != tracks.end(); ++itTrack)
127  {
128  trMomentum += (*itTrack)->momentum();
129  }
130  if(trMomentum.rho()/jetMomentum.rho() < m_cutMinPtRatio || trMomentum.rho() < m_cutMinPt)
131  {
132 // std::cout << "bad jet " << it->first->pt() << std::endl;
133  pOut->push_back(* dynamic_cast<const reco::CaloJet *>(&(*it->first)));
134  result=false;
135  }
136  }
137  }
138 
139  iEvent.put(pOut);
140 
143 
145  e(0, 0) = 0.0015 * 0.0015;
146  e(1, 1) = 0.0015 * 0.0015;
147  e(2, 2) = 1.5 * 1.5;
148  reco::Vertex::Point p(beamSpot->x0(), beamSpot->y0(), beamSpot->z0());
149  reco::Vertex thePV(p, e, 0, 0, 0);
150  std::auto_ptr<reco::VertexCollection> pOut2(new reco::VertexCollection);
151  pOut2->push_back(thePV);
152  iEvent.put(pOut2);
153 // std::cout << " filter " << result << std::endl;
154  if(m_doFilter) return result;
155  else
156  return true;
157 }
int i
Definition: DBlmapReader.cc:9
transient_vector_type::const_iterator const_iterator
math::Error< dimension >::type Error
covariance error matrix (3x3)
Definition: Vertex.h:44
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
const_iterator end() const
Termination of iteration.
Definition: RefVector.h:249
const_iterator begin() const
Initialize an iterator over the RefVector.
Definition: RefVector.h:244
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:94
tuple result
Definition: query.py:137
math::XYZPoint Point
point in the space
Definition: Vertex.h:40
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
edm::InputTag m_beamSpot
tuple tracks
Definition: testEve_cfg.py:39
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
edm::InputTag m_associator

Member Data Documentation

edm::InputTag JetVertexChecker::m_associator
private

Definition at line 59 of file JetVertexChecker.cc.

Referenced by filter(), and JetVertexChecker().

edm::InputTag JetVertexChecker::m_beamSpot
private

Definition at line 61 of file JetVertexChecker.cc.

Referenced by filter(), and JetVertexChecker().

double JetVertexChecker::m_cutMinPt
private

Definition at line 63 of file JetVertexChecker.cc.

Referenced by filter(), and JetVertexChecker().

double JetVertexChecker::m_cutMinPtRatio
private

Definition at line 64 of file JetVertexChecker.cc.

Referenced by filter(), and JetVertexChecker().

bool JetVertexChecker::m_doFilter
private

Definition at line 62 of file JetVertexChecker.cc.

Referenced by filter(), and JetVertexChecker().

int32_t JetVertexChecker::m_maxNjets
private

Definition at line 65 of file JetVertexChecker.cc.

Referenced by filter(), and JetVertexChecker().

edm::InputTag JetVertexChecker::m_primaryVertexProducer
private

Definition at line 60 of file JetVertexChecker.cc.