CMS 3D CMS Logo

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

#include <GlobalCosmicMuonProducer.h>

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

Public Member Functions

 GlobalCosmicMuonProducer (const edm::ParameterSet &)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~GlobalCosmicMuonProducer () override
 
- 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 Attributes

MuonServiceProxytheService
 the event setup proxy, it takes care the services update More...
 
edm::EDGetTokenT< reco::TrackCollectiontheTrackCollectionToken
 
MuonTrackFindertheTrackFinder
 

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

reconstruct muons using dt,csc,rpc and tracker starting from cosmic muon tracks

Author
: Chang Liu - Purdue University Chang.nosp@m..Liu.nosp@m.@cern.nosp@m..ch

Definition at line 20 of file GlobalCosmicMuonProducer.h.

Constructor & Destructor Documentation

GlobalCosmicMuonProducer::GlobalCosmicMuonProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 39 of file GlobalCosmicMuonProducer.cc.

References edm::ParameterSet::getParameter(), MuonServiceProxy_cff::MuonServiceProxy, theService, theTrackCollectionToken, and theTrackFinder.

39  {
40  edm::ParameterSet tbpar = iConfig.getParameter<edm::ParameterSet>("TrajectoryBuilderParameters");
41  theTrackCollectionToken = consumes<reco::TrackCollection>(iConfig.getParameter<edm::InputTag>("MuonCollectionLabel"));
42 
43  // service parameters
44  edm::ParameterSet serviceParameters = iConfig.getParameter<edm::ParameterSet>("ServiceParameters");
45 
46  // TrackLoader parameters
47  edm::ParameterSet trackLoaderParameters = iConfig.getParameter<edm::ParameterSet>("TrackLoaderParameters");
48 
49  // the services
50  theService = new MuonServiceProxy(serviceParameters);
51  edm::ConsumesCollector iC = consumesCollector();
52  theTrackFinder = new MuonTrackFinder(new GlobalCosmicMuonTrajectoryBuilder(tbpar, theService, iC),
53  new MuonTrackLoader(trackLoaderParameters, iC, theService));
54 
55  produces<reco::TrackCollection>();
56  produces<TrackingRecHitCollection>();
57  produces<reco::TrackExtraCollection>();
58  produces<std::vector<Trajectory> >();
59  produces<TrajTrackAssociationCollection>();
60 
61  produces<reco::MuonTrackLinksCollection>();
62 }
T getParameter(std::string const &) const
MuonServiceProxy * theService
the event setup proxy, it takes care the services update
edm::EDGetTokenT< reco::TrackCollection > theTrackCollectionToken
GlobalCosmicMuonProducer::~GlobalCosmicMuonProducer ( )
override

Definition at line 64 of file GlobalCosmicMuonProducer.cc.

References theService, and theTrackFinder.

64  {
65  if (theService)
66  delete theService;
67  if (theTrackFinder)
68  delete theTrackFinder;
69 }
MuonServiceProxy * theService
the event setup proxy, it takes care the services update

Member Function Documentation

void GlobalCosmicMuonProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 72 of file GlobalCosmicMuonProducer.cc.

References edm::Event::getByToken(), edm::HandleBase::isValid(), LogTrace, metname, position, MuonTrackFinder::reconstruct(), AlCaHLTBitMon_QueryRunRegistry::string, theService, theTrackCollectionToken, theTrackFinder, and MuonServiceProxy::update().

72  {
73  const std::string metname = "Muon|RecoMuon|GlobalCosmicMuonProducer";
74  LogTrace(metname) << "Global Cosmic Muon Reconstruction started";
75 
77  iEvent.getByToken(theTrackCollectionToken, cosMuons);
78  if (!cosMuons.isValid()) {
79  LogTrace(metname) << "Muon Track collection is invalid!!!";
80  return;
81  }
82 
83  // Update the services
84  theService->update(iSetup);
85 
86  // Reconstruct the tracks in the tracker+muon system
87  LogTrace(metname) << "Track Reconstruction";
88 
89  std::vector<MuonTrajectoryBuilder::TrackCand> cosTrackCands;
90  for (unsigned int position = 0; position != cosMuons->size(); ++position) {
91  reco::TrackRef cosTrackRef(cosMuons, position);
93  cosTrackCands.push_back(cosCand);
94  }
95  theTrackFinder->reconstruct(cosTrackCands, iEvent, iSetup);
96  LogTrace(metname) << "Event loaded";
97 }
void update(const edm::EventSetup &setup)
update the services each event
std::pair< const Trajectory *, reco::TrackRef > TrackCand
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
const std::string metname
bool isValid() const
Definition: HandleBase.h:70
#define LogTrace(id)
static int position[264][3]
Definition: ReadPGInfo.cc:289
MuonServiceProxy * theService
the event setup proxy, it takes care the services update
edm::OrphanHandle< reco::TrackCollection > reconstruct(const edm::Handle< edm::View< TrajectorySeed > > &, edm::Event &, const edm::EventSetup &)
reconstruct standalone tracks starting from a collection of seeds
edm::EDGetTokenT< reco::TrackCollection > theTrackCollectionToken

Member Data Documentation

MuonServiceProxy* GlobalCosmicMuonProducer::theService
private

the event setup proxy, it takes care the services update

Definition at line 33 of file GlobalCosmicMuonProducer.h.

Referenced by GlobalCosmicMuonProducer(), produce(), and ~GlobalCosmicMuonProducer().

edm::EDGetTokenT<reco::TrackCollection> GlobalCosmicMuonProducer::theTrackCollectionToken
private

Definition at line 29 of file GlobalCosmicMuonProducer.h.

Referenced by GlobalCosmicMuonProducer(), and produce().

MuonTrackFinder* GlobalCosmicMuonProducer::theTrackFinder
private