CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
StandAloneMuonProducer.cc
Go to the documentation of this file.
1 
13 // Framework
18 
20 
21 // TrackFinder and Specific STA Trajectory Builder
25 
29 
30 // Input and output collection
31 
35 
38 
39 #include <string>
40 
41 using namespace edm;
42 using namespace std;
43 
46  LogTrace("Muon|RecoMuon|StandAloneMuonProducer")<<"constructor called"<<endl;
47 
48  // Parameter set for the Builder
49  ParameterSet trajectoryBuilderParameters = parameterSet.getParameter<ParameterSet>("STATrajBuilderParameters");
50 
51  // MuonSeed Collection Label
52  theSeedCollectionLabel = parameterSet.getParameter<InputTag>("InputObjects");
53 
54  // service parameters
55  ParameterSet serviceParameters = parameterSet.getParameter<ParameterSet>("ServiceParameters");
56 
57  // TrackLoader parameters
58  ParameterSet trackLoaderParameters = parameterSet.getParameter<ParameterSet>("TrackLoaderParameters");
59  edm::ConsumesCollector iC = consumesCollector();
60 
61  // the services
62  theService = new MuonServiceProxy(serviceParameters);
63 
64  MuonTrackLoader * trackLoader = new MuonTrackLoader(trackLoaderParameters,iC,theService);
65  MuonTrajectoryBuilder * trajectoryBuilder = 0;
66  // instantiate the concrete trajectory builder in the Track Finder
67  string typeOfBuilder = parameterSet.getParameter<string>("MuonTrajectoryBuilder");
68  if(typeOfBuilder == "StandAloneMuonTrajectoryBuilder")
69  trajectoryBuilder = new StandAloneMuonTrajectoryBuilder(trajectoryBuilderParameters,theService,iC);
70  else if(typeOfBuilder == "DirectMuonTrajectoryBuilder")
71  trajectoryBuilder = new DirectMuonTrajectoryBuilder(trajectoryBuilderParameters,theService);
72  else if(typeOfBuilder == "Exhaustive")
73  trajectoryBuilder = new ExhaustiveMuonTrajectoryBuilder(trajectoryBuilderParameters,theService,iC);
74  else{
75  LogWarning("Muon|RecoMuon|StandAloneMuonProducer") << "No Trajectory builder associated with "<<typeOfBuilder
76  << ". Falling down to the default (StandAloneMuonTrajectoryBuilder)";
77  trajectoryBuilder = new StandAloneMuonTrajectoryBuilder(trajectoryBuilderParameters,theService,iC);
78  }
79  theTrackFinder = new MuonTrackFinder(trajectoryBuilder, trackLoader);
80 
81  setAlias(parameterSet.getParameter<std::string>("@module_label"));
82 
83  produces<reco::TrackCollection>().setBranchAlias(theAlias + "Tracks");
84  produces<reco::TrackCollection>("UpdatedAtVtx").setBranchAlias(theAlias + "UpdatedAtVtxTracks");
85  produces<TrackingRecHitCollection>().setBranchAlias(theAlias + "RecHits");
86  produces<reco::TrackExtraCollection>().setBranchAlias(theAlias + "TrackExtras");
87  produces<reco::TrackToTrackMap>().setBranchAlias(theAlias + "TrackToTrackMap");
88 
89  produces<std::vector<Trajectory> >().setBranchAlias(theAlias + "Trajectories");
90  produces<TrajTrackAssociationCollection>().setBranchAlias(theAlias + "TrajToTrackMap");
91 
92 
93 
94  seedToken = consumes<edm::View<TrajectorySeed> >(theSeedCollectionLabel);
95 
96 
97 }
98 
101  LogTrace("Muon|RecoMuon|StandAloneMuonProducer")<<"StandAloneMuonProducer destructor called"<<endl;
102  if (theService) delete theService;
103  if (theTrackFinder) delete theTrackFinder;
104 }
105 
108  const std::string metname = "Muon|RecoMuon|StandAloneMuonProducer";
109 
110  LogTrace(metname)<<endl<<endl<<endl;
111  LogTrace(metname)<<"Stand Alone Muon Reconstruction Started"<<endl;
112 
113  // Take the seeds container
114  LogTrace(metname)<<"Taking the seeds: "<<theSeedCollectionLabel.label()<<endl;
116  event.getByToken(seedToken,seeds);
117 
118  // Update the services
119  theService->update(eventSetup);
120  NavigationSetter setter(*theService->muonNavigationSchool());
121 
122  // Reconstruct
123  LogTrace(metname)<<"Track Reconstruction"<<endl;
124  theTrackFinder->reconstruct(seeds,event);
125 
126  LogTrace(metname)<<"Event loaded"
127  <<"================================"
128  <<endl<<endl;
129 }
130 
T getParameter(std::string const &) const
virtual void produce(edm::Event &, const edm::EventSetup &)
reconstruct muons
const std::string metname
virtual ~StandAloneMuonProducer()
destructor
StandAloneMuonProducer(const edm::ParameterSet &)
constructor with config
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
#define LogTrace(id)
ParameterSet const & parameterSet(Provenance const &provenance)
Definition: Provenance.cc:11