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 ()
 
ModuleDescription const & moduleDescription () const
 
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 ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) 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
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- 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 47 of file JetVertexChecker.cc.

Constructor & Destructor Documentation

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

Definition at line 79 of file JetVertexChecker.cc.

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

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

Definition at line 93 of file JetVertexChecker.cc.

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

Member Function Documentation

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

Definition at line 160 of file JetVertexChecker.cc.

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

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

Implements edm::EDFilter.

Definition at line 108 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.

109 {
110  using namespace edm;
112  iEvent.getByLabel(m_associator, jetTracksAssociation);
113  std::auto_ptr<std::vector<reco::CaloJet> > pOut(new std::vector<reco::CaloJet> );
114 
115  bool result=true;
116  int i = 0;
117  //limit to first two jets
118  for(reco::JetTracksAssociationCollection::const_iterator it = jetTracksAssociation->begin();
119  it != jetTracksAssociation->end() && i < m_maxNjets; it++, i++) {
120  if(fabs(it->first->eta()) < 2.4)
121  {
122  reco::TrackRefVector tracks = it->second;
123  math::XYZVector jetMomentum = it->first->momentum();
124  math::XYZVector trMomentum;
125  for(reco::TrackRefVector::const_iterator itTrack = tracks.begin(); itTrack != tracks.end(); ++itTrack)
126  {
127  trMomentum += (*itTrack)->momentum();
128  }
129  if(trMomentum.rho()/jetMomentum.rho() < m_cutMinPtRatio || trMomentum.rho() < m_cutMinPt)
130  {
131 // std::cout << "bad jet " << it->first->pt() << std::endl;
132  pOut->push_back(* dynamic_cast<const reco::CaloJet *>(&(*it->first)));
133  result=false;
134  }
135  }
136  }
137 
138  iEvent.put(pOut);
139 
142 
144  e(0, 0) = 0.0015 * 0.0015;
145  e(1, 1) = 0.0015 * 0.0015;
146  e(2, 2) = 1.5 * 1.5;
147  reco::Vertex::Point p(beamSpot->x0(), beamSpot->y0(), beamSpot->z0());
148  reco::Vertex thePV(p, e, 0, 0, 0);
149  std::auto_ptr<reco::VertexCollection> pOut2(new reco::VertexCollection);
150  pOut2->push_back(thePV);
151  iEvent.put(pOut2);
152 // std::cout << " filter " << result << std::endl;
153  if(m_doFilter) return result;
154  else
155  return true;
156 }
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:43
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:116
tuple result
Definition: query.py:137
math::XYZPoint Point
point in the space
Definition: Vertex.h:39
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:390
edm::InputTag m_beamSpot
tuple tracks
Definition: testEve_cfg.py:39
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:30
edm::InputTag m_associator

Member Data Documentation

edm::InputTag JetVertexChecker::m_associator
private

Definition at line 58 of file JetVertexChecker.cc.

Referenced by filter(), and JetVertexChecker().

edm::InputTag JetVertexChecker::m_beamSpot
private

Definition at line 60 of file JetVertexChecker.cc.

Referenced by filter(), and JetVertexChecker().

double JetVertexChecker::m_cutMinPt
private

Definition at line 62 of file JetVertexChecker.cc.

Referenced by filter(), and JetVertexChecker().

double JetVertexChecker::m_cutMinPtRatio
private

Definition at line 63 of file JetVertexChecker.cc.

Referenced by filter(), and JetVertexChecker().

bool JetVertexChecker::m_doFilter
private

Definition at line 61 of file JetVertexChecker.cc.

Referenced by filter(), and JetVertexChecker().

int32_t JetVertexChecker::m_maxNjets
private

Definition at line 64 of file JetVertexChecker.cc.

Referenced by filter(), and JetVertexChecker().

edm::InputTag JetVertexChecker::m_primaryVertexProducer
private

Definition at line 59 of file JetVertexChecker.cc.