CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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)
 
virtual std::vector
< std::unique_ptr
< TrackingRegion > > 
regions (const edm::Event &ev, const edm::EventSetup &) const override
 
virtual ~GlobalTrackingRegionProducerFromBeamSpot ()
 
- 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 14 of file GlobalTrackingRegionProducerFromBeamSpot.h.

Constructor & Destructor Documentation

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

Definition at line 18 of file GlobalTrackingRegionProducerFromBeamSpot.h.

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

Definition at line 22 of file GlobalTrackingRegionProducerFromBeamSpot.h.

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

23  {
24 
25  edm::ParameterSet regionPSet = cfg.getParameter<edm::ParameterSet>("RegionPSet");
26  thePtMin = regionPSet.getParameter<double>("ptMin");
27  theOriginRadius = regionPSet.getParameter<double>("originRadius");
28  if (!regionPSet.existsAs<double>("nSigmaZ") && !regionPSet.existsAs<double>("originHalfLength")) {
29  throw cms::Exception("Configuration") << "GlobalTrackingRegionProducerFromBeamSpot: at least one of nSigmaZ, originHalfLength must be present in the cfg.\n";
30  }
31  theNSigmaZ = (regionPSet.existsAs<double>("nSigmaZ") ? regionPSet.getParameter<double>("nSigmaZ") : 0.0);
32  theOriginHalfLength = (regionPSet.existsAs<double>("originHalfLength") ? regionPSet.getParameter<double>("originHalfLength") : 0.0);
33  token_beamSpot = iC.consumes<reco::BeamSpot>(regionPSet.getParameter<edm::InputTag>("beamSpot"));
34  thePrecise = regionPSet.getParameter<bool>("precise");
35  theUseMS = (regionPSet.existsAs<bool>("useMultipleScattering") ? regionPSet.getParameter<bool>("useMultipleScattering") : false);
36 
37  }
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:186
virtual GlobalTrackingRegionProducerFromBeamSpot::~GlobalTrackingRegionProducerFromBeamSpot ( )
inlinevirtual

Definition at line 39 of file GlobalTrackingRegionProducerFromBeamSpot.h.

39 {}

Member Function Documentation

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

Definition at line 41 of file GlobalTrackingRegionProducerFromBeamSpot.h.

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

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

Implements TrackingRegionProducer.

Definition at line 79 of file GlobalTrackingRegionProducerFromBeamSpot.h.

References edm::Event::getByToken(), edm::HandleBase::isValid(), bookConverter::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().

79  {
80  std::vector<std::unique_ptr<TrackingRegion> > result;
82  ev.getByToken( token_beamSpot, bsHandle);
83  if(bsHandle.isValid()) {
84 
85  const reco::BeamSpot & bs = *bsHandle;
86 
87  GlobalPoint origin(bs.x0(), bs.y0(), bs.z0());
88 
89  result.push_back( std::make_unique<GlobalTrackingRegion>(
91 
92  }
93  return result;
94  }
double z0() const
z coordinate
Definition: BeamSpot.h:68
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
tuple result
Definition: mps_fire.py:84
bool isValid() const
Definition: HandleBase.h:75
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