CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
GlobalTrackingRegionProducerFromBeamSpot Class Reference

#include <GlobalTrackingRegionProducerFromBeamSpot.h>

Inheritance diagram for GlobalTrackingRegionProducerFromBeamSpot:
TrackingRegionProducer

Public Member Functions

 GlobalTrackingRegionProducerFromBeamSpot (const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
 
 GlobalTrackingRegionProducerFromBeamSpot (const edm::ParameterSet &cfg, edm::ConsumesCollector &iC)
 
std::vector< std::unique_ptr< TrackingRegion > > regions (const edm::Event &ev, const edm::EventSetup &) const override
 
 ~GlobalTrackingRegionProducerFromBeamSpot () override
 
- Public Member Functions inherited from TrackingRegionProducer
virtual ~TrackingRegionProducer ()
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Attributes

double theNSigmaZ
 
double theOriginHalfLength
 
double theOriginRadius
 
bool thePrecise
 
double thePtMin
 
bool theUseMS
 
edm::EDGetTokenT< reco::BeamSpottoken_beamSpot
 

Detailed Description

Definition at line 16 of file GlobalTrackingRegionProducerFromBeamSpot.h.

Constructor & Destructor Documentation

GlobalTrackingRegionProducerFromBeamSpot::GlobalTrackingRegionProducerFromBeamSpot ( const edm::ParameterSet cfg,
edm::ConsumesCollector &&  iC 
)
inline

Definition at line 20 of file GlobalTrackingRegionProducerFromBeamSpot.h.

21  :
23  {}
GlobalTrackingRegionProducerFromBeamSpot(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
GlobalTrackingRegionProducerFromBeamSpot::GlobalTrackingRegionProducerFromBeamSpot ( const edm::ParameterSet cfg,
edm::ConsumesCollector iC 
)
inline

Definition at line 24 of file GlobalTrackingRegionProducerFromBeamSpot.h.

References edm::ConsumesCollector::consumes(), Exception, edm::ParameterSet::existsAs(), edm::ParameterSet::getParameter(), theNSigmaZ, theOriginHalfLength, theOriginRadius, thePrecise, thePtMin, theUseMS, and token_beamSpot.

25  {
26 
27  edm::ParameterSet regionPSet = cfg.getParameter<edm::ParameterSet>("RegionPSet");
28  thePtMin = regionPSet.getParameter<double>("ptMin");
29  theOriginRadius = regionPSet.getParameter<double>("originRadius");
30  if (!regionPSet.existsAs<double>("nSigmaZ") && !regionPSet.existsAs<double>("originHalfLength")) {
31  throw cms::Exception("Configuration") << "GlobalTrackingRegionProducerFromBeamSpot: at least one of nSigmaZ, originHalfLength must be present in the cfg.\n";
32  }
33  theNSigmaZ = (regionPSet.existsAs<double>("nSigmaZ") ? regionPSet.getParameter<double>("nSigmaZ") : 0.0);
34  theOriginHalfLength = (regionPSet.existsAs<double>("originHalfLength") ? regionPSet.getParameter<double>("originHalfLength") : 0.0);
35  token_beamSpot = iC.consumes<reco::BeamSpot>(regionPSet.getParameter<edm::InputTag>("beamSpot"));
36  thePrecise = regionPSet.getParameter<bool>("precise");
37  theUseMS = (regionPSet.existsAs<bool>("useMultipleScattering") ? regionPSet.getParameter<bool>("useMultipleScattering") : false);
38 
39  }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:161
GlobalTrackingRegionProducerFromBeamSpot::~GlobalTrackingRegionProducerFromBeamSpot ( )
inlineoverride

Definition at line 41 of file GlobalTrackingRegionProducerFromBeamSpot.h.

41 {}

Member Function Documentation

static void GlobalTrackingRegionProducerFromBeamSpot::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
inlinestatic

Definition at line 43 of file GlobalTrackingRegionProducerFromBeamSpot.h.

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

43  {
44  {
46 
47  desc.add<bool>("precise", true);
48  desc.add<bool>("useMultipleScattering", false);
49  desc.add<double>("nSigmaZ", 4.0);
50  desc.add<double>("originHalfLength", 0.0); // this is the default in constructor
51  desc.add<double>("originRadius", 0.2);
52  desc.add<double>("ptMin", 0.9);
53  desc.add<edm::InputTag>("beamSpot", edm::InputTag("offlineBeamSpot"));
54 
55  // Only for backwards-compatibility
57  descRegion.add<edm::ParameterSetDescription>("RegionPSet", desc);
58 
59  descriptions.add("globalTrackingRegionFromBeamSpot", descRegion);
60  }
61 
62  {
64 
65  desc.add<bool>("precise", true);
66  desc.add<bool>("useMultipleScattering", false);
67  desc.add<double>("nSigmaZ", 0.0); // this is the default in constructor
68  desc.add<double>("originHalfLength", 21.2);
69  desc.add<double>("originRadius", 0.2);
70  desc.add<double>("ptMin", 0.9);
71  desc.add<edm::InputTag>("beamSpot", edm::InputTag("offlineBeamSpot"));
72 
73  // Only for backwards-compatibility
75  descRegion.add<edm::ParameterSetDescription>("RegionPSet", desc);
76 
77  descriptions.add("globalTrackingRegionFromBeamSpotFixedZ", descRegion);
78  }
79  }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
std::vector<std::unique_ptr<TrackingRegion> > GlobalTrackingRegionProducerFromBeamSpot::regions ( const edm::Event ev,
const edm::EventSetup  
) const
inlineoverridevirtual

Implements TrackingRegionProducer.

Definition at line 81 of file GlobalTrackingRegionProducerFromBeamSpot.h.

References edm::Event::getByToken(), edm::HandleBase::isValid(), SiStripPI::max, mps_fire::result, reco::BeamSpot::sigmaZ(), theNSigmaZ, theOriginHalfLength, theOriginRadius, thePrecise, thePtMin, theUseMS, token_beamSpot, reco::BeamSpot::x0(), reco::BeamSpot::y0(), and reco::BeamSpot::z0().

81  {
82  std::vector<std::unique_ptr<TrackingRegion> > result;
84  ev.getByToken( token_beamSpot, bsHandle);
85  if(bsHandle.isValid()) {
86 
87  const reco::BeamSpot & bs = *bsHandle;
88 
89  GlobalPoint origin(bs.x0(), bs.y0(), bs.z0());
90 
91  result.push_back( std::make_unique<GlobalTrackingRegion>(
93 
94  }
95  return result;
96  }
double z0() const
z coordinate
Definition: BeamSpot.h:68
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
bool isValid() const
Definition: HandleBase.h:74
double sigmaZ() const
sigma z
Definition: BeamSpot.h:80
double y0() const
y coordinate
Definition: BeamSpot.h:66
double x0() const
x coordinate
Definition: BeamSpot.h:64

Member Data Documentation

double GlobalTrackingRegionProducerFromBeamSpot::theNSigmaZ
private
double GlobalTrackingRegionProducerFromBeamSpot::theOriginHalfLength
private
double GlobalTrackingRegionProducerFromBeamSpot::theOriginRadius
private
bool GlobalTrackingRegionProducerFromBeamSpot::thePrecise
private
double GlobalTrackingRegionProducerFromBeamSpot::thePtMin
private
bool GlobalTrackingRegionProducerFromBeamSpot::theUseMS
private
edm::EDGetTokenT<reco::BeamSpot> GlobalTrackingRegionProducerFromBeamSpot::token_beamSpot
private