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 
19 
20 
21 // Data Formats
24 
26 
29 
30 // Geometry
33 
38 
39 
40 // Framework
46 
47 
48 // C++
49 #include <vector>
50 
51 using namespace std;
52 
56 
57 // Constructor
59 : thePatternRecognition(new MuonSeedOrcaPatternRecognition(pset)),
60  theSeedFinder(new MuonSeedFinder(pset)),
61  theSeedCleaner(new MuonSeedSimpleCleaner()),
62  theBeamSpotTag(pset.getParameter<edm::InputTag>("beamSpotTag"))
63 {
64  produces<TrajectorySeedCollection>();
65 }
66 
67 // Destructor
69  delete thePatternRecognition;
70  delete theSeedFinder;
71  delete theSeedCleaner;
72 }
73 
74 
75 // reconstruct muon's seeds
77 {
78  // create the pointer to the Seed container
79  auto_ptr<TrajectorySeedCollection> output(new TrajectorySeedCollection());
80 
82  eSetup.get<IdealMagneticFieldRecord>().get(field);
83  theSeedFinder->setBField(&*field);
84 
86  edm::Handle<reco::BeamSpot> beamSpotHandle;
87  event.getByLabel(theBeamSpotTag, beamSpotHandle);
88  if ( beamSpotHandle.isValid() )
89  {
90  beamSpot = *beamSpotHandle;
91 
92  } else
93  {
94  edm::LogInfo("MuonSeedGenerator")
95  << "No beam spot available from EventSetup \n";
96  }
97 
98  // make it a vector so we can subtract it from position vectors
99  GlobalVector gv(beamSpot.x0(), beamSpot.y0(), beamSpot.z0());
101 
102  std::vector<MuonRecHitContainer> patterns;
103  thePatternRecognition->produce(event, eSetup, patterns);
104 
105  for(std::vector<MuonRecHitContainer>::const_iterator seedSegments = patterns.begin();
106  seedSegments != patterns.end(); ++seedSegments)
107  {
108  theSeedFinder->seeds(*seedSegments, *output);
109  }
110 
111  theSeedCleaner->clean(*output);
112 
113  event.put(output);
114 }
115 
116 
void setBeamSpot(const GlobalVector &gv)
double z0() const
z coordinate
Definition: BeamSpot.h:69
virtual void produce(const edm::Event &event, const edm::EventSetup &eSetup, std::vector< MuonRecHitContainer > &result)=0
MuonTransientTrackingRecHit::MuonRecHitPointer MuonRecHitPointer
virtual void produce(edm::Event &, const edm::EventSetup &)
reconstruct muon&#39;s seeds
MuonSeedVCleaner * theSeedCleaner
std::vector< TrajectorySeed > TrajectorySeedCollection
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:76
virtual void seeds(const MuonTransientTrackingRecHit::MuonRecHitContainer &hits, std::vector< TrajectorySeed > &result)=0
const T & get() const
Definition: EventSetup.h:55
virtual void clean(TrajectorySeedCollection &seeds)=0
virtual void setBField(const MagneticField *field)=0
double y0() const
y coordinate
Definition: BeamSpot.h:67
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:65