CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
GlobalMuonToMuonProducer Class Reference

#include <GlobalMuonToMuonProducer.h>

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

Public Member Functions

 GlobalMuonToMuonProducer (const edm::ParameterSet &)
 Constructor. More...
 
void produce (edm::StreamID, edm::Event &, const edm::EventSetup &) const override
 reconstruct muons More...
 
 ~GlobalMuonToMuonProducer () override
 Destructor. More...
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void printTrackRecHits (const reco::Track &track, edm::ESHandle< GlobalTrackingGeometry > trackingGeometry) const
 
void setAlias (std::string alias)
 

Private Attributes

std::string theAlias
 
edm::InputTag theLinksCollectionLabel
 
edm::ESGetToken< GlobalTrackingGeometry, GlobalTrackingGeometryRecordtrackingGeomToken_
 
edm::EDGetTokenT< reco::MuonTrackLinksCollectiontrackLinkToken_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::global::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::ProducerBase
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

No description available.

Author
R. Bellan - INFN Torino ricca.nosp@m.rdo..nosp@m.bella.nosp@m.n@ce.nosp@m.rn.ch

Definition at line 25 of file GlobalMuonToMuonProducer.h.

Constructor & Destructor Documentation

◆ GlobalMuonToMuonProducer()

GlobalMuonToMuonProducer::GlobalMuonToMuonProducer ( const edm::ParameterSet pSet)

Constructor.

Definition at line 21 of file GlobalMuonToMuonProducer.cc.

21  {
22  theLinksCollectionLabel = pSet.getParameter<edm::InputTag>("InputObjects");
23 
24  setAlias(pSet.getParameter<std::string>("@module_label"));
25  produces<reco::MuonCollection>().setBranchAlias(theAlias + "s");
26  trackLinkToken_ = consumes<reco::MuonTrackLinksCollection>(theLinksCollectionLabel);
27  trackingGeomToken_ = esConsumes<GlobalTrackingGeometry, GlobalTrackingGeometryRecord>();
28 }

References edm::ParameterSet::getParameter(), setAlias(), AlCaHLTBitMon_QueryRunRegistry::string, theAlias, theLinksCollectionLabel, trackingGeomToken_, and trackLinkToken_.

◆ ~GlobalMuonToMuonProducer()

GlobalMuonToMuonProducer::~GlobalMuonToMuonProducer ( )
override

Destructor.

Definition at line 31 of file GlobalMuonToMuonProducer.cc.

31 {}

Member Function Documentation

◆ printTrackRecHits()

void GlobalMuonToMuonProducer::printTrackRecHits ( const reco::Track track,
edm::ESHandle< GlobalTrackingGeometry trackingGeometry 
) const
private

Definition at line 33 of file GlobalMuonToMuonProducer.cc.

34  {
35  const std::string metname = "Muon|RecoMuon|MuonIdentification|GlobalMuonToMuonProducer";
36 
37  LogTrace(metname) << "Valid RecHits: " << track.found() << " invalid RecHits: " << track.lost();
38 
39  int i = 0;
40  for (trackingRecHit_iterator recHit = track.recHitsBegin(); recHit != track.recHitsEnd(); ++recHit)
41  if ((*recHit)->isValid()) {
42  const GeomDet* geomDet = trackingGeometry->idToDet((*recHit)->geographicalId());
43  double r = geomDet->surface().position().perp();
44  double z = geomDet->toGlobal((*recHit)->localPosition()).z();
45  LogTrace(metname) << i++ << " r: " << r << " z: " << z << " " << geomDet->toGlobal((*recHit)->localPosition())
46  << std::endl;
47  }
48 }

References mps_fire::i, GlobalTrackingGeometry::idToDet(), LogTrace, metname, PV3DBase< T, PVType, FrameType >::perp(), GloballyPositioned< T >::position(), alignCSCRings::r, rpcPointValidation_cfi::recHit, AlCaHLTBitMon_QueryRunRegistry::string, GeomDet::surface(), GeomDet::toGlobal(), HLT_FULL_cff::track, and z.

Referenced by produce().

◆ produce()

void GlobalMuonToMuonProducer::produce ( edm::StreamID  ,
edm::Event event,
const edm::EventSetup eventSetup 
) const
overridevirtual

reconstruct muons

Implements edm::global::EDProducerBase.

Definition at line 51 of file GlobalMuonToMuonProducer.cc.

51  {
52  const std::string metname = "Muon|RecoMuon|MuonIdentification|GlobalMuonToMuonProducer";
53 
54  // the muon collection, it will be loaded in the event
55  auto muonCollection = std::make_unique<reco::MuonCollection>();
56 
58  event.getByToken(trackLinkToken_, linksCollection);
59 
60  if (linksCollection->empty()) {
61  event.put(std::move(muonCollection));
62  return;
63  }
64 
65  // Global Tracking Geometry
67 
68  for (reco::MuonTrackLinksCollection::const_iterator links = linksCollection->begin(); links != linksCollection->end();
69  ++links) {
70  // some temporary print-out
71  LogTrace(metname) << "trackerTrack";
72  printTrackRecHits(*(links->trackerTrack()), trackingGeometry);
73  LogTrace(metname) << "standAloneTrack";
74  printTrackRecHits(*(links->standAloneTrack()), trackingGeometry);
75  LogTrace(metname) << "globalTrack";
76  printTrackRecHits(*(links->globalTrack()), trackingGeometry);
77 
78  // Fill the muon
80  muon.setStandAlone(links->standAloneTrack());
81  muon.setTrack(links->trackerTrack());
82  muon.setCombined(links->globalTrack());
83 
84  // FIXME: can this break in case combined info cannot be added to some tracks?
85  muon.setCharge(links->globalTrack()->charge());
86 
87  //FIXME: E = sqrt(p^2 + m^2), where m == 0.105658369(9)GeV
88  double energy = sqrt(links->globalTrack()->p() * links->globalTrack()->p() + 0.011163691);
90  links->globalTrack()->px(), links->globalTrack()->py(), links->globalTrack()->pz(), energy);
91 
92  muon.setP4(p4);
93  muon.setVertex(links->globalTrack()->vertex());
94 
95  muonCollection->push_back(muon);
96  }
97 
98  event.put(std::move(muonCollection));
99 }

References HCALHighEnergyHPDFilter_cfi::energy, edm::EventSetup::getHandle(), electronStore::links, LogTrace, metname, eostools::move(), HLT_FULL_cff::muon, pdwgLeptonRecoSkim_cfi::muonCollection, p4, printTrackRecHits(), mathSSE::sqrt(), AlCaHLTBitMon_QueryRunRegistry::string, trackingGeomToken_, and trackLinkToken_.

◆ setAlias()

void GlobalMuonToMuonProducer::setAlias ( std::string  alias)
inlineprivate

Definition at line 40 of file GlobalMuonToMuonProducer.h.

40  {
41  alias.erase(alias.size() - 1, alias.size());
42  theAlias = alias;
43  }

References SiStripOfflineCRack_cfg::alias, and theAlias.

Referenced by GlobalMuonToMuonProducer().

Member Data Documentation

◆ theAlias

std::string GlobalMuonToMuonProducer::theAlias
private

Definition at line 38 of file GlobalMuonToMuonProducer.h.

Referenced by GlobalMuonToMuonProducer(), and setAlias().

◆ theLinksCollectionLabel

edm::InputTag GlobalMuonToMuonProducer::theLinksCollectionLabel
private

Definition at line 49 of file GlobalMuonToMuonProducer.h.

Referenced by GlobalMuonToMuonProducer().

◆ trackingGeomToken_

edm::ESGetToken<GlobalTrackingGeometry, GlobalTrackingGeometryRecord> GlobalMuonToMuonProducer::trackingGeomToken_
private

Definition at line 51 of file GlobalMuonToMuonProducer.h.

Referenced by GlobalMuonToMuonProducer(), and produce().

◆ trackLinkToken_

edm::EDGetTokenT<reco::MuonTrackLinksCollection> GlobalMuonToMuonProducer::trackLinkToken_
private

Definition at line 50 of file GlobalMuonToMuonProducer.h.

Referenced by GlobalMuonToMuonProducer(), and produce().

mps_fire.i
i
Definition: mps_fire.py:428
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11713
GeomDet
Definition: GeomDet.h:27
muon
Definition: MuonCocktails.h:17
GlobalMuonToMuonProducer::trackingGeomToken_
edm::ESGetToken< GlobalTrackingGeometry, GlobalTrackingGeometryRecord > trackingGeomToken_
Definition: GlobalMuonToMuonProducer.h:51
edm::Handle< reco::MuonTrackLinksCollection >
rpcPointValidation_cfi.recHit
recHit
Definition: rpcPointValidation_cfi.py:7
reco::Muon
Definition: Muon.h:27
GeomDet::surface
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
HLT_FULL_cff.muon
muon
Definition: HLT_FULL_cff.py:11710
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
DDAxes::z
edm::ESHandle< GlobalTrackingGeometry >
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition: HCALHighEnergyHPDFilter_cfi.py:5
GlobalMuonToMuonProducer::printTrackRecHits
void printTrackRecHits(const reco::Track &track, edm::ESHandle< GlobalTrackingGeometry > trackingGeometry) const
Definition: GlobalMuonToMuonProducer.cc:33
edm::OwnVector::const_iterator
Definition: OwnVector.h:41
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
GlobalMuonToMuonProducer::trackLinkToken_
edm::EDGetTokenT< reco::MuonTrackLinksCollection > trackLinkToken_
Definition: GlobalMuonToMuonProducer.h:50
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
p4
double p4[4]
Definition: TauolaWrapper.h:92
edm::EventSetup::getHandle
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:155
GlobalMuonToMuonProducer::setAlias
void setAlias(std::string alias)
Definition: GlobalMuonToMuonProducer.h:40
pdwgLeptonRecoSkim_cfi.muonCollection
muonCollection
Definition: pdwgLeptonRecoSkim_cfi.py:7
alignCSCRings.r
r
Definition: alignCSCRings.py:93
GloballyPositioned::position
const PositionType & position() const
Definition: GloballyPositioned.h:36
eostools.move
def move(src, dest)
Definition: eostools.py:511
math::XYZTLorentzVector
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
SiStripOfflineCRack_cfg.alias
alias
Definition: SiStripOfflineCRack_cfg.py:128
GlobalTrackingGeometry::idToDet
const GeomDet * idToDet(DetId) const override
Definition: GlobalTrackingGeometry.cc:44
electronStore.links
links
Definition: electronStore.py:149
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
GlobalMuonToMuonProducer::theLinksCollectionLabel
edm::InputTag theLinksCollectionLabel
Definition: GlobalMuonToMuonProducer.h:49
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:234
GlobalMuonToMuonProducer::theAlias
std::string theAlias
Definition: GlobalMuonToMuonProducer.h:38
PV3DBase::perp
T perp() const
Definition: PV3DBase.h:69
edm::InputTag
Definition: InputTag.h:15
metname
const std::string metname
Definition: MuonSeedOrcaPatternRecognition.cc:40