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() [1/2]

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

◆ GlobalTrackingRegionProducerFromBeamSpot() [2/2]

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

Definition at line 20 of file GlobalTrackingRegionProducerFromBeamSpot.h.

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

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

◆ ~GlobalTrackingRegionProducerFromBeamSpot()

GlobalTrackingRegionProducerFromBeamSpot::~GlobalTrackingRegionProducerFromBeamSpot ( )
inlineoverride

Definition at line 38 of file GlobalTrackingRegionProducerFromBeamSpot.h.

38 {}

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 40 of file GlobalTrackingRegionProducerFromBeamSpot.h.

40  {
41  {
43 
44  desc.add<bool>("precise", true);
45  desc.add<bool>("useMultipleScattering", false);
46  desc.add<double>("nSigmaZ", 4.0);
47  desc.add<double>("originHalfLength", 0.0); // this is the default in constructor
48  desc.add<double>("originRadius", 0.2);
49  desc.add<double>("ptMin", 0.9);
50  desc.add<edm::InputTag>("beamSpot", edm::InputTag("offlineBeamSpot"));
51 
52  // Only for backwards-compatibility
54  descRegion.add<edm::ParameterSetDescription>("RegionPSet", desc);
55 
56  descriptions.add("globalTrackingRegionFromBeamSpot", descRegion);
57  }
58 
59  {
61 
62  desc.add<bool>("precise", true);
63  desc.add<bool>("useMultipleScattering", false);
64  desc.add<double>("nSigmaZ", 0.0); // this is the default in constructor
65  desc.add<double>("originHalfLength", 21.2);
66  desc.add<double>("originRadius", 0.2);
67  desc.add<double>("ptMin", 0.9);
68  desc.add<edm::InputTag>("beamSpot", edm::InputTag("offlineBeamSpot"));
69 
70  // Only for backwards-compatibility
72  descRegion.add<edm::ParameterSetDescription>("RegionPSet", desc);
73 
74  descriptions.add("globalTrackingRegionFromBeamSpotFixedZ", descRegion);
75  }
76  }

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

◆ regions()

std::vector<std::unique_ptr<TrackingRegion> > GlobalTrackingRegionProducerFromBeamSpot::regions ( const edm::Event ev,
const edm::EventSetup  
) const
inlineoverridevirtual

Implements TrackingRegionProducer.

Definition at line 78 of file GlobalTrackingRegionProducerFromBeamSpot.h.

78  {
79  std::vector<std::unique_ptr<TrackingRegion> > result;
81  ev.getByToken(token_beamSpot, bsHandle);
82  if (bsHandle.isValid()) {
83  const reco::BeamSpot& bs = *bsHandle;
84 
85  GlobalPoint origin(bs.x0(), bs.y0(), bs.z0());
86 
87  result.push_back(std::make_unique<GlobalTrackingRegion>(thePtMin,
88  origin,
91  thePrecise,
92  theUseMS));
93  }
94  return result;
95  }

References cms::cuda::bs, ev, edm::HandleBase::isValid(), SiStripPI::max, mps_fire::result, theNSigmaZ, theOriginHalfLength, theOriginRadius, thePrecise, thePtMin, theUseMS, and token_beamSpot.

Member Data Documentation

◆ theNSigmaZ

double GlobalTrackingRegionProducerFromBeamSpot::theNSigmaZ
private

◆ theOriginHalfLength

double GlobalTrackingRegionProducerFromBeamSpot::theOriginHalfLength
private

◆ theOriginRadius

double GlobalTrackingRegionProducerFromBeamSpot::theOriginRadius
private

◆ thePrecise

bool GlobalTrackingRegionProducerFromBeamSpot::thePrecise
private

◆ thePtMin

double GlobalTrackingRegionProducerFromBeamSpot::thePtMin
private

◆ theUseMS

bool GlobalTrackingRegionProducerFromBeamSpot::theUseMS
private

◆ token_beamSpot

edm::EDGetTokenT<reco::BeamSpot> GlobalTrackingRegionProducerFromBeamSpot::token_beamSpot
private
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
GlobalTrackingRegionProducerFromBeamSpot::token_beamSpot
edm::EDGetTokenT< reco::BeamSpot > token_beamSpot
Definition: GlobalTrackingRegionProducerFromBeamSpot.h:102
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89287
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::ParameterSet::existsAs
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:171
GlobalTrackingRegionProducerFromBeamSpot::theOriginRadius
double theOriginRadius
Definition: GlobalTrackingRegionProducerFromBeamSpot.h:99
edm::Handle< reco::BeamSpot >
cms::cuda::bs
bs
Definition: HistoContainer.h:127
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
reco::BeamSpot
Definition: BeamSpot.h:21
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:55
Point3DBase< float, GlobalTag >
GlobalTrackingRegionProducerFromBeamSpot::thePtMin
double thePtMin
Definition: GlobalTrackingRegionProducerFromBeamSpot.h:98
GlobalTrackingRegionProducerFromBeamSpot::theNSigmaZ
double theNSigmaZ
Definition: GlobalTrackingRegionProducerFromBeamSpot.h:101
GlobalTrackingRegionProducerFromBeamSpot::thePrecise
bool thePrecise
Definition: GlobalTrackingRegionProducerFromBeamSpot.h:103
edm::ParameterSet
Definition: ParameterSet.h:47
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
GlobalTrackingRegionProducerFromBeamSpot::theOriginHalfLength
double theOriginHalfLength
Definition: GlobalTrackingRegionProducerFromBeamSpot.h:100
GlobalTrackingRegionProducerFromBeamSpot::theUseMS
bool theUseMS
Definition: GlobalTrackingRegionProducerFromBeamSpot.h:104
looper.cfg
cfg
Definition: looper.py:297
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
ev
bool ev
Definition: Hydjet2Hadronizer.cc:95
Exception
Definition: hltDiff.cc:246
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
mps_fire.result
result
Definition: mps_fire.py:311
GlobalTrackingRegionProducerFromBeamSpot::GlobalTrackingRegionProducerFromBeamSpot
GlobalTrackingRegionProducerFromBeamSpot(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
Definition: GlobalTrackingRegionProducerFromBeamSpot.h:18
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
edm::InputTag
Definition: InputTag.h:15