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 hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () 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
 
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcdtTopoToken
 

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 39 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  : tTopoToken(esConsumes()) {
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(), glbMuonsToken, glbMuonsTrajToken, edm::InputTag::label(), LogDebug, edm::parameterSet(), theGLBCollectionLabel, theRefitIndex, theRefits, theRefitter, theService, and theTrackLoader.

◆ ~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
95  const TrackerTopology* tTopo = &eventSetup.getData(tTopoToken);
96 
97  // Take the GLB muon container(s)
99  event.getByToken(glbMuonsToken, glbMuons);
100 
101  auto dytInfo = std::make_unique<DYTestimators>();
102  DYTestimators::Filler filler(*dytInfo);
103  size_t GLBmuonSize = glbMuons->size();
104  vector<DYTInfo> dytTmp(GLBmuonSize);
105 
106  Handle<vector<Trajectory> > glbMuonsTraj;
107 
108  LogTrace(metname) << "Taking " << glbMuons->size() << " Global Muons " << theGLBCollectionLabel << endl;
109 
110  vector<MuonTrajectoryBuilder::TrackCand> glbTrackCands;
111 
112  event.getByToken(glbMuonsTrajToken, glbMuonsTraj);
113 
114  const reco::TrackCollection* glbTracks = glbMuons.product();
115 
116  for (unsigned int ww = 0; ww < theRefits.size(); ww++) {
117  LogDebug(metname) << "TeVRefit for Refit: " << theRefitIndex[ww];
118  std::vector<std::pair<Trajectory*, reco::TrackRef> > miniMap;
120  reco::TrackRef::key_type trackIndex = 0;
121  int glbCounter = 0;
122  for (reco::TrackCollection::const_iterator track = glbTracks->begin(); track != glbTracks->end();
123  track++, ++trackIndex) {
124  reco::TrackRef glbRef(glbMuons, trackIndex);
125 
126  vector<Trajectory> refitted = theRefitter->refit(*track, theRefitIndex[ww], tTopo);
127 
128  if (theRefits[ww] == "dyt")
129  dytTmp[glbCounter] = *theRefitter->getDYTInfo();
130  glbCounter++;
131 
132  if (!refitted.empty()) {
133  auto refit = std::make_unique<Trajectory>(refitted.front());
134  LogDebug(metname) << "TeVTrackLoader for Refit: " << theRefits[ww];
135  std::pair<Trajectory*, reco::TrackRef> thisPair(refit.get(), glbRef);
136  miniMap.push_back(thisPair);
137  trajectories.push_back(std::move(refit));
138  }
139  }
140  theTrackLoader->loadTracks(trajectories, event, miniMap, glbMuons, *tTopo, theRefits[ww]);
141  }
142 
143  filler.insert(glbMuons, dytTmp.begin(), dytTmp.end());
144  filler.fill();
145  event.put(std::move(dytInfo), "dytInfo");
146 
147  LogTrace(metname) << "Done." << endl;
148 }

References trigObjTnPSource_cfi::filler, edm::EventSetup::getData(), glbMuonsToken, glbMuonsTrajToken, LogDebug, LogTrace, metname, eostools::move(), edm::Handle< T >::product(), theGLBCollectionLabel, theRefitIndex, theRefits, theRefitter, theService, theTrackLoader, HLT_FULL_cff::track, FastTrackerRecHitMaskProducer_cfi::trajectories, and tTopoToken.

◆ setAlias()

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

Definition at line 68 of file TevMuonProducer.h.

68  {
69  alias.erase(alias.size() - 1, alias.size());
70  theAlias = alias;
71  }

References SiStripOfflineCRack_cfg::alias, and theAlias.

Member Data Documentation

◆ glbMuonsToken

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

Definition at line 53 of file TevMuonProducer.h.

Referenced by produce(), and TevMuonProducer().

◆ glbMuonsTrajToken

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

Definition at line 54 of file TevMuonProducer.h.

Referenced by produce(), and TevMuonProducer().

◆ theAlias

std::string TevMuonProducer::theAlias
private

Definition at line 64 of file TevMuonProducer.h.

Referenced by setAlias().

◆ theGLBCollectionLabel

edm::InputTag TevMuonProducer::theGLBCollectionLabel
private

STA Label.

Definition at line 52 of file TevMuonProducer.h.

Referenced by produce(), and TevMuonProducer().

◆ theRefitIndex

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

Definition at line 66 of file TevMuonProducer.h.

Referenced by produce(), and TevMuonProducer().

◆ theRefits

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

Definition at line 65 of file TevMuonProducer.h.

Referenced by produce(), and TevMuonProducer().

◆ theRefitter

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

Definition at line 60 of file TevMuonProducer.h.

Referenced by produce(), and TevMuonProducer().

◆ theService

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

the event setup proxy, it takes care the services update

Definition at line 58 of file TevMuonProducer.h.

Referenced by produce(), and TevMuonProducer().

◆ theTrackLoader

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

Definition at line 62 of file TevMuonProducer.h.

Referenced by produce(), and TevMuonProducer().

◆ tTopoToken

const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> TevMuonProducer::tTopoToken
private

Definition at line 55 of file TevMuonProducer.h.

Referenced by produce().

HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11713
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:60
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
TevMuonProducer::theGLBCollectionLabel
edm::InputTag theGLBCollectionLabel
STA Label.
Definition: TevMuonProducer.h:52
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:223
edm::ParameterSet
Definition: ParameterSet.h:47
trigObjTnPSource_cfi.filler
filler
Definition: trigObjTnPSource_cfi.py:21
TevMuonProducer::glbMuonsTrajToken
edm::EDGetTokenT< std::vector< Trajectory > > glbMuonsTrajToken
Definition: TevMuonProducer.h:54
edm::Ref< TrackCollection >::key_type
std::remove_cv< typename std::remove_reference< argument_type >::type >::type key_type
Definition: Ref.h:164
TevMuonProducer::tTopoToken
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken
Definition: TevMuonProducer.h:55
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:120
eostools.move
def move(src, dest)
Definition: eostools.py:511
TevMuonProducer::theAlias
std::string theAlias
Definition: TevMuonProducer.h:64
SiStripOfflineCRack_cfg.alias
alias
Definition: SiStripOfflineCRack_cfg.py:128
edm::parameterSet
ParameterSet const & parameterSet(Provenance const &provenance, ProcessHistory const &history)
Definition: Provenance.cc:11
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
TevMuonProducer::theRefits
std::vector< std::string > theRefits
Definition: TevMuonProducer.h:65
TevMuonProducer::theRefitIndex
std::vector< int > theRefitIndex
Definition: TevMuonProducer.h:66
TevMuonProducer::glbMuonsToken
edm::EDGetTokenT< reco::TrackCollection > glbMuonsToken
Definition: TevMuonProducer.h:53
MuonTrackLoader::TrajectoryContainer
MuonCandidate::TrajectoryContainer TrajectoryContainer
Definition: MuonTrackLoader.h:45
edm::helper::Filler
Definition: ValueMap.h:22
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:224
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:45
TevMuonProducer::theService
std::unique_ptr< MuonServiceProxy > theService
the event setup proxy, it takes care the services update
Definition: TevMuonProducer.h:58
metname
const std::string metname
Definition: MuonSeedOrcaPatternRecognition.cc:40
TevMuonProducer::theTrackLoader
std::unique_ptr< MuonTrackLoader > theTrackLoader
Definition: TevMuonProducer.h:62