CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MuonSeedGenerator.cc
Go to the documentation of this file.
1 
17 
18 
19 // Data Formats
22 
24 
27 
28 // Geometry
31 
36 
37 
38 // Framework
43 
44 
45 // C++
46 #include <vector>
47 
48 using namespace std;
49 
53 
54 // Constructor
56 : theSeedFinder(new MuonSeedFinder(pset)),
57  theSeedCleaner(new MuonSeedSimpleCleaner()),
58  theBeamSpotTag(pset.getParameter<edm::InputTag>("beamSpotTag"))
59 {
60  produces<TrajectorySeedCollection>();
61 
64 
65  beamspotToken = consumes<reco::BeamSpot>(theBeamSpotTag);
66 }
67 
68 // Destructor
70  delete thePatternRecognition;
71  delete theSeedFinder;
72  delete theSeedCleaner;
73 }
74 
75 
76 // reconstruct muon's seeds
78 {
79  // create the pointer to the Seed container
80  auto_ptr<TrajectorySeedCollection> output(new TrajectorySeedCollection());
81 
83  eSetup.get<IdealMagneticFieldRecord>().get(field);
84  theSeedFinder->setBField(&*field);
85 
87  edm::Handle<reco::BeamSpot> beamSpotHandle;
88  event.getByToken(beamspotToken, beamSpotHandle);
89  if ( beamSpotHandle.isValid() )
90  {
91  beamSpot = *beamSpotHandle;
92 
93  } else
94  {
95  edm::LogInfo("MuonSeedGenerator")
96  << "No beam spot available from EventSetup \n";
97  }
98 
99  // make it a vector so we can subtract it from position vectors
100  GlobalVector gv(beamSpot.x0(), beamSpot.y0(), beamSpot.z0());
102 
103  std::vector<MuonRecHitContainer> patterns;
104  thePatternRecognition->produce(event, eSetup, patterns);
105 
106  for(std::vector<MuonRecHitContainer>::const_iterator seedSegments = patterns.begin();
107  seedSegments != patterns.end(); ++seedSegments)
108  {
109  theSeedFinder->seeds(*seedSegments, *output);
110  }
111 
112  theSeedCleaner->clean(*output);
113 
114  event.put(output);
115 }
116 
117 
void setBeamSpot(const GlobalVector &gv)
double z0() const
z coordinate
Definition: BeamSpot.h:68
virtual void produce(const edm::Event &event, const edm::EventSetup &eSetup, std::vector< MuonRecHitContainer > &result)=0
MuonTransientTrackingRecHit::MuonRecHitPointer MuonRecHitPointer
MuonSeedVCleaner * theSeedCleaner
edm::EDGetTokenT< reco::BeamSpot > beamspotToken
std::vector< TrajectorySeed > TrajectorySeedCollection
virtual void produce(edm::Event &, const edm::EventSetup &) override
reconstruct muon&#39;s seeds
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
virtual ~MuonSeedGenerator()
Destructor.
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
bool isValid() const
Definition: HandleBase.h:75
virtual void seeds(const MuonTransientTrackingRecHit::MuonRecHitContainer &hits, std::vector< TrajectorySeed > &result)=0
const T & get() const
Definition: EventSetup.h:56
virtual void clean(TrajectorySeedCollection &seeds)=0
virtual void setBField(const MagneticField *field)=0
MuonTransientTrackingRecHit const * ConstMuonRecHitPointer
double y0() const
y coordinate
Definition: BeamSpot.h:66
MuonSeedVFinder * theSeedFinder
MuonTransientTrackingRecHit::MuonRecHitContainer MuonRecHitContainer
MuonSeedVPatternRecognition * thePatternRecognition
MuonSeedGenerator(const edm::ParameterSet &)
Constructor.
std::vector< MuonRecHitPointer > MuonRecHitContainer
edm::InputTag theBeamSpotTag
MuonTransientTrackingRecHit::ConstMuonRecHitPointer ConstMuonRecHitPointer
double x0() const
x coordinate
Definition: BeamSpot.h:64