CMS 3D CMS Logo

GlobalCosmicMuonProducer.cc
Go to the documentation of this file.
2 
11 // system include files
12 #include <memory>
14 
15 // user include files
17 
20 
22 
26 
30 
35 
36 //
37 // constructors and destructor
38 //
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 = std::make_unique<MuonServiceProxy>(serviceParameters, consumesCollector());
51  edm::ConsumesCollector iC = consumesCollector();
52  theTrackFinder = std::make_unique<MuonTrackFinder>(
53  std::make_unique<GlobalCosmicMuonTrajectoryBuilder>(tbpar, theService.get(), iC),
54  std::make_unique<MuonTrackLoader>(trackLoaderParameters, iC, theService.get()));
55 
56  produces<reco::TrackCollection>();
57  produces<TrackingRecHitCollection>();
58  produces<reco::TrackExtraCollection>();
59  produces<std::vector<Trajectory> >();
60  produces<TrajTrackAssociationCollection>();
61 
62  produces<reco::MuonTrackLinksCollection>();
63 }
64 
66 
67 // ------------ method called to produce the data ------------
69  const std::string metname = "Muon|RecoMuon|GlobalCosmicMuonProducer";
70  LogTrace(metname) << "Global Cosmic Muon Reconstruction started";
71 
73  iEvent.getByToken(theTrackCollectionToken, cosMuons);
74  if (!cosMuons.isValid()) {
75  LogTrace(metname) << "Muon Track collection is invalid!!!";
76  return;
77  }
78 
79  // Update the services
80  theService->update(iSetup);
81 
82  // Reconstruct the tracks in the tracker+muon system
83  LogTrace(metname) << "Track Reconstruction";
84 
85  std::vector<MuonTrajectoryBuilder::TrackCand> cosTrackCands;
86  for (unsigned int position = 0; position != cosMuons->size(); ++position) {
87  reco::TrackRef cosTrackRef(cosMuons, position);
89  cosTrackCands.push_back(cosCand);
90  }
91  theTrackFinder->reconstruct(cosTrackCands, iEvent, iSetup);
92  LogTrace(metname) << "Event loaded";
93 }
MessageLogger.h
ESHandle.h
GlobalCosmicMuonProducer.h
edm::Handle< reco::TrackCollection >
edm::Ref< TrackCollection >
MakerMacros.h
GlobalCosmicMuonProducer::~GlobalCosmicMuonProducer
~GlobalCosmicMuonProducer() override
Definition: GlobalCosmicMuonProducer.cc:65
MuonTrackLoader.h
MuonFwd.h
TrajTrackAssociation.h
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
GlobalCosmicMuonProducer::theTrackCollectionToken
edm::EDGetTokenT< reco::TrackCollection > theTrackCollectionToken
Definition: GlobalCosmicMuonProducer.h:30
edm::ParameterSet
Definition: ParameterSet.h:36
Event.h
GlobalCosmicMuonProducer::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition: GlobalCosmicMuonProducer.cc:68
GlobalCosmicMuonTrajectoryBuilder.h
position
static int position[264][3]
Definition: ReadPGInfo.cc:289
iEvent
int iEvent
Definition: GenABIO.cc:224
MuonTrackFinder.h
edm::EventSetup
Definition: EventSetup.h:57
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Trajectory
Definition: Trajectory.h:38
Frameworkfwd.h
MuonServiceProxy.h
EventSetup.h
MuonTrajectoryBuilder::TrackCand
std::pair< const Trajectory *, reco::TrackRef > TrackCand
Definition: MuonTrajectoryBuilder.h:25
ConsumesCollector.h
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:671
ParameterSet.h
GlobalCosmicMuonProducer::theTrackFinder
std::unique_ptr< MuonTrackFinder > theTrackFinder
Definition: GlobalCosmicMuonProducer.h:31
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
edm::Event
Definition: Event.h:73
GlobalCosmicMuonProducer::GlobalCosmicMuonProducer
GlobalCosmicMuonProducer(const edm::ParameterSet &)
Definition: GlobalCosmicMuonProducer.cc:39
GlobalCosmicMuonProducer::theService
std::unique_ptr< MuonServiceProxy > theService
the event setup proxy, it takes care the services update
Definition: GlobalCosmicMuonProducer.h:34
edm::InputTag
Definition: InputTag.h:15
edm::ConsumesCollector
Definition: ConsumesCollector.h:39
metname
const std::string metname
Definition: MuonSeedOrcaPatternRecognition.cc:43