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
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () 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
 
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)
 
 ~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
 
ESProxyIndex const * esGetTokenIndices (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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
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::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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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

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 28 of file L2MuonCandidateProducer.h.

Constructor & Destructor Documentation

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

constructor with config

Definition at line 38 of file L2MuonCandidateProducer.cc.

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

38  {
39  LogTrace("Muon|RecoMuon|L2MuonCandidateProducer")<<" constructor called";
40 
41  // StandAlone Collection Label
42  theSACollectionLabel = parameterSet.getParameter<InputTag>("InputObjects");
43  tracksToken = consumes<reco::TrackCollection>(theSACollectionLabel);
44  produces<RecoChargedCandidateCollection>();
45 }
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::TrackCollection > tracksToken
#define LogTrace(id)
L2MuonCandidateProducer::~L2MuonCandidateProducer ( )
override

destructor

Definition at line 48 of file L2MuonCandidateProducer.cc.

References LogTrace.

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

Member Function Documentation

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

produce candidates

reconstruct muons

Definition at line 54 of file L2MuonCandidateProducer.cc.

References funct::abs(), objects.IsoTrackAnalyzer::candidates, mps_fire::i, LogTrace, metname, eostools::move(), p4, sysUtil::pid, lumiQueryAPI::q, reco::RecoChargedCandidate::setTrack(), l1t::tracks, and badGlobalMuonTaggersAOD_cff::vtx.

54  {
55  const string metname = "Muon|RecoMuon|L2MuonCandidateProducer";
56 
57  // Take the SA container
58  LogTrace(metname)<<" Taking the StandAlone muons: "<<theSACollectionLabel;
60  event.getByToken(tracksToken,tracks);
61 
62  // Create a RecoChargedCandidate collection
63  LogTrace(metname)<<" Creating the RecoChargedCandidate collection";
64  auto candidates = std::make_unique<RecoChargedCandidateCollection>();
65 
66  for (unsigned int i=0; i<tracks->size(); i++) {
67  TrackRef tkref(tracks,i);
68  Particle::Charge q = tkref->charge();
69  Particle::LorentzVector p4(tkref->px(), tkref->py(), tkref->pz(), tkref->p());
70  Particle::Point vtx(tkref->vx(),tkref->vy(), tkref->vz());
71  int pid = 13;
72  if(abs(q)==1) pid = q < 0 ? 13 : -13;
73  else LogWarning(metname) << "L2MuonCandidate has charge = "<<q;
74  RecoChargedCandidate cand(q, p4, vtx, pid);
75  cand.setTrack(tkref);
76  candidates->push_back(cand);
77  }
78 
79  event.put(std::move(candidates));
80 
81  LogTrace(metname)<<" Event loaded"
82  <<"================================";
83 }
const std::string metname
edm::EDGetTokenT< reco::TrackCollection > tracksToken
std::pair< double, double > Point
Definition: CaloEllipse.h:18
double p4[4]
Definition: TauolaWrapper.h:92
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
#define LogTrace(id)
def move(src, dest)
Definition: eostools.py:511
math::PtEtaPhiELorentzVectorF LorentzVector

Member Data Documentation

edm::InputTag L2MuonCandidateProducer::theSACollectionLabel
private

Definition at line 44 of file L2MuonCandidateProducer.h.

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

Definition at line 45 of file L2MuonCandidateProducer.h.