CMS 3D CMS Logo

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

#include <JetMuonHitsIDHelper.h>

Public Member Functions

void calculate (const edm::Event &event, const edm::EventSetup &isetup, const reco::Jet &jet, const int iDbg=0)
 
void fillDescription (edm::ParameterSetDescription &iDesc)
 
void initValues ()
 
 JetMuonHitsIDHelper ()
 
 JetMuonHitsIDHelper (edm::ParameterSet const &pset)
 
int numberOfHits1RPC () const
 
int numberOfHits2RPC () const
 
int numberOfHits3RPC () const
 
int numberOfHits4RPC () const
 
int numberOfHitsRPC () const
 
 ~JetMuonHitsIDHelper ()
 

Private Attributes

bool isRECO_
 
int numberOfHits1RPC_
 
int numberOfHits2RPC_
 
int numberOfHits3RPC_
 
int numberOfHits4RPC_
 
int numberOfHitsRPC_
 
edm::InputTag rpcRecHits_
 

Detailed Description

Definition at line 17 of file JetMuonHitsIDHelper.h.

Constructor & Destructor Documentation

reco::helper::JetMuonHitsIDHelper::JetMuonHitsIDHelper ( )
inline

Definition at line 21 of file JetMuonHitsIDHelper.h.

21 {}
reco::helper::JetMuonHitsIDHelper::JetMuonHitsIDHelper ( edm::ParameterSet const &  pset)

Definition at line 33 of file JetMuonHitsIDHelper.cc.

References edm::ParameterSet::getParameter().

34 {
35  isRECO_ = true; // This will be "true" initially, then if the product isn't found, set to false once
40  numberOfHitsRPC_ = 0;
41  rpcRecHits_ = pset.getParameter<edm::InputTag>("rpcRecHits");
42 
43 }
reco::helper::JetMuonHitsIDHelper::~JetMuonHitsIDHelper ( )
inline

Definition at line 23 of file JetMuonHitsIDHelper.h.

23 {}

Member Function Documentation

void reco::helper::JetMuonHitsIDHelper::calculate ( const edm::Event event,
const edm::EventSetup isetup,
const reco::Jet jet,
const int  iDbg = 0 
)

Definition at line 48 of file JetMuonHitsIDHelper.cc.

References reco::deltaR(), cond::rpcobgas::detid, reco::LeafCandidate::eta(), TrackingRecHit::geographicalId(), edm::EventSetup::get(), edm::HandleBase::isValid(), RPCRecHit::localPosition(), reco::LeafCandidate::phi(), RPCDetId, RPCDetId::station(), and GeomDet::toGlobal().

Referenced by JetIDProducer::produce().

50 {
51 
52  // initialize
57  numberOfHitsRPC_ = 0;
58 
59 
60  if ( isRECO_ ) { // This will be "true" initially, then if the product isn't found, set to false once
61 
62  // Get tracking geometry
64  iSetup.get<GlobalTrackingGeometryRecord> ().get(trackingGeometry);
65 
66  //####READ RPC RecHits Collection########
67  //#In config: RpcRecHits = cms.InputTag("rpcRecHits")
68  edm::Handle<RPCRecHitCollection> rpcRecHits_handle;
69  event.getByLabel(rpcRecHits_, rpcRecHits_handle);
70 
71 
72  if ( ! rpcRecHits_handle.isValid() ) {
73  // don't throw exception if not running on RECO
74  edm::LogWarning("DataNotAvailable") << "JetMuonHitsIDHelper will not be run at all, this is not a RECO file.";
75  isRECO_ = false;
76  return;
77  }
78 
79  //####calculate rpc variables for each jet########
80 
81  for ( RPCRecHitCollection::const_iterator itRPC = rpcRecHits_handle->begin(),
82  itRPCEnd = rpcRecHits_handle->end();
83  itRPC != itRPCEnd; ++itRPC) {
84  RPCRecHit const & hit = *itRPC;
85  DetId detid = hit.geographicalId();
86  LocalPoint lp = hit.localPosition();
87  const GeomDet* gd = trackingGeometry->idToDet(detid);
88  GlobalPoint gp = gd->toGlobal(lp);
89  double dR2 = reco::deltaR(jet.eta(), jet.phi(),
90  static_cast<double>( gp.eta() ), static_cast<double>(gp.phi()) );
91  if (dR2 < 0.5) {
92  RPCDetId rpcChamberId = (RPCDetId) detid;
94  if (rpcChamberId.station() == 1)
96  if (rpcChamberId.station() == 2)
98  if (rpcChamberId.station() == 3)
100  if (rpcChamberId.station() == 4)
102  }
103  }
104  }
105 }
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:47
Geom::Phi< T > phi() const
Definition: PV3DBase.h:68
virtual double eta() const
momentum pseudorapidity
double deltaR(double eta1, double phi1, double eta2, double phi2)
Definition: deltaR.h:19
C::const_iterator const_iterator
constant access iterator type
Definition: RangeMap.h:45
bool isValid() const
Definition: HandleBase.h:76
Definition: DetId.h:20
T eta() const
Definition: PV3DBase.h:75
DetId geographicalId() const
virtual LocalPoint localPosition() const
Return the 3-dimensional local position.
Definition: RPCRecHit.h:55
virtual double phi() const
momentum azimuthal angle
int station() const
Definition: RPCDetId.h:100
void reco::helper::JetMuonHitsIDHelper::fillDescription ( edm::ParameterSetDescription iDesc)
void reco::helper::JetMuonHitsIDHelper::initValues ( )
int reco::helper::JetMuonHitsIDHelper::numberOfHits1RPC ( ) const
inline

Definition at line 34 of file JetMuonHitsIDHelper.h.

References numberOfHits1RPC_.

int reco::helper::JetMuonHitsIDHelper::numberOfHits2RPC ( ) const
inline

Definition at line 35 of file JetMuonHitsIDHelper.h.

References numberOfHits2RPC_.

Referenced by JetIDProducer::produce().

int reco::helper::JetMuonHitsIDHelper::numberOfHits3RPC ( ) const
inline

Definition at line 36 of file JetMuonHitsIDHelper.h.

References numberOfHits3RPC_.

Referenced by JetIDProducer::produce().

int reco::helper::JetMuonHitsIDHelper::numberOfHits4RPC ( ) const
inline

Definition at line 37 of file JetMuonHitsIDHelper.h.

References numberOfHits4RPC_.

int reco::helper::JetMuonHitsIDHelper::numberOfHitsRPC ( ) const
inline

Definition at line 38 of file JetMuonHitsIDHelper.h.

References numberOfHitsRPC_.

Referenced by JetIDProducer::produce().

Member Data Documentation

bool reco::helper::JetMuonHitsIDHelper::isRECO_
private

Definition at line 43 of file JetMuonHitsIDHelper.h.

int reco::helper::JetMuonHitsIDHelper::numberOfHits1RPC_
private

Definition at line 45 of file JetMuonHitsIDHelper.h.

Referenced by numberOfHits1RPC().

int reco::helper::JetMuonHitsIDHelper::numberOfHits2RPC_
private

Definition at line 46 of file JetMuonHitsIDHelper.h.

Referenced by numberOfHits2RPC().

int reco::helper::JetMuonHitsIDHelper::numberOfHits3RPC_
private

Definition at line 47 of file JetMuonHitsIDHelper.h.

Referenced by numberOfHits3RPC().

int reco::helper::JetMuonHitsIDHelper::numberOfHits4RPC_
private

Definition at line 48 of file JetMuonHitsIDHelper.h.

Referenced by numberOfHits4RPC().

int reco::helper::JetMuonHitsIDHelper::numberOfHitsRPC_
private

Definition at line 49 of file JetMuonHitsIDHelper.h.

Referenced by numberOfHitsRPC().

edm::InputTag reco::helper::JetMuonHitsIDHelper::rpcRecHits_
private

Definition at line 42 of file JetMuonHitsIDHelper.h.