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::EDProducer 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 &)
 reconstruct muons More...
 
virtual ~L3MuonProducer ()
 destructor More...
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- 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
 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
 
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::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
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 34 of file L3MuonProducer.cc.

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

34  {
35 
36  LogTrace("L3MuonProducer") << "constructor called" << endl;
37 
38  // Parameter set for the Builder
39  ParameterSet trajectoryBuilderParameters = parameterSet.getParameter<ParameterSet>("L3TrajBuilderParameters");
40 
41  // L2 Muon Collection Label
42  theL2CollectionLabel = parameterSet.getParameter<InputTag>("MuonCollectionLabel");
43  l2MuonToken_ = consumes<reco::TrackCollection>(theL2CollectionLabel);
44  l2MuonTrajToken_ = consumes<std::vector<Trajectory> >(theL2CollectionLabel.label());
45  l2AssoMapToken_ = consumes<TrajTrackAssociationCollection>(theL2CollectionLabel.label());
46  updatedL2AssoMapToken_ = consumes<reco::TrackToTrackMap>(theL2CollectionLabel.label());
47 
48  // service parameters
49  ParameterSet serviceParameters = parameterSet.getParameter<ParameterSet>("ServiceParameters");
50 
51  // TrackLoader parameters
52  ParameterSet trackLoaderParameters = parameterSet.getParameter<ParameterSet>("TrackLoaderParameters");
53 
54  // the services
55  theService = new MuonServiceProxy(serviceParameters);
57 
58  // instantiate the concrete trajectory builder in the Track Finder
59  MuonTrackLoader* mtl = new MuonTrackLoader(trackLoaderParameters,iC,theService);
60  L3MuonTrajectoryBuilder* l3mtb = new L3MuonTrajectoryBuilder(trajectoryBuilderParameters, theService,iC);
61  theTrackFinder = new MuonTrackFinder(l3mtb, mtl);
62 
63  theL2SeededTkLabel = trackLoaderParameters.getUntrackedParameter<std::string>("MuonSeededTracksInstance",std::string());
64 
65  produces<reco::TrackCollection>(theL2SeededTkLabel);
66  produces<TrackingRecHitCollection>(theL2SeededTkLabel);
67  produces<reco::TrackExtraCollection>(theL2SeededTkLabel);
68  produces<vector<Trajectory> >(theL2SeededTkLabel) ;
69  produces<TrajTrackAssociationCollection>(theL2SeededTkLabel);
70 
71  produces<reco::TrackCollection>();
72  produces<TrackingRecHitCollection>();
73  produces<reco::TrackExtraCollection>();
74  produces<vector<Trajectory> >() ;
75  produces<TrajTrackAssociationCollection>();
76 
77  produces<reco::MuonTrackLinksCollection>();
78 
79 }
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 85 of file L3MuonProducer.cc.

References LogTrace.

85  {
86 
87  LogTrace("L3MuonProducer") << "destructor called" << endl;
88  if (theService) delete theService;
89  if (theTrackFinder) delete theTrackFinder;
90 
91 }
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 
)
virtual

reconstruct muons

Implements edm::EDProducer.

Definition at line 97 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.

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