CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
L2MuonCandidateProducer Class Reference
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::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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
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 done into the L2MuonProducer class.

Author
J.Alcaraz

Definition at line 32 of file L2MuonCandidateProducer.cc.

Constructor & Destructor Documentation

◆ L2MuonCandidateProducer()

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

constructor with config

Definition at line 50 of file L2MuonCandidateProducer.cc.

50  {
51  LogTrace("Muon|RecoMuon|L2MuonCandidateProducer") << " constructor called";
52 
53  // StandAlone Collection Label
55  tracksToken = consumes<reco::TrackCollection>(theSACollectionLabel);
56  produces<reco::RecoChargedCandidateCollection>();
57 }

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

◆ ~L2MuonCandidateProducer()

L2MuonCandidateProducer::~L2MuonCandidateProducer ( )
override

destructor

Definition at line 60 of file L2MuonCandidateProducer.cc.

60  {
61  LogTrace("Muon|RecoMuon|L2MuonCandidateProducer") << " L2MuonCandidateProducer destructor called";
62 }

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 65 of file L2MuonCandidateProducer.cc.

65  {
66  const std::string metname = "Muon|RecoMuon|L2MuonCandidateProducer";
67 
68  // Take the SA container
69  LogTrace(metname) << " Taking the StandAlone muons: " << theSACollectionLabel;
71  event.getByToken(tracksToken, tracks);
72 
73  // Create a RecoChargedCandidate collection
74  LogTrace(metname) << " Creating the RecoChargedCandidate collection";
75  auto candidates = std::make_unique<reco::RecoChargedCandidateCollection>();
76 
77  for (unsigned int i = 0; i < tracks->size(); i++) {
78  reco::TrackRef tkref(tracks, i);
79  reco::Particle::Charge q = tkref->charge();
80  reco::Particle::LorentzVector p4(tkref->px(), tkref->py(), tkref->pz(), tkref->p());
81  reco::Particle::Point vtx(tkref->vx(), tkref->vy(), tkref->vz());
82  int pid = 13;
83  if (abs(q) == 1)
84  pid = q < 0 ? 13 : -13;
85  else
86  edm::LogWarning(metname) << "L2MuonCandidate has charge = " << q;
88  cand.setTrack(tkref);
89  candidates->push_back(cand);
90  }
91 
92  event.put(std::move(candidates));
93 
94  LogTrace(metname) << " Event loaded"
95  << "================================";
96 }

References funct::abs(), HLT_FULL_cff::candidates, mps_fire::i, LogTrace, metname, eostools::move(), p4, submitPVResolutionJobs::q, AlCaHLTBitMon_QueryRunRegistry::string, theSACollectionLabel, tracks, tracksToken, and extraflags_cff::vtx.

Member Data Documentation

◆ theSACollectionLabel

edm::InputTag L2MuonCandidateProducer::theSACollectionLabel
private

Definition at line 45 of file L2MuonCandidateProducer.cc.

Referenced by L2MuonCandidateProducer(), and produce().

◆ tracksToken

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

Definition at line 46 of file L2MuonCandidateProducer.cc.

Referenced by L2MuonCandidateProducer(), and produce().

mps_fire.i
i
Definition: mps_fire.py:428
L2MuonCandidateProducer::tracksToken
edm::EDGetTokenT< reco::TrackCollection > tracksToken
Definition: L2MuonCandidateProducer.cc:46
edm::Handle< reco::TrackCollection >
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
reco::Particle::LorentzVector
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Particle.h:21
edm::Ref< TrackCollection >
edm::parameterSet
ParameterSet const & parameterSet(StableProvenance const &provenance, ProcessHistory const &history)
Definition: Provenance.cc:11
tracks
const uint32_t *__restrict__ const HitContainer *__restrict__ TkSoA *__restrict__ tracks
Definition: CAHitNtupletGeneratorKernelsImpl.h:176
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
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
eostools.move
def move(src, dest)
Definition: eostools.py:511
extraflags_cff.vtx
vtx
Definition: extraflags_cff.py:19
HLT_FULL_cff.candidates
candidates
Definition: HLT_FULL_cff.py:55017
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
reco::Particle::Point
math::XYZPoint Point
point in the space
Definition: Particle.h:25
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:234
L2MuonCandidateProducer::theSACollectionLabel
edm::InputTag theSACollectionLabel
Definition: L2MuonCandidateProducer.cc:45
reco::Particle::Charge
int Charge
electric charge type
Definition: Particle.h:19
edm::InputTag
Definition: InputTag.h:15
metname
const std::string metname
Definition: MuonSeedOrcaPatternRecognition.cc:40