CMS 3D CMS Logo

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

#include <L2MuonCandidateProducer.h>

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

Public Member Functions

 L2MuonCandidateProducer (const edm::ParameterSet &)
 constructor with config More...
 
void produce (edm::StreamID sid, edm::Event &event, const edm::EventSetup &) const override
 produce candidates More...
 
 ~L2MuonCandidateProducer () 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::vector< ModuleDescription const * > &modules, 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 Attributes

edm::InputTag theSACollectionLabel
 
edm::EDGetTokenT< reco::TrackCollectiontracksToken
 

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

Intermediate step in the L2 muons selection. This class takes the L2 muons (which are reco::Tracks) and creates the correspondent reco::RecoChargedCandidate.

Riccardo's comment: The separation between the L2MuonProducer and this class allows the interchangeability of the L2MuonProducer and the StandAloneMuonProducer This class is supposed to be removed once the L2/STA comparison will be done, then the RecoChargedCandidate production will be put into the L2MuonProducer class.

Author
J.Alcaraz

Intermediate step in the L2 muons selection. This class takes the L2 muons (which are reco::Tracks) and creates the correspondent reco::RecoChargedCandidate.

Riccardo's comment: The separation between the L2MuonProducer and this class allows the interchangeability of the L2MuonProducer and the StandAloneMuonProducer This class is supposed to be removed once the L2/STA comparison will be done, then the RecoChargedCandidate production will be done into the L2MuonProducer class.

Author
J.Alcaraz

Definition at line 32 of file L2MuonCandidateProducer.h.

Constructor & Destructor Documentation

◆ L2MuonCandidateProducer()

L2MuonCandidateProducer::L2MuonCandidateProducer ( const edm::ParameterSet parameterSet)

constructor with config

Definition at line 38 of file L2MuonCandidateProducer.cc.

38  {
39  LogTrace("Muon|RecoMuon|L2MuonCandidateProducer") << " constructor called";
40 
41  // StandAlone Collection Label
43  tracksToken = consumes<reco::TrackCollection>(theSACollectionLabel);
44  produces<RecoChargedCandidateCollection>();
45 }

References edm::ParameterSet::getParameter(), LogTrace, and edm::parameterSet().

◆ ~L2MuonCandidateProducer()

L2MuonCandidateProducer::~L2MuonCandidateProducer ( )
override

destructor

Definition at line 48 of file L2MuonCandidateProducer.cc.

48  {
49  LogTrace("Muon|RecoMuon|L2MuonCandidateProducer") << " L2MuonCandidateProducer destructor called";
50 }

References LogTrace.

Member Function Documentation

◆ produce()

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

produce candidates

reconstruct muons

Implements edm::global::EDProducerBase.

Definition at line 53 of file L2MuonCandidateProducer.cc.

53  {
54  const string metname = "Muon|RecoMuon|L2MuonCandidateProducer";
55 
56  // Take the SA container
57  LogTrace(metname) << " Taking the StandAlone muons: " << theSACollectionLabel;
59  event.getByToken(tracksToken, tracks);
60 
61  // Create a RecoChargedCandidate collection
62  LogTrace(metname) << " Creating the RecoChargedCandidate collection";
63  auto candidates = std::make_unique<RecoChargedCandidateCollection>();
64 
65  for (unsigned int i = 0; i < tracks->size(); i++) {
66  TrackRef tkref(tracks, i);
67  Particle::Charge q = tkref->charge();
68  Particle::LorentzVector p4(tkref->px(), tkref->py(), tkref->pz(), tkref->p());
69  Particle::Point vtx(tkref->vx(), tkref->vy(), tkref->vz());
70  int pid = 13;
71  if (abs(q) == 1)
72  pid = q < 0 ? 13 : -13;
73  else
74  LogWarning(metname) << "L2MuonCandidate has charge = " << q;
76  cand.setTrack(tkref);
77  candidates->push_back(cand);
78  }
79 
80  event.put(std::move(candidates));
81 
82  LogTrace(metname) << " Event loaded"
83  << "================================";
84 }

References funct::abs(), HLT_FULL_cff::candidates, PixelTestBeamValidation_cfi::Charge, mps_fire::i, LogTrace, metname, eostools::move(), p4, submitPVResolutionJobs::q, PDWG_EXOHSCP_cff::tracks, and extraflags_cff::vtx.

Member Data Documentation

◆ theSACollectionLabel

edm::InputTag L2MuonCandidateProducer::theSACollectionLabel
private

Definition at line 45 of file L2MuonCandidateProducer.h.

◆ tracksToken

edm::EDGetTokenT<reco::TrackCollection> L2MuonCandidateProducer::tracksToken
private

Definition at line 46 of file L2MuonCandidateProducer.h.

PDWG_EXOHSCP_cff.tracks
tracks
Definition: PDWG_EXOHSCP_cff.py:28
mps_fire.i
i
Definition: mps_fire.py:428
L2MuonCandidateProducer::tracksToken
edm::EDGetTokenT< reco::TrackCollection > tracksToken
Definition: L2MuonCandidateProducer.h:46
edm::Handle
Definition: AssociativeIterator.h:50
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
edm::Ref< TrackCollection >
Point
math::XYZPoint Point
Definition: TrackerDpgAnalysis.cc:106
cand
Definition: decayParser.h:32
p4
double p4[4]
Definition: TauolaWrapper.h:92
reco::RecoChargedCandidate
Definition: RecoChargedCandidate.h:15
submitPVResolutionJobs.q
q
Definition: submitPVResolutionJobs.py:84
reco::JetExtendedAssociation::LorentzVector
math::PtEtaPhiELorentzVectorF LorentzVector
Definition: JetExtendedAssociation.h:25
eostools.move
def move(src, dest)
Definition: eostools.py:511
extraflags_cff.vtx
vtx
Definition: extraflags_cff.py:18
HLT_FULL_cff.candidates
candidates
Definition: HLT_FULL_cff.py:54985
edm::parameterSet
ParameterSet const & parameterSet(Provenance const &provenance, ProcessHistory const &history)
Definition: Provenance.cc:11
PixelTestBeamValidation_cfi.Charge
Charge
Definition: PixelTestBeamValidation_cfi.py:91
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:224
L2MuonCandidateProducer::theSACollectionLabel
edm::InputTag theSACollectionLabel
Definition: L2MuonCandidateProducer.h:45
edm::InputTag
Definition: InputTag.h:15
metname
const std::string metname
Definition: MuonSeedOrcaPatternRecognition.cc:40