CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
TevMuonProducer Class Reference

#include <TevMuonProducer.h>

Inheritance diagram for TevMuonProducer:
edm::stream::EDProducer<>

Public Member Functions

void produce (edm::Event &, const edm::EventSetup &) override
 reconstruct muons More...
 
 TevMuonProducer (const edm::ParameterSet &)
 constructor with config More...
 
 ~TevMuonProducer () override
 destructor More...
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Private Member Functions

void setAlias (std::string alias)
 

Private Attributes

edm::EDGetTokenT< reco::TrackCollectionglbMuonsToken
 
edm::EDGetTokenT< std::vector< Trajectory > > glbMuonsTrajToken
 
std::string theAlias
 
edm::InputTag theGLBCollectionLabel
 STA Label. More...
 
std::vector< int > theRefitIndex
 
std::vector< std::string > theRefits
 
std::unique_ptr< GlobalMuonRefittertheRefitter
 
std::unique_ptr< MuonServiceProxytheService
 the event setup proxy, it takes care the services update More...
 
std::unique_ptr< MuonTrackLoadertheTrackLoader
 

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, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

TeV muon reconstructor:

Author
Piotr Traczyk (SINS Warsaw)

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

Author
R.Bellan - INFN TO

Definition at line 43 of file TevMuonProducer.h.

Constructor & Destructor Documentation

◆ TevMuonProducer()

TevMuonProducer::TevMuonProducer ( const edm::ParameterSet parameterSet)

constructor with config

Definition at line 36 of file TevMuonProducer.cc.

36  {
37  LogDebug("Muon|RecoMuon|TevMuonProducer") << "constructor called" << endl;
38 
39  // GLB Muon Collection Label
40  theGLBCollectionLabel = parameterSet.getParameter<InputTag>("MuonCollectionLabel");
41  glbMuonsToken = consumes<reco::TrackCollection>(theGLBCollectionLabel);
42  glbMuonsTrajToken = consumes<std::vector<Trajectory> >(theGLBCollectionLabel.label());
43 
44  // service parameters
45  ParameterSet serviceParameters = parameterSet.getParameter<ParameterSet>("ServiceParameters");
46 
47  // the services
48  theService = std::make_unique<MuonServiceProxy>(serviceParameters, consumesCollector());
49  edm::ConsumesCollector iC = consumesCollector();
50 
51  // TrackRefitter parameters
52  ParameterSet refitterParameters = parameterSet.getParameter<ParameterSet>("RefitterParameters");
53  theRefitter = std::make_unique<GlobalMuonRefitter>(refitterParameters, theService.get(), iC);
54 
55  // TrackLoader parameters
56  ParameterSet trackLoaderParameters = parameterSet.getParameter<ParameterSet>("TrackLoaderParameters");
57  theTrackLoader = std::make_unique<MuonTrackLoader>(trackLoaderParameters, iC, theService.get());
58 
59  theRefits = parameterSet.getParameter<std::vector<std::string> >("Refits");
60  theRefitIndex = parameterSet.getParameter<std::vector<int> >("RefitIndex");
61 
62  for (unsigned int ww = 0; ww < theRefits.size(); ww++) {
63  LogDebug("Muon|RecoMuon|TevMuonProducer") << "Refit " << theRefits[ww];
64  produces<reco::TrackCollection>(theRefits[ww]);
65  produces<TrackingRecHitCollection>(theRefits[ww]);
66  produces<reco::TrackExtraCollection>(theRefits[ww]);
67  produces<vector<Trajectory> >(theRefits[ww]);
68  produces<TrajTrackAssociationCollection>(theRefits[ww]);
69  produces<reco::TrackToTrackMap>(theRefits[ww]);
70  }
71  produces<DYTestimators>("dytInfo");
72 }

References edm::ParameterSet::getParameter(), LogDebug, and edm::parameterSet().

◆ ~TevMuonProducer()

TevMuonProducer::~TevMuonProducer ( )
override

destructor

Definition at line 77 of file TevMuonProducer.cc.

77 { LogTrace("Muon|RecoMuon|TevMuonProducer") << "destructor called" << endl; }

References LogTrace.

Member Function Documentation

◆ produce()

void TevMuonProducer::produce ( edm::Event event,
const edm::EventSetup eventSetup 
)
override

reconstruct muons

Definition at line 82 of file TevMuonProducer.cc.

82  {
83  const string metname = "Muon|RecoMuon|TevMuonProducer";
84  LogTrace(metname) << endl << endl;
85  LogTrace(metname) << "TeV Muon Reconstruction started" << endl;
86 
87  // Update the services
88  theService->update(eventSetup);
89 
90  theRefitter->setEvent(event);
91 
92  theRefitter->setServices(theService->eventSetup());
93 
94  //Retrieve tracker topology from geometry
96  eventSetup.get<TrackerTopologyRcd>().get(tTopoHand);
97  const TrackerTopology* tTopo = tTopoHand.product();
98 
99  // Take the GLB muon container(s)
101  event.getByToken(glbMuonsToken, glbMuons);
102 
103  auto dytInfo = std::make_unique<DYTestimators>();
104  DYTestimators::Filler filler(*dytInfo);
105  size_t GLBmuonSize = glbMuons->size();
106  vector<DYTInfo> dytTmp(GLBmuonSize);
107 
108  Handle<vector<Trajectory> > glbMuonsTraj;
109 
110  LogTrace(metname) << "Taking " << glbMuons->size() << " Global Muons " << theGLBCollectionLabel << endl;
111 
112  vector<MuonTrajectoryBuilder::TrackCand> glbTrackCands;
113 
114  event.getByToken(glbMuonsTrajToken, glbMuonsTraj);
115 
116  const reco::TrackCollection* glbTracks = glbMuons.product();
117 
118  for (unsigned int ww = 0; ww < theRefits.size(); ww++) {
119  LogDebug(metname) << "TeVRefit for Refit: " << theRefitIndex[ww];
120  std::vector<std::pair<Trajectory*, reco::TrackRef> > miniMap;
122  reco::TrackRef::key_type trackIndex = 0;
123  int glbCounter = 0;
124  for (reco::TrackCollection::const_iterator track = glbTracks->begin(); track != glbTracks->end();
125  track++, ++trackIndex) {
126  reco::TrackRef glbRef(glbMuons, trackIndex);
127 
128  vector<Trajectory> refitted = theRefitter->refit(*track, theRefitIndex[ww], tTopo);
129 
130  if (theRefits[ww] == "dyt")
131  dytTmp[glbCounter] = *theRefitter->getDYTInfo();
132  glbCounter++;
133 
134  if (!refitted.empty()) {
135  auto refit = std::make_unique<Trajectory>(refitted.front());
136  LogDebug(metname) << "TeVTrackLoader for Refit: " << theRefits[ww];
137  std::pair<Trajectory*, reco::TrackRef> thisPair(refit.get(), glbRef);
138  miniMap.push_back(thisPair);
139  trajectories.push_back(std::move(refit));
140  }
141  }
142  theTrackLoader->loadTracks(trajectories, event, miniMap, glbMuons, *tTopo, theRefits[ww]);
143  }
144 
145  filler.insert(glbMuons, dytTmp.begin(), dytTmp.end());
146  filler.fill();
147  event.put(std::move(dytInfo), "dytInfo");
148 
149  LogTrace(metname) << "Done." << endl;
150 }

References options_cfi::eventSetup, trigObjTnPSource_cfi::filler, edm::get(), LogDebug, LogTrace, metname, eostools::move(), edm::Handle< T >::product(), edm::ESHandle< T >::product(), HLT_2018_cff::track, and FastTrackerRecHitMaskProducer_cfi::trajectories.

◆ setAlias()

void TevMuonProducer::setAlias ( std::string  alias)
inlineprivate

Definition at line 71 of file TevMuonProducer.h.

71  {
72  alias.erase(alias.size() - 1, alias.size());
73  theAlias = alias;
74  }

References SiStripOfflineCRack_cfg::alias, and theAlias.

Member Data Documentation

◆ glbMuonsToken

edm::EDGetTokenT<reco::TrackCollection> TevMuonProducer::glbMuonsToken
private

Definition at line 57 of file TevMuonProducer.h.

◆ glbMuonsTrajToken

edm::EDGetTokenT<std::vector<Trajectory> > TevMuonProducer::glbMuonsTrajToken
private

Definition at line 58 of file TevMuonProducer.h.

◆ theAlias

std::string TevMuonProducer::theAlias
private

Definition at line 67 of file TevMuonProducer.h.

Referenced by setAlias().

◆ theGLBCollectionLabel

edm::InputTag TevMuonProducer::theGLBCollectionLabel
private

STA Label.

Definition at line 56 of file TevMuonProducer.h.

◆ theRefitIndex

std::vector<int> TevMuonProducer::theRefitIndex
private

Definition at line 69 of file TevMuonProducer.h.

◆ theRefits

std::vector<std::string> TevMuonProducer::theRefits
private

Definition at line 68 of file TevMuonProducer.h.

◆ theRefitter

std::unique_ptr<GlobalMuonRefitter> TevMuonProducer::theRefitter
private

Definition at line 63 of file TevMuonProducer.h.

◆ theService

std::unique_ptr<MuonServiceProxy> TevMuonProducer::theService
private

the event setup proxy, it takes care the services update

Definition at line 61 of file TevMuonProducer.h.

◆ theTrackLoader

std::unique_ptr<MuonTrackLoader> TevMuonProducer::theTrackLoader
private

Definition at line 65 of file TevMuonProducer.h.

edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
edm::Handle::product
T const * product() const
Definition: Handle.h:70
TrackerTopology
Definition: TrackerTopology.h:16
TevMuonProducer::theRefitter
std::unique_ptr< GlobalMuonRefitter > theRefitter
Definition: TevMuonProducer.h:63
FastTrackerRecHitMaskProducer_cfi.trajectories
trajectories
Definition: FastTrackerRecHitMaskProducer_cfi.py:7
edm::Handle< reco::TrackCollection >
edm::Ref< TrackCollection >
edm::InputTag::label
std::string const & label() const
Definition: InputTag.h:36
edm::ESHandle< TrackerTopology >
TevMuonProducer::theGLBCollectionLabel
edm::InputTag theGLBCollectionLabel
STA Label.
Definition: TevMuonProducer.h:56
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
edm::ParameterSet
Definition: ParameterSet.h:36
trigObjTnPSource_cfi.filler
filler
Definition: trigObjTnPSource_cfi.py:21
TevMuonProducer::glbMuonsTrajToken
edm::EDGetTokenT< std::vector< Trajectory > > glbMuonsTrajToken
Definition: TevMuonProducer.h:58
get
#define get
edm::Ref< TrackCollection >::key_type
std::remove_cv< typename std::remove_reference< argument_type >::type >::type key_type
Definition: Ref.h:164
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
eostools.move
def move(src, dest)
Definition: eostools.py:511
TevMuonProducer::theAlias
std::string theAlias
Definition: TevMuonProducer.h:67
SiStripOfflineCRack_cfg.alias
alias
Definition: SiStripOfflineCRack_cfg.py:129
edm::parameterSet
ParameterSet const & parameterSet(Provenance const &provenance, ProcessHistory const &history)
Definition: Provenance.cc:11
options_cfi.eventSetup
eventSetup
Definition: options_cfi.py:12
TevMuonProducer::theRefits
std::vector< std::string > theRefits
Definition: TevMuonProducer.h:68
TevMuonProducer::theRefitIndex
std::vector< int > theRefitIndex
Definition: TevMuonProducer.h:69
HLT_2018_cff.track
track
Definition: HLT_2018_cff.py:10352
TevMuonProducer::glbMuonsToken
edm::EDGetTokenT< reco::TrackCollection > glbMuonsToken
Definition: TevMuonProducer.h:57
MuonTrackLoader::TrajectoryContainer
MuonCandidate::TrajectoryContainer TrajectoryContainer
Definition: MuonTrackLoader.h:45
edm::helper::Filler
Definition: ValueMap.h:22
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:671
TrackerTopologyRcd
Definition: TrackerTopologyRcd.h:10
event
Definition: event.py:1
edm::InputTag
Definition: InputTag.h:15
reco::TrackCollection
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
edm::ConsumesCollector
Definition: ConsumesCollector.h:39
TevMuonProducer::theService
std::unique_ptr< MuonServiceProxy > theService
the event setup proxy, it takes care the services update
Definition: TevMuonProducer.h:61
metname
const std::string metname
Definition: MuonSeedOrcaPatternRecognition.cc:43
TevMuonProducer::theTrackLoader
std::unique_ptr< MuonTrackLoader > theTrackLoader
Definition: TevMuonProducer.h:65