CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CosmicMuonProducer.cc
Go to the documentation of this file.
2 
13 // system include files
14 #include <memory>
15 
16 // user include files
18 
21 
23 
27 
29 
34 
36 
37 using namespace edm;
38 
39 //
40 // constructors and destructor
41 //
43 {
44  ParameterSet tbpar = iConfig.getParameter<ParameterSet>("TrajectoryBuilderParameters");
45 
46  theSeedCollectionToken =consumes<edm::View<TrajectorySeed> >( iConfig.getParameter<std::string>("MuonSeedCollectionLabel"));
47 
48  // service parameters
49  ParameterSet serviceParameters = iConfig.getParameter<ParameterSet>("ServiceParameters");
50 
51  // TrackLoader parameters
52  ParameterSet trackLoaderParameters = iConfig.getParameter<ParameterSet>("TrackLoaderParameters");
53 
54  // the services
55 
56  edm::ConsumesCollector iC = consumesCollector();
57 
58  theService = new MuonServiceProxy(serviceParameters);
59  theTrackFinder = new MuonTrackFinder(new CosmicMuonTrajectoryBuilder(tbpar,theService,iC),
60  new MuonTrackLoader(trackLoaderParameters,iC, theService));
61 
62  produces<reco::TrackCollection>();
63  produces<TrackingRecHitCollection>();
64  produces<reco::TrackExtraCollection>();
65  produces<std::vector<Trajectory> >();
66  produces<TrajTrackAssociationCollection>();
67 
68 }
69 
70 
72 {
73  if (theService) delete theService;
74  if (theTrackFinder) delete theTrackFinder;
75 }
76 
77 
78 // ------------ method called to produce the data ------------
79 void
81 {
82  LogInfo("CosmicMuonProducer") << "Analyzing event number: " << iEvent.id();
83 
85  iEvent.getByToken(theSeedCollectionToken,seeds);
86 
87  // Update the services
88  theService->update(iSetup);
89  theTrackFinder->reconstruct(seeds,iEvent);
90 }
T getParameter(std::string const &) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
virtual void produce(edm::Event &, const edm::EventSetup &) override
CosmicMuonProducer(const edm::ParameterSet &)
int iEvent
Definition: GenABIO.cc:230
edm::EventID id() const
Definition: EventBase.h:56