CMS 3D CMS Logo

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, edm::ConsumesCollector &&iC)
 
int numberOfHits1RPC () const
 
int numberOfHits2RPC () const
 
int numberOfHits3RPC () const
 
int numberOfHits4RPC () const
 
int numberOfHitsRPC () const
 
 ~JetMuonHitsIDHelper ()
 

Private Attributes

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

Detailed Description

Definition at line 18 of file JetMuonHitsIDHelper.h.

Constructor & Destructor Documentation

◆ JetMuonHitsIDHelper() [1/2]

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

Definition at line 21 of file JetMuonHitsIDHelper.h.

21 {}

◆ JetMuonHitsIDHelper() [2/2]

reco::helper::JetMuonHitsIDHelper::JetMuonHitsIDHelper ( edm::ParameterSet const &  pset,
edm::ConsumesCollector &&  iC 
)

Definition at line 32 of file JetMuonHitsIDHelper.cc.

32  {
33  isRECO_ = true; // This will be "true" initially, then if the product isn't found, set to false once
38  numberOfHitsRPC_ = 0;
39  rpcRecHits_ = pset.getParameter<edm::InputTag>("rpcRecHits");
40 
42 }

References muonDTDigis_cfi::pset.

◆ ~JetMuonHitsIDHelper()

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

Definition at line 23 of file JetMuonHitsIDHelper.h.

23 {}

Member Function Documentation

◆ calculate()

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

Definition at line 44 of file JetMuonHitsIDHelper.cc.

47  {
48  // initialize
53  numberOfHitsRPC_ = 0;
54 
55  if (isRECO_) { // This will be "true" initially, then if the product isn't found, set to false once
56 
57  // Get tracking geometry
59  iSetup.get<GlobalTrackingGeometryRecord>().get(trackingGeometry);
60 
61  //####READ RPC RecHits Collection########
62  //#In config: RpcRecHits = cms.InputTag("rpcRecHits")
63  edm::Handle<RPCRecHitCollection> rpcRecHits_handle;
64  event.getByToken(input_rpchits_token_, rpcRecHits_handle);
65 
66  if (!rpcRecHits_handle.isValid()) {
67  // don't throw exception if not running on RECO
68  edm::LogWarning("DataNotAvailable") << "JetMuonHitsIDHelper will not be run at all, this is not a RECO file.";
69  isRECO_ = false;
70  return;
71  }
72 
73  //####calculate rpc variables for each jet########
74 
75  for (RPCRecHitCollection::const_iterator itRPC = rpcRecHits_handle->begin(), itRPCEnd = rpcRecHits_handle->end();
76  itRPC != itRPCEnd;
77  ++itRPC) {
78  RPCRecHit const& hit = *itRPC;
79  DetId detid = hit.geographicalId();
80  LocalPoint lp = hit.localPosition();
81  const GeomDet* gd = trackingGeometry->idToDet(detid);
82  GlobalPoint gp = gd->toGlobal(lp);
83  double dR2 = reco::deltaR(jet.eta(), jet.phi(), static_cast<double>(gp.eta()), static_cast<double>(gp.phi()));
84  if (dR2 < 0.5) {
85  RPCDetId rpcChamberId = (RPCDetId)detid;
87  if (rpcChamberId.station() == 1)
89  if (rpcChamberId.station() == 2)
91  if (rpcChamberId.station() == 3)
93  if (rpcChamberId.station() == 4)
95  }
96  }
97  }
98 }

References reco::deltaR(), edm::EventSetup::get(), get, runTauDisplay::gp, GlobalTrackingGeometry::idToDet(), edm::HandleBase::isValid(), metsig::jet, RPCDetId::station(), and GeomDet::toGlobal().

Referenced by JetIDProducer::produce().

◆ fillDescription()

void reco::helper::JetMuonHitsIDHelper::fillDescription ( edm::ParameterSetDescription iDesc)

◆ initValues()

void reco::helper::JetMuonHitsIDHelper::initValues ( )

◆ numberOfHits1RPC()

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

Definition at line 33 of file JetMuonHitsIDHelper.h.

33 { return numberOfHits1RPC_; }

References numberOfHits1RPC_.

◆ numberOfHits2RPC()

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

Definition at line 34 of file JetMuonHitsIDHelper.h.

34 { return numberOfHits2RPC_; }

References numberOfHits2RPC_.

Referenced by JetIDProducer::produce().

◆ numberOfHits3RPC()

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

Definition at line 35 of file JetMuonHitsIDHelper.h.

35 { return numberOfHits3RPC_; }

References numberOfHits3RPC_.

Referenced by JetIDProducer::produce().

◆ numberOfHits4RPC()

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

Definition at line 36 of file JetMuonHitsIDHelper.h.

36 { return numberOfHits4RPC_; }

References numberOfHits4RPC_.

◆ numberOfHitsRPC()

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

Definition at line 37 of file JetMuonHitsIDHelper.h.

37 { return numberOfHitsRPC_; }

References numberOfHitsRPC_.

Referenced by JetIDProducer::produce().

Member Data Documentation

◆ input_rpchits_token_

edm::EDGetTokenT<RPCRecHitCollection> reco::helper::JetMuonHitsIDHelper::input_rpchits_token_
private

Definition at line 49 of file JetMuonHitsIDHelper.h.

◆ isRECO_

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

Definition at line 41 of file JetMuonHitsIDHelper.h.

◆ numberOfHits1RPC_

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

Definition at line 43 of file JetMuonHitsIDHelper.h.

Referenced by numberOfHits1RPC().

◆ numberOfHits2RPC_

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

Definition at line 44 of file JetMuonHitsIDHelper.h.

Referenced by numberOfHits2RPC().

◆ numberOfHits3RPC_

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

Definition at line 45 of file JetMuonHitsIDHelper.h.

Referenced by numberOfHits3RPC().

◆ numberOfHits4RPC_

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

Definition at line 46 of file JetMuonHitsIDHelper.h.

Referenced by numberOfHits4RPC().

◆ numberOfHitsRPC_

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

Definition at line 47 of file JetMuonHitsIDHelper.h.

Referenced by numberOfHitsRPC().

◆ rpcRecHits_

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

Definition at line 40 of file JetMuonHitsIDHelper.h.

RPCDetId::station
int station() const
Definition: RPCDetId.h:78
GeomDet
Definition: GeomDet.h:27
RPCDetId
Definition: RPCDetId.h:16
GlobalTrackingGeometryRecord
Definition: GlobalTrackingGeometryRecord.h:17
reco::helper::JetMuonHitsIDHelper::numberOfHits3RPC_
int numberOfHits3RPC_
Definition: JetMuonHitsIDHelper.h:45
reco::helper::JetMuonHitsIDHelper::numberOfHits1RPC_
int numberOfHits1RPC_
Definition: JetMuonHitsIDHelper.h:43
edm::Handle< RPCRecHitCollection >
reco::helper::JetMuonHitsIDHelper::input_rpchits_token_
edm::EDGetTokenT< RPCRecHitCollection > input_rpchits_token_
Definition: JetMuonHitsIDHelper.h:49
DetId
Definition: DetId.h:17
reco::helper::JetMuonHitsIDHelper::rpcRecHits_
edm::InputTag rpcRecHits_
Definition: JetMuonHitsIDHelper.h:40
RPCRecHitCollection
RPCRecHit
Definition: RPCRecHit.h:14
edm::ESHandle< GlobalTrackingGeometry >
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:49
Point3DBase< float, LocalTag >
reco::helper::JetMuonHitsIDHelper::numberOfHits2RPC_
int numberOfHits2RPC_
Definition: JetMuonHitsIDHelper.h:44
edm::LogWarning
Definition: MessageLogger.h:141
runTauDisplay.gp
gp
Definition: runTauDisplay.py:431
GeomDet::toGlobal
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:49
edm::RangeMap::const_iterator
C::const_iterator const_iterator
constant access iterator type
Definition: RangeMap.h:43
reco::get
T get(const Candidate &c)
Definition: component.h:60
reco::helper::JetMuonHitsIDHelper::isRECO_
bool isRECO_
Definition: JetMuonHitsIDHelper.h:41
metsig::jet
Definition: SignAlgoResolutions.h:47
reco::helper::JetMuonHitsIDHelper::numberOfHits4RPC_
int numberOfHits4RPC_
Definition: JetMuonHitsIDHelper.h:46
GlobalTrackingGeometry::idToDet
const GeomDet * idToDet(DetId) const override
Definition: GlobalTrackingGeometry.cc:44
reco::deltaR
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:30
reco::helper::JetMuonHitsIDHelper::numberOfHitsRPC_
int numberOfHitsRPC_
Definition: JetMuonHitsIDHelper.h:47
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
edm::InputTag
Definition: InputTag.h:15
hit
Definition: SiStripHitEffFromCalibTree.cc:88
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27