CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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...
 
virtual void produce (edm::StreamID sid, edm::Event &event, const edm::EventSetup &) const override
 produce candidates More...
 
virtual ~L2MuonCandidateProducer ()
 destructor More...
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

edm::InputTag theSACollectionLabel
 
edm::EDGetTokenT
< reco::TrackCollection
tracksToken
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- 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
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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 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 ( )
virtual

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
overridevirtual

produce candidates

reconstruct muons

Implements edm::global::EDProducerBase.

Definition at line 54 of file L2MuonCandidateProducer.cc.

References funct::abs(), objects.IsoTrackAnalyzer::candidates, i, LogTrace, metname, p4, sysUtil::pid, lumiQueryAPI::q, reco::RecoChargedCandidate::setTrack(), and testEve_cfg::tracks.

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_ptr<RecoChargedCandidateCollection> candidates( new 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(candidates);
80 
81  LogTrace(metname)<<" Event loaded"
82  <<"================================";
83 }
int i
Definition: DBlmapReader.cc:9
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)
std::vector< RecoChargedCandidate > RecoChargedCandidateCollection
collectin of RecoChargedCandidate objects
tuple tracks
Definition: testEve_cfg.py:39
tuple pid
Definition: sysUtil.py:22
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.