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
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) 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::EDGetTokenT
< reco::JetTracksAssociationCollection
m_associator
 
edm::EDGetTokenT< reco::BeamSpotm_beamSpot
 
double m_cutMinPt
 
double m_cutMinPtRatio
 
bool m_doFilter
 
int32_t m_maxNjets
 

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 78 of file JetVertexChecker.cc.

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

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

Definition at line 92 of file JetVertexChecker.cc.

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

Member Function Documentation

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

Definition at line 159 of file JetVertexChecker.cc.

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

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

Implements edm::EDFilter.

Definition at line 107 of file JetVertexChecker.cc.

References SiPixelRawToDigiRegional_cfi::beamSpot, edm::RefVector< C, T, F >::begin(), alignCSCRings::e, edm::RefVector< C, T, F >::end(), edm::Event::getByToken(), 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.

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

Member Data Documentation

edm::EDGetTokenT<reco::JetTracksAssociationCollection> JetVertexChecker::m_associator
private

Definition at line 58 of file JetVertexChecker.cc.

Referenced by filter(), and JetVertexChecker().

edm::EDGetTokenT<reco::BeamSpot> JetVertexChecker::m_beamSpot
private

Definition at line 59 of file JetVertexChecker.cc.

Referenced by filter(), and JetVertexChecker().

double JetVertexChecker::m_cutMinPt
private

Definition at line 61 of file JetVertexChecker.cc.

Referenced by filter(), and JetVertexChecker().

double JetVertexChecker::m_cutMinPtRatio
private

Definition at line 62 of file JetVertexChecker.cc.

Referenced by filter(), and JetVertexChecker().

bool JetVertexChecker::m_doFilter
private

Definition at line 60 of file JetVertexChecker.cc.

Referenced by filter(), and JetVertexChecker().

int32_t JetVertexChecker::m_maxNjets
private

Definition at line 63 of file JetVertexChecker.cc.

Referenced by filter(), and JetVertexChecker().