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 Types | Private Member Functions | Private Attributes
HLTScoutingMuonProducer Class Reference

#include <HLTrigger/Muon/src/HLTScoutingMuonProducer.cc>

Inheritance diagram for HLTScoutingMuonProducer:
edm::global::EDProducer<> edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 HLTScoutingMuonProducer (const edm::ParameterSet &)
 
 ~HLTScoutingMuonProducer ()
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 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
std::vector< ConsumesInfoconsumesInfo () const
 
 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 (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) 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::global::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Types

typedef edm::AssociationMap
< edm::OneToValue< std::vector
< reco::RecoChargedCandidate >
, float, unsigned int > > 
RecoChargedCandMap
 

Private Member Functions

virtual void produce (edm::StreamID sid, edm::Event &iEvent, edm::EventSetup const &setup) const overridefinal
 

Private Attributes

const edm::EDGetTokenT
< reco::RecoChargedCandidateCollection
ChargedCandidateCollection_
 
const edm::EDGetTokenT
< RecoChargedCandMap
EcalPFClusterIsoMap_
 
const edm::EDGetTokenT
< RecoChargedCandMap
HcalPFClusterIsoMap_
 
const double muonEtaCut
 
const double muonPtCut
 
const edm::EDGetTokenT
< reco::TrackCollection
TrackCollection_
 
const edm::EDGetTokenT
< edm::ValueMap< double > > 
TrackIsoMap_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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: Producer for ScoutingMuon

Definition at line 41 of file HLTScoutingMuonProducer.h.

Member Typedef Documentation

Definition at line 43 of file HLTScoutingMuonProducer.h.

Constructor & Destructor Documentation

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

Definition at line 22 of file HLTScoutingMuonProducer.cc.

22  :
23  ChargedCandidateCollection_(consumes<reco::RecoChargedCandidateCollection>
24  (iConfig.getParameter<edm::InputTag>("ChargedCandidates"))),
25  TrackCollection_(consumes<reco::TrackCollection>
26  (iConfig.getParameter<edm::InputTag>("Tracks"))),
27  EcalPFClusterIsoMap_(consumes<RecoChargedCandMap>(iConfig.getParameter<edm::InputTag>(
28  "EcalPFClusterIsoMap"))),
29  HcalPFClusterIsoMap_(consumes<RecoChargedCandMap>(iConfig.getParameter<edm::InputTag>(
30  "HcalPFClusterIsoMap"))),
32  "TrackIsoMap"))),
33  muonPtCut(iConfig.getParameter<double>("muonPtCut")),
34  muonEtaCut(iConfig.getParameter<double>("muonEtaCut"))
35 {
36  //register products
37  produces<ScoutingMuonCollection>();
38 }
T getParameter(std::string const &) const
const edm::EDGetTokenT< RecoChargedCandMap > EcalPFClusterIsoMap_
const edm::EDGetTokenT< reco::TrackCollection > TrackCollection_
const edm::EDGetTokenT< RecoChargedCandMap > HcalPFClusterIsoMap_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
const edm::EDGetTokenT< edm::ValueMap< double > > TrackIsoMap_
const edm::EDGetTokenT< reco::RecoChargedCandidateCollection > ChargedCandidateCollection_
HLTScoutingMuonProducer::~HLTScoutingMuonProducer ( )

Definition at line 40 of file HLTScoutingMuonProducer.cc.

41 { }

Member Function Documentation

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

Definition at line 119 of file HLTScoutingMuonProducer.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), and HLT_25ns10e33_v2_cff::InputTag.

119  {
121  desc.add<edm::InputTag>("ChargedCandidates", edm::InputTag("hltL3MuonCandidates"));
122  desc.add<edm::InputTag>("Tracks", edm::InputTag("hltL3Muons"));
123  desc.add<edm::InputTag>("EcalPFClusterIsoMap", edm::InputTag("hltMuonEcalPFClusterIsoForMuons"));
124  desc.add<edm::InputTag>("HcalPFClusterIsoMap", edm::InputTag("hltMuonHcalPFClusterIsoForMuons"));
125  desc.add<edm::InputTag>("TrackIsoMap", edm::InputTag(
126  "hltMuonTkRelIsolationCut0p09Map:combinedRelativeIsoDeposits"));
127  desc.add<double>("muonPtCut", 4.0);
128  desc.add<double>("muonEtaCut", 2.4);
129  descriptions.add("hltScoutingMuonProducer", desc);
130 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void HLTScoutingMuonProducer::produce ( edm::StreamID  sid,
edm::Event iEvent,
edm::EventSetup const &  setup 
) const
finaloverrideprivatevirtual

Implements edm::global::EDProducerBase.

Definition at line 44 of file HLTScoutingMuonProducer.cc.

References ChargedCandidateCollection_, EcalPFClusterIsoMap_, edm::Event::getByToken(), edm::getRef(), HcalPFClusterIsoMap_, cmsHarvester::index, edm::Ref< C, T, F >::isAvailable(), edm::Ref< C, T, F >::isNull(), eostools::move(), metsig::muon, muonEtaCut, muonPtCut, edm::Event::put(), TrackCollection_, and TrackIsoMap_.

46 {
47  using namespace edm;
48 
49  std::unique_ptr<ScoutingMuonCollection> outMuons(new ScoutingMuonCollection());
50 
51  // Get RecoChargedCandidate
52  Handle<reco::RecoChargedCandidateCollection> ChargedCandidateCollection;
53  if(!iEvent.getByToken(ChargedCandidateCollection_, ChargedCandidateCollection)){
54  iEvent.put(std::move(outMuons));
55  return;
56  }
57 
58  // Get Track
61  iEvent.put(std::move(outMuons));
62  return;
63  }
64 
65  // Get EcalPFClusterIsoMap
66  Handle<RecoChargedCandMap> EcalPFClusterIsoMap;
67  if(!iEvent.getByToken(EcalPFClusterIsoMap_, EcalPFClusterIsoMap)){
68  iEvent.put(std::move(outMuons));
69  return;
70  }
71 
72  // Get HcalPFClusterIsoMap
73  Handle<RecoChargedCandMap> HcalPFClusterIsoMap;
74  if(!iEvent.getByToken(HcalPFClusterIsoMap_, HcalPFClusterIsoMap)){
75  iEvent.put(std::move(outMuons));
76  return;
77  }
78 
79  // Get TrackIsoMap
80  Handle<ValueMap<double>> TrackIsoMap;
81  if(!iEvent.getByToken(TrackIsoMap_, TrackIsoMap)){
82  iEvent.put(std::move(outMuons));
83  return;
84  }
85 
86  // Produce muons
87  int index = 0;
88  for (auto &muon : *ChargedCandidateCollection) {
89  reco::RecoChargedCandidateRef muonRef = getRef(ChargedCandidateCollection, index);
90  ++index;
91  if (muonRef.isNull() || !muonRef.isAvailable())
92  continue;
93 
94  reco::TrackRef track = muon.track();
95  if (track.isNull() || !track.isAvailable())
96  continue;
97 
98  if (muon.pt() < muonPtCut)
99  continue;
100  if (fabs(muon.eta()) > muonEtaCut)
101  continue;
102 
103  outMuons->emplace_back(muon.pt(), muon.eta(), muon.phi(), muon.mass(),
104  (*EcalPFClusterIsoMap)[muonRef], (*HcalPFClusterIsoMap)[muonRef],
105  (*TrackIsoMap)[muonRef], track->chi2(), track->ndof(),
106  track->charge(), track->dxy(), track->dz(),
107  track->hitPattern().numberOfValidMuonHits(),
108  track->hitPattern().numberOfValidPixelHits(),
109  0, // nMatchedStations
110  track->hitPattern().trackerLayersWithMeasurement(),
111  2); // Global muon
112  }
113 
114  // Put output
115  iEvent.put(std::move(outMuons));
116 }
helper::MatcherGetRef< C >::ref_type getRef(const Handle< C > &c, size_t k)
Definition: getRef.h:28
bool isAvailable() const
Definition: Ref.h:576
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
const edm::EDGetTokenT< RecoChargedCandMap > EcalPFClusterIsoMap_
const edm::EDGetTokenT< reco::TrackCollection > TrackCollection_
const edm::EDGetTokenT< RecoChargedCandMap > HcalPFClusterIsoMap_
const edm::EDGetTokenT< edm::ValueMap< double > > TrackIsoMap_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
def move
Definition: eostools.py:510
std::vector< ScoutingMuon > ScoutingMuonCollection
Definition: ScoutingMuon.h:69
bool isNull() const
Checks for null.
Definition: Ref.h:249
const edm::EDGetTokenT< reco::RecoChargedCandidateCollection > ChargedCandidateCollection_

Member Data Documentation

const edm::EDGetTokenT<reco::RecoChargedCandidateCollection> HLTScoutingMuonProducer::ChargedCandidateCollection_
private

Definition at line 54 of file HLTScoutingMuonProducer.h.

Referenced by produce().

const edm::EDGetTokenT<RecoChargedCandMap> HLTScoutingMuonProducer::EcalPFClusterIsoMap_
private

Definition at line 56 of file HLTScoutingMuonProducer.h.

Referenced by produce().

const edm::EDGetTokenT<RecoChargedCandMap> HLTScoutingMuonProducer::HcalPFClusterIsoMap_
private

Definition at line 57 of file HLTScoutingMuonProducer.h.

Referenced by produce().

const double HLTScoutingMuonProducer::muonEtaCut
private

Definition at line 61 of file HLTScoutingMuonProducer.h.

Referenced by produce().

const double HLTScoutingMuonProducer::muonPtCut
private

Definition at line 60 of file HLTScoutingMuonProducer.h.

Referenced by produce().

const edm::EDGetTokenT<reco::TrackCollection> HLTScoutingMuonProducer::TrackCollection_
private

Definition at line 55 of file HLTScoutingMuonProducer.h.

Referenced by produce().

const edm::EDGetTokenT<edm::ValueMap<double> > HLTScoutingMuonProducer::TrackIsoMap_
private

Definition at line 58 of file HLTScoutingMuonProducer.h.

Referenced by produce().