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 
25 
29 
34 
35 //
36 // constructors and destructor
37 //
39  edm::ParameterSet tbpar = iConfig.getParameter<edm::ParameterSet>("TrajectoryBuilderParameters");
40  theTrackCollectionToken = consumes<reco::TrackCollection>(iConfig.getParameter<edm::InputTag>("MuonCollectionLabel"));
41 
42  // service parameters
43  edm::ParameterSet serviceParameters = iConfig.getParameter<edm::ParameterSet>("ServiceParameters");
44 
45  // TrackLoader parameters
46  edm::ParameterSet trackLoaderParameters = iConfig.getParameter<edm::ParameterSet>("TrackLoaderParameters");
47 
48  // the services
49  theService = std::make_unique<MuonServiceProxy>(serviceParameters, consumesCollector());
50  edm::ConsumesCollector iC = consumesCollector();
51  theTrackFinder = std::make_unique<MuonTrackFinder>(
52  std::make_unique<GlobalCosmicMuonTrajectoryBuilder>(tbpar, theService.get(), iC),
53  std::make_unique<MuonTrackLoader>(trackLoaderParameters, iC, theService.get()),
54  iC);
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
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
GlobalCosmicMuonProducer::theTrackCollectionToken
edm::EDGetTokenT< reco::TrackCollection > theTrackCollectionToken
Definition: GlobalCosmicMuonProducer.h:30
edm::ParameterSet
Definition: ParameterSet.h:47
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:58
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
Trajectory
Definition: Trajectory.h:38
Frameworkfwd.h
MuonServiceProxy.h
EventSetup.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
MuonTrajectoryBuilder::TrackCand
std::pair< const Trajectory *, reco::TrackRef > TrackCand
Definition: MuonTrajectoryBuilder.h:25
ConsumesCollector.h
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:234
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:38
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:45
metname
const std::string metname
Definition: MuonSeedOrcaPatternRecognition.cc:40