CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Protected Attributes
MuonSeedGenerator Class Reference

#include <MuonSeedGenerator.h>

Inheritance diagram for MuonSeedGenerator:
edm::stream::EDProducer<>

Public Member Functions

 MuonSeedGenerator (const edm::ParameterSet &)
 Constructor. More...
 
void produce (edm::Event &, const edm::EventSetup &) override
 reconstruct muon's seeds More...
 
 ~MuonSeedGenerator () override
 Destructor. More...
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Protected Attributes

edm::EDGetTokenT< reco::BeamSpotbeamspotToken
 
edm::InputTag theBeamSpotTag
 
MuonSeedVPatternRecognitionthePatternRecognition
 
MuonSeedVCleanertheSeedCleaner
 
MuonSeedVFindertheSeedFinder
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

No description available.

Author
R. Bellan - INFN Torino

Definition at line 23 of file MuonSeedGenerator.h.

Constructor & Destructor Documentation

MuonSeedGenerator::MuonSeedGenerator ( const edm::ParameterSet pset)

Constructor.

Definition at line 57 of file MuonSeedGenerator.cc.

References beamspotToken, theBeamSpotTag, and thePatternRecognition.

58 : theSeedFinder(new MuonSeedFinder(pset)),
60  theBeamSpotTag(pset.getParameter<edm::InputTag>("beamSpotTag"))
61 {
62  produces<TrajectorySeedCollection>();
63 
64  edm::ConsumesCollector iC = consumesCollector();
66 
67  beamspotToken = consumes<reco::BeamSpot>(theBeamSpotTag);
68 }
T getParameter(std::string const &) const
MuonSeedVCleaner * theSeedCleaner
edm::EDGetTokenT< reco::BeamSpot > beamspotToken
MuonSeedVFinder * theSeedFinder
MuonSeedVPatternRecognition * thePatternRecognition
edm::InputTag theBeamSpotTag
MuonSeedGenerator::~MuonSeedGenerator ( )
override

Destructor.

Definition at line 71 of file MuonSeedGenerator.cc.

References thePatternRecognition, theSeedCleaner, and theSeedFinder.

71  {
72  delete thePatternRecognition;
73  delete theSeedFinder;
74  delete theSeedCleaner;
75 }
MuonSeedVCleaner * theSeedCleaner
MuonSeedVFinder * theSeedFinder
MuonSeedVPatternRecognition * thePatternRecognition

Member Function Documentation

void MuonSeedGenerator::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 120 of file MuonSeedGenerator.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), and edm::ParameterSetDescription::setAllowAnything().

120  {
122  desc.setAllowAnything();
123  desc.add<bool>("EnableDTMeasurement",true);
124  desc.add<bool>("EnableCSCMeasurement",true);
125  desc.add<bool>("EnableME0Measurement",false);
126  descriptions.add("produceMuons", desc);
127 }
void setAllowAnything()
allow any parameter label/value pairs
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void MuonSeedGenerator::produce ( edm::Event event,
const edm::EventSetup eSetup 
)
override

reconstruct muon's seeds

Definition at line 79 of file MuonSeedGenerator.cc.

References ecalDrivenElectronSeedsParameters_cff::beamSpot, beamspotToken, MuonSeedVCleaner::clean(), edm::EventSetup::get(), edm::HandleBase::isValid(), eostools::move(), convertSQLitetoXML_cfg::output, MuonSeedVPatternRecognition::produce(), MuonSeedVFinder::seeds(), MuonSeedVFinder::setBeamSpot(), MuonSeedVFinder::setBField(), thePatternRecognition, theSeedCleaner, theSeedFinder, reco::BeamSpot::x0(), reco::BeamSpot::y0(), and reco::BeamSpot::z0().

80 {
81  // create the pointer to the Seed container
82  auto output = std::make_unique<TrajectorySeedCollection>();
83 
85  eSetup.get<IdealMagneticFieldRecord>().get(field);
86  theSeedFinder->setBField(&*field);
87 
89  edm::Handle<reco::BeamSpot> beamSpotHandle;
90  event.getByToken(beamspotToken, beamSpotHandle);
91  if ( beamSpotHandle.isValid() )
92  {
93  beamSpot = *beamSpotHandle;
94 
95  } else
96  {
97  edm::LogInfo("MuonSeedGenerator")
98  << "No beam spot available from EventSetup \n";
99  }
100 
101  // make it a vector so we can subtract it from position vectors
102  GlobalVector gv(beamSpot.x0(), beamSpot.y0(), beamSpot.z0());
104 
105  std::vector<MuonRecHitContainer> patterns;
106  thePatternRecognition->produce(event, eSetup, patterns);
107 
108  for(std::vector<MuonRecHitContainer>::const_iterator seedSegments = patterns.begin();
109  seedSegments != patterns.end(); ++seedSegments)
110  {
111  theSeedFinder->seeds(*seedSegments, *output);
112  }
113 
115 
116  event.put(std::move(output));
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
MuonSeedVCleaner * theSeedCleaner
edm::EDGetTokenT< reco::BeamSpot > beamspotToken
bool isValid() const
Definition: HandleBase.h:74
virtual void seeds(const MuonTransientTrackingRecHit::MuonRecHitContainer &hits, std::vector< TrajectorySeed > &result)=0
const T & get() const
Definition: EventSetup.h:59
virtual void clean(TrajectorySeedCollection &seeds)=0
virtual void setBField(const MagneticField *field)=0
double y0() const
y coordinate
Definition: BeamSpot.h:66
MuonSeedVFinder * theSeedFinder
MuonSeedVPatternRecognition * thePatternRecognition
def move(src, dest)
Definition: eostools.py:510
double x0() const
x coordinate
Definition: BeamSpot.h:64

Member Data Documentation

edm::EDGetTokenT<reco::BeamSpot> MuonSeedGenerator::beamspotToken
protected

Definition at line 46 of file MuonSeedGenerator.h.

Referenced by MuonSeedGenerator(), and produce().

edm::InputTag MuonSeedGenerator::theBeamSpotTag
protected

Definition at line 45 of file MuonSeedGenerator.h.

Referenced by MuonSeedGenerator().

MuonSeedVPatternRecognition* MuonSeedGenerator::thePatternRecognition
protected

Definition at line 41 of file MuonSeedGenerator.h.

Referenced by MuonSeedGenerator(), produce(), and ~MuonSeedGenerator().

MuonSeedVCleaner* MuonSeedGenerator::theSeedCleaner
protected

Definition at line 43 of file MuonSeedGenerator.h.

Referenced by produce(), and ~MuonSeedGenerator().

MuonSeedVFinder* MuonSeedGenerator::theSeedFinder
protected

Definition at line 42 of file MuonSeedGenerator.h.

Referenced by produce(), and ~MuonSeedGenerator().