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 
15 // Framework
20 
22 
23 // TrackFinder and Specific STA Trajectory Builder
27 
31 
32 // Input and output collection
33 
38 
41 
42 #include <string>
43 
44 using namespace edm;
45 using namespace std;
46 
49  LogTrace("Muon|RecoMuon|StandAloneMuonProducer")<<"constructor called"<<endl;
50 
51  // Parameter set for the Builder
52  ParameterSet trajectoryBuilderParameters = parameterSet.getParameter<ParameterSet>("STATrajBuilderParameters");
53 
54  // MuonSeed Collection Label
55  theSeedCollectionLabel = parameterSet.getParameter<InputTag>("InputObjects");
56 
57  // service parameters
58  ParameterSet serviceParameters = parameterSet.getParameter<ParameterSet>("ServiceParameters");
59 
60  // TrackLoader parameters
61  ParameterSet trackLoaderParameters = parameterSet.getParameter<ParameterSet>("TrackLoaderParameters");
62 
63  // the services
64  theService = new MuonServiceProxy(serviceParameters);
65 
66  MuonTrackLoader * trackLoader = new MuonTrackLoader(trackLoaderParameters,theService);
67  MuonTrajectoryBuilder * trajectoryBuilder = 0;
68  // instantiate the concrete trajectory builder in the Track Finder
69  string typeOfBuilder = parameterSet.getParameter<string>("MuonTrajectoryBuilder");
70  if(typeOfBuilder == "StandAloneMuonTrajectoryBuilder")
71  trajectoryBuilder = new StandAloneMuonTrajectoryBuilder(trajectoryBuilderParameters,theService);
72  else if(typeOfBuilder == "DirectMuonTrajectoryBuilder")
73  trajectoryBuilder = new DirectMuonTrajectoryBuilder(trajectoryBuilderParameters,theService);
74  else if(typeOfBuilder == "Exhaustive")
75  trajectoryBuilder = new ExhaustiveMuonTrajectoryBuilder(trajectoryBuilderParameters,theService);
76  else{
77  LogWarning("Muon|RecoMuon|StandAloneMuonProducer") << "No Trajectory builder associated with "<<typeOfBuilder
78  << ". Falling down to the default (StandAloneMuonTrajectoryBuilder)";
79  trajectoryBuilder = new StandAloneMuonTrajectoryBuilder(trajectoryBuilderParameters,theService);
80  }
81  theTrackFinder = new MuonTrackFinder(trajectoryBuilder, trackLoader);
82 
83  setAlias(parameterSet.getParameter<std::string>("@module_label"));
84 
85  produces<reco::TrackCollection>().setBranchAlias(theAlias + "Tracks");
86  produces<reco::TrackCollection>("UpdatedAtVtx").setBranchAlias(theAlias + "UpdatedAtVtxTracks");
87  produces<TrackingRecHitCollection>().setBranchAlias(theAlias + "RecHits");
88  produces<reco::TrackExtraCollection>().setBranchAlias(theAlias + "TrackExtras");
89  produces<reco::TrackToTrackMap>().setBranchAlias(theAlias + "TrackToTrackMap");
90 
91  produces<std::vector<Trajectory> >().setBranchAlias(theAlias + "Trajectories");
92  produces<TrajTrackAssociationCollection>().setBranchAlias(theAlias + "TrajToTrackMap");
93 }
94 
97  LogTrace("Muon|RecoMuon|StandAloneMuonProducer")<<"StandAloneMuonProducer destructor called"<<endl;
98  if (theService) delete theService;
99  if (theTrackFinder) delete theTrackFinder;
100 }
101 
104  const std::string metname = "Muon|RecoMuon|StandAloneMuonProducer";
105 
106  LogTrace(metname)<<endl<<endl<<endl;
107  LogTrace(metname)<<"Stand Alone Muon Reconstruction Started"<<endl;
108 
109  // Take the seeds container
110  LogTrace(metname)<<"Taking the seeds: "<<theSeedCollectionLabel.label()<<endl;
112  event.getByLabel(theSeedCollectionLabel,seeds);
113 
114  // Update the services
115  theService->update(eventSetup);
116  NavigationSetter setter(*theService->muonNavigationSchool());
117 
118  // Reconstruct
119  LogTrace(metname)<<"Track Reconstruction"<<endl;
120  theTrackFinder->reconstruct(seeds,event);
121 
122  LogTrace(metname)<<"Event loaded"
123  <<"================================"
124  <<endl<<endl;
125 }
126 
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)