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 hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () 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.

40 {
41 
42  edm::ParameterSet tbpar = iConfig.getParameter<edm::ParameterSet>("TrajectoryBuilderParameters");
43  theTrackCollectionToken =consumes<reco::TrackCollection>( iConfig.getParameter<edm::InputTag>("MuonCollectionLabel"));
44 
45  // service parameters
46  edm::ParameterSet serviceParameters = iConfig.getParameter<edm::ParameterSet>("ServiceParameters");
47 
48  // TrackLoader parameters
49  edm::ParameterSet trackLoaderParameters = iConfig.getParameter<edm::ParameterSet>("TrackLoaderParameters");
50 
51  // the services
52  theService = new MuonServiceProxy(serviceParameters);
53  edm::ConsumesCollector iC = consumesCollector();
55  new MuonTrackLoader(trackLoaderParameters,iC, theService));
56 
57  produces<reco::TrackCollection>();
58  produces<TrackingRecHitCollection>();
59  produces<reco::TrackExtraCollection>();
60  produces<std::vector<Trajectory> >();
61  produces<TrajTrackAssociationCollection>();
62 
63  produces<reco::MuonTrackLinksCollection>();
64 
65 }
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 68 of file GlobalCosmicMuonProducer.cc.

References theService, and theTrackFinder.

69 {
70  if (theService) delete theService;
71  if (theTrackFinder) delete theTrackFinder;
72 }
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 77 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().

78 {
79  const std::string metname = "Muon|RecoMuon|GlobalCosmicMuonProducer";
80  LogTrace(metname)<<"Global Cosmic Muon Reconstruction started";
81 
83  iEvent.getByToken(theTrackCollectionToken,cosMuons);
84  if (!cosMuons.isValid()) {
85  LogTrace(metname)<< "Muon Track collection is invalid!!!";
86  return;
87  }
88 
89  // Update the services
90  theService->update(iSetup);
91 
92  // Reconstruct the tracks in the tracker+muon system
93  LogTrace(metname)<<"Track Reconstruction";
94 
95  std::vector<MuonTrajectoryBuilder::TrackCand> cosTrackCands;
96  for ( unsigned int position = 0; position != cosMuons->size(); ++position ) {
97  reco::TrackRef cosTrackRef(cosMuons,position);
99  cosTrackCands.push_back(cosCand);
100  }
101  theTrackFinder->reconstruct(cosTrackCands,iEvent,iSetup);
102  LogTrace(metname)<<"Event loaded";
103 
104 }
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:517
const std::string metname
bool isValid() const
Definition: HandleBase.h:74
#define LogTrace(id)
static int position[264][3]
Definition: ReadPGInfo.cc:509
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