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
 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 (const std::string &iProcessName, std::vector< const char * > &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
 
- 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: 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 123 of file HLTScoutingMuonProducer.cc.

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

123  {
125  desc.add<edm::InputTag>("ChargedCandidates", edm::InputTag("hltL3MuonCandidates"));
126  desc.add<edm::InputTag>("Tracks", edm::InputTag("hltL3Muons"));
127  desc.add<edm::InputTag>("EcalPFClusterIsoMap", edm::InputTag("hltMuonEcalPFClusterIsoForMuons"));
128  desc.add<edm::InputTag>("HcalPFClusterIsoMap", edm::InputTag("hltMuonHcalPFClusterIsoForMuons"));
129  desc.add<edm::InputTag>("TrackIsoMap", edm::InputTag(
130  "hltMuonTkRelIsolationCut0p09Map:combinedRelativeIsoDeposits"));
131  desc.add<double>("muonPtCut", 4.0);
132  desc.add<double>("muonEtaCut", 2.4);
133  descriptions.add("scoutingMuonProducer", desc);
134 }
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(), metsig::muon, muonEtaCut, muonPtCut, edm::Event::put(), TrackCollection_, and TrackIsoMap_.

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