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
L3MuonProducer Class Reference

#include <L3MuonProducer.h>

Inheritance diagram for L3MuonProducer:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 L3MuonProducer (const edm::ParameterSet &)
 constructor with config More...
 
virtual void produce (edm::Event &, const edm::EventSetup &) override
 reconstruct muons More...
 
virtual ~L3MuonProducer ()
 destructor More...
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::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::EDGetTokenT
< TrajTrackAssociationCollection
l2AssoMapToken_
 
edm::EDGetTokenT
< reco::TrackCollection
l2MuonToken_
 
edm::EDGetTokenT< std::vector
< Trajectory > > 
l2MuonTrajToken_
 
edm::InputTag theL2CollectionLabel
 Seed STA Label. More...
 
std::string theL2SeededTkLabel
 Label for L2SeededTracks. More...
 
MuonServiceProxytheService
 the event setup proxy, it takes care the services update More...
 
MuonTrackFindertheTrackFinder
 
edm::EDGetTokenT
< reco::TrackToTrackMap
updatedL2AssoMapToken_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::stream::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

L3 muon reconstructor: reconstructs muons using DT, CSC, RPC and tracker information,
starting from a L2 reonstructed muon.

Author
A. Everett - Purdue University

Definition at line 31 of file L3MuonProducer.h.

Constructor & Destructor Documentation

L3MuonProducer::L3MuonProducer ( const edm::ParameterSet parameterSet)

constructor with config

Definition at line 33 of file L3MuonProducer.cc.

References edm::ParameterSet::getParameter(), LogTrace, MuonServiceProxy_cff::MuonServiceProxy, and AlCaHLTBitMon_QueryRunRegistry::string.

33  {
34 
35  LogTrace("L3MuonProducer") << "constructor called" << endl;
36 
37  // Parameter set for the Builder
38  ParameterSet trajectoryBuilderParameters = parameterSet.getParameter<ParameterSet>("L3TrajBuilderParameters");
39 
40  // L2 Muon Collection Label
41  theL2CollectionLabel = parameterSet.getParameter<InputTag>("MuonCollectionLabel");
42  l2MuonToken_ = consumes<reco::TrackCollection>(theL2CollectionLabel);
43  l2MuonTrajToken_ = consumes<std::vector<Trajectory> >(theL2CollectionLabel.label());
44  l2AssoMapToken_ = consumes<TrajTrackAssociationCollection>(theL2CollectionLabel.label());
45  updatedL2AssoMapToken_ = consumes<reco::TrackToTrackMap>(theL2CollectionLabel.label());
46 
47  // service parameters
48  ParameterSet serviceParameters = parameterSet.getParameter<ParameterSet>("ServiceParameters");
49 
50  // TrackLoader parameters
51  ParameterSet trackLoaderParameters = parameterSet.getParameter<ParameterSet>("TrackLoaderParameters");
52 
53  // the services
54  theService = new MuonServiceProxy(serviceParameters);
56 
57  // instantiate the concrete trajectory builder in the Track Finder
58  MuonTrackLoader* mtl = new MuonTrackLoader(trackLoaderParameters,iC,theService);
59  L3MuonTrajectoryBuilder* l3mtb = new L3MuonTrajectoryBuilder(trajectoryBuilderParameters, theService,iC);
60  theTrackFinder = new MuonTrackFinder(l3mtb, mtl);
61 
62  theL2SeededTkLabel = trackLoaderParameters.getUntrackedParameter<std::string>("MuonSeededTracksInstance",std::string());
63 
64  produces<reco::TrackCollection>(theL2SeededTkLabel);
65  produces<TrackingRecHitCollection>(theL2SeededTkLabel);
66  produces<reco::TrackExtraCollection>(theL2SeededTkLabel);
67  produces<vector<Trajectory> >(theL2SeededTkLabel) ;
68  produces<TrajTrackAssociationCollection>(theL2SeededTkLabel);
69 
70  produces<reco::TrackCollection>();
71  produces<TrackingRecHitCollection>();
72  produces<reco::TrackExtraCollection>();
73  produces<vector<Trajectory> >() ;
74  produces<TrajTrackAssociationCollection>();
75 
76  produces<reco::MuonTrackLinksCollection>();
77 
78 }
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::TrackToTrackMap > updatedL2AssoMapToken_
edm::EDGetTokenT< reco::TrackCollection > l2MuonToken_
MuonServiceProxy * theService
the event setup proxy, it takes care the services update
MuonTrackFinder * theTrackFinder
edm::EDGetTokenT< std::vector< Trajectory > > l2MuonTrajToken_
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
#define LogTrace(id)
edm::EDGetTokenT< TrajTrackAssociationCollection > l2AssoMapToken_
edm::InputTag theL2CollectionLabel
Seed STA Label.
std::string theL2SeededTkLabel
Label for L2SeededTracks.
L3MuonProducer::~L3MuonProducer ( )
virtual

destructor

Definition at line 84 of file L3MuonProducer.cc.

References LogTrace.

84  {
85 
86  LogTrace("L3MuonProducer") << "destructor called" << endl;
87  if (theService) delete theService;
88  if (theTrackFinder) delete theTrackFinder;
89 
90 }
MuonServiceProxy * theService
the event setup proxy, it takes care the services update
MuonTrackFinder * theTrackFinder
#define LogTrace(id)

Member Function Documentation

void L3MuonProducer::produce ( edm::Event event,
const edm::EventSetup eventSetup 
)
overridevirtual

reconstruct muons

Implements edm::stream::EDProducerBase.

Definition at line 96 of file L3MuonProducer.cc.

References edm::AssociationMap< edm::OneToOne< std::vector< Trajectory >, reco::TrackCollection, unsigned short > >::const_iterator, edm::AssociationMap< edm::OneToOne< reco::TrackCollection, reco::TrackCollection > >::const_iterator, edm::Ref< C, T, F >::isNonnull(), edm::Ref< C, T, F >::key(), L2Muons_cfi::L2Muons, LogTrace, and metname.

96  {
97  const string metname = "Muon|RecoMuon|L3MuonProducer";
98  LogTrace(metname)<<endl<<endl<<endl;
99  LogTrace(metname)<<"L3 Muon Reconstruction started"<<endl;
100 
101  typedef vector<Trajectory> TrajColl;
102 
103  // Update the services
104  theService->update(eventSetup);
105 
106  // Take the L2 muon container(s)
107  LogTrace(metname)<<"Taking the L2 Muons "<<theL2CollectionLabel<<endl;
108 
109 
111  event.getByToken(l2MuonToken_,L2Muons);
112 
113  Handle<vector<Trajectory> > L2MuonsTraj;
114  vector<MuonTrajectoryBuilder::TrackCand> L2TrackCands;
115 
116 
117  event.getByToken(l2MuonTrajToken_, L2MuonsTraj);
118 
120  event.getByToken(l2AssoMapToken_,L2AssoMap);
121 
122  edm::Handle<reco::TrackToTrackMap> updatedL2AssoMap;
123  event.getByToken(updatedL2AssoMapToken_,updatedL2AssoMap);
124 
125 
126 
127  for(TrajTrackAssociationCollection::const_iterator it = L2AssoMap->begin(); it != L2AssoMap->end(); ++it){
128  const Ref<vector<Trajectory> > traj = it->key;
129  const reco::TrackRef tkRegular = it->val;
130  reco::TrackRef tkUpdated;
133  if ( theL2CollectionLabel.instance() == "UpdatedAtVtx") {
134  iEnd = updatedL2AssoMap->end();
135  iii = updatedL2AssoMap->find(it->val);
136  if (iii != iEnd ) tkUpdated = (*updatedL2AssoMap)[it->val] ;
137  }
138 
139  const reco::TrackRef tk = ( tkUpdated.isNonnull() ) ? tkUpdated : tkRegular ;
140 
142  if( traj->isValid() ) L2Cand.first = &*traj ;
143  L2TrackCands.push_back(L2Cand);
144  }
145 
146  theTrackFinder->reconstruct(L2TrackCands, event);
147 
148  LogTrace(metname)<<"Event loaded"
149  <<"================================"
150  <<endl<<endl;
151 
152 }
edm::EDGetTokenT< reco::TrackToTrackMap > updatedL2AssoMapToken_
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:250
std::pair< const Trajectory *, reco::TrackRef > TrackCand
edm::EDGetTokenT< reco::TrackCollection > l2MuonToken_
const std::string metname
MuonServiceProxy * theService
the event setup proxy, it takes care the services update
MuonTrackFinder * theTrackFinder
key_type key() const
Accessor for product key.
Definition: Ref.h:266
edm::EDGetTokenT< std::vector< Trajectory > > l2MuonTrajToken_
tuple L2Muons
Definition: L2Muons_cfi.py:6
#define LogTrace(id)
edm::EDGetTokenT< TrajTrackAssociationCollection > l2AssoMapToken_
edm::InputTag theL2CollectionLabel
Seed STA Label.
std::string const & instance() const
Definition: InputTag.h:43
edm::OrphanHandle< reco::TrackCollection > reconstruct(const edm::Handle< edm::View< TrajectorySeed > > &, edm::Event &)
reconstruct standalone tracks starting from a collection of seeds

Member Data Documentation

edm::EDGetTokenT<TrajTrackAssociationCollection> L3MuonProducer::l2AssoMapToken_
private

Definition at line 55 of file L3MuonProducer.h.

edm::EDGetTokenT<reco::TrackCollection> L3MuonProducer::l2MuonToken_
private

Definition at line 53 of file L3MuonProducer.h.

edm::EDGetTokenT<std::vector<Trajectory> > L3MuonProducer::l2MuonTrajToken_
private

Definition at line 54 of file L3MuonProducer.h.

edm::InputTag L3MuonProducer::theL2CollectionLabel
private

Seed STA Label.

Definition at line 48 of file L3MuonProducer.h.

std::string L3MuonProducer::theL2SeededTkLabel
private

Label for L2SeededTracks.

Definition at line 51 of file L3MuonProducer.h.

MuonServiceProxy* L3MuonProducer::theService
private

the event setup proxy, it takes care the services update

Definition at line 61 of file L3MuonProducer.h.

MuonTrackFinder* L3MuonProducer::theTrackFinder
private

Definition at line 58 of file L3MuonProducer.h.

edm::EDGetTokenT<reco::TrackToTrackMap> L3MuonProducer::updatedL2AssoMapToken_
private

Definition at line 56 of file L3MuonProducer.h.