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::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 &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

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 void beginJob ()
 
virtual bool beginLuminosityBlock (edm::LuminosityBlock &, edm::EventSetup const &)
 
virtual bool beginRun (edm::Run &, edm::EventSetup const &)
 
virtual void endJob ()
 
virtual bool endLuminosityBlock (edm::LuminosityBlock &, edm::EventSetup const &)
 
virtual bool endRun (edm::Run &, edm::EventSetup const &)
 
virtual bool filter (edm::Event &, const edm::EventSetup &)
 

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
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

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

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

88 {
89  //now do what ever initialization is needed
90  m_beamSpot = iConfig.getParameter<edm::InputTag>("beamSpot");
91  m_associator = iConfig.getParameter<edm::InputTag>("jetTracks");
92  m_doFilter = iConfig.getParameter<bool>("doFilter");
93  m_cutMinPt = iConfig.getParameter<double>("minPt");
94  m_cutMinPtRatio = iConfig.getParameter<double>("minPtRatio");
95  m_maxNjets = iConfig.getParameter<int32_t>("maxNJetsToCheck");
96  produces<std::vector<reco::CaloJet> >();
97  produces<reco::VertexCollection >();
98 }
T getParameter(std::string const &) const
edm::InputTag m_beamSpot
edm::InputTag m_associator
JetVertexChecker::~JetVertexChecker ( )

Definition at line 101 of file JetVertexChecker.cc.

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

Member Function Documentation

void JetVertexChecker::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDFilter.

Definition at line 168 of file JetVertexChecker.cc.

169 {
170 }
bool JetVertexChecker::beginLuminosityBlock ( edm::LuminosityBlock ,
edm::EventSetup const &   
)
privatevirtual

Reimplemented from edm::EDFilter.

Definition at line 193 of file JetVertexChecker.cc.

194 {
195  return true;
196 }
bool JetVertexChecker::beginRun ( edm::Run ,
edm::EventSetup const &   
)
privatevirtual

Reimplemented from edm::EDFilter.

Definition at line 179 of file JetVertexChecker.cc.

180 {
181  return true;
182 }
void JetVertexChecker::endJob ( void  )
privatevirtual

Reimplemented from edm::EDFilter.

Definition at line 174 of file JetVertexChecker.cc.

174  {
175 }
bool JetVertexChecker::endLuminosityBlock ( edm::LuminosityBlock ,
edm::EventSetup const &   
)
privatevirtual

Reimplemented from edm::EDFilter.

Definition at line 200 of file JetVertexChecker.cc.

201 {
202  return true;
203 }
bool JetVertexChecker::endRun ( edm::Run ,
edm::EventSetup const &   
)
privatevirtual

Reimplemented from edm::EDFilter.

Definition at line 186 of file JetVertexChecker.cc.

187 {
188  return true;
189 }
void JetVertexChecker::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 207 of file JetVertexChecker.cc.

References edm::ConfigurationDescriptions::addDefault(), 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 JetVertexChecker::filter ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDFilter.

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

117 {
118  using namespace edm;
120  iEvent.getByLabel(m_associator, jetTracksAssociation);
121  std::auto_ptr<std::vector<reco::CaloJet> > pOut(new std::vector<reco::CaloJet> );
122 
123  bool result=true;
124  int i = 0;
125  //limit to first two jets
126  for(reco::JetTracksAssociationCollection::const_iterator it = jetTracksAssociation->begin();
127  it != jetTracksAssociation->end() && i < m_maxNjets; it++, i++) {
128  if(fabs(it->first->eta()) < 2.4)
129  {
130  reco::TrackRefVector tracks = it->second;
131  math::XYZVector jetMomentum = it->first->momentum();
132  math::XYZVector trMomentum;
133  for(reco::TrackRefVector::const_iterator itTrack = tracks.begin(); itTrack != tracks.end(); ++itTrack)
134  {
135  trMomentum += (*itTrack)->momentum();
136  }
137  if(trMomentum.rho()/jetMomentum.rho() < m_cutMinPtRatio || trMomentum.rho() < m_cutMinPt)
138  {
139 // std::cout << "bad jet " << it->first->pt() << std::endl;
140  pOut->push_back(* dynamic_cast<const reco::CaloJet *>(&(*it->first)));
141  result=false;
142  }
143  }
144  }
145 
146  iEvent.put(pOut);
147 
150 
152  e(0, 0) = 0.0015 * 0.0015;
153  e(1, 1) = 0.0015 * 0.0015;
154  e(2, 2) = 1.5 * 1.5;
155  reco::Vertex::Point p(beamSpot->x0(), beamSpot->y0(), beamSpot->z0());
156  reco::Vertex thePV(p, e, 0, 0, 0);
157  std::auto_ptr<reco::VertexCollection> pOut2(new reco::VertexCollection);
158  pOut2->push_back(thePV);
159  iEvent.put(pOut2);
160 // std::cout << " filter " << result << std::endl;
161  if(m_doFilter) return result;
162  else
163  return true;
164 }
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:85
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:356
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 66 of file JetVertexChecker.cc.

Referenced by filter(), and JetVertexChecker().

edm::InputTag JetVertexChecker::m_beamSpot
private

Definition at line 68 of file JetVertexChecker.cc.

Referenced by filter(), and JetVertexChecker().

double JetVertexChecker::m_cutMinPt
private

Definition at line 70 of file JetVertexChecker.cc.

Referenced by filter(), and JetVertexChecker().

double JetVertexChecker::m_cutMinPtRatio
private

Definition at line 71 of file JetVertexChecker.cc.

Referenced by filter(), and JetVertexChecker().

bool JetVertexChecker::m_doFilter
private

Definition at line 69 of file JetVertexChecker.cc.

Referenced by filter(), and JetVertexChecker().

int32_t JetVertexChecker::m_maxNjets
private

Definition at line 72 of file JetVertexChecker.cc.

Referenced by filter(), and JetVertexChecker().

edm::InputTag JetVertexChecker::m_primaryVertexProducer
private

Definition at line 67 of file JetVertexChecker.cc.