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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > 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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, 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::ESRecordsToProductResolverIndices 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
template<typename T >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
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<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
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)
 
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 ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 

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.

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

50  {
51  LogTrace("Muon|RecoMuon|L2MuonCandidateProducer") << " constructor called";
52 
53  // StandAlone Collection Label
55  tracksToken = consumes<reco::TrackCollection>(theSACollectionLabel);
56  produces<reco::RecoChargedCandidateCollection>();
57 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
edm::EDGetTokenT< reco::TrackCollection > tracksToken
ParameterSet const & parameterSet(StableProvenance const &provenance, ProcessHistory const &history)
Definition: Provenance.cc:11
#define LogTrace(id)

◆ ~L2MuonCandidateProducer()

L2MuonCandidateProducer::~L2MuonCandidateProducer ( )
override

destructor

Definition at line 60 of file L2MuonCandidateProducer.cc.

References LogTrace.

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

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.

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

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 }
const std::string metname
edm::EDGetTokenT< reco::TrackCollection > tracksToken
int Charge
electric charge type
Definition: Particle.h:19
#define LogTrace(id)
math::XYZPoint Point
point in the space
Definition: Particle.h:25
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
Log< level::Warning, false > LogWarning
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Particle.h:21
def move(src, dest)
Definition: eostools.py:511

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().