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 &es) const override
 
 ~GlobalTrackingRegionProducerFromBeamSpot () override=default
 
- 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
 
edm::ESGetToken< MultipleScatteringParametrisationMaker, TrackerMultipleScatteringRecordtoken_msmaker
 

Detailed Description

Definition at line 18 of file GlobalTrackingRegionProducerFromBeamSpot.h.

Constructor & Destructor Documentation

◆ GlobalTrackingRegionProducerFromBeamSpot() [1/2]

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

Definition at line 20 of file GlobalTrackingRegionProducerFromBeamSpot.h.

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

◆ GlobalTrackingRegionProducerFromBeamSpot() [2/2]

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

Definition at line 22 of file GlobalTrackingRegionProducerFromBeamSpot.h.

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

22  {
23  edm::ParameterSet regionPSet = cfg.getParameter<edm::ParameterSet>("RegionPSet");
24  thePtMin = regionPSet.getParameter<double>("ptMin");
25  theOriginRadius = regionPSet.getParameter<double>("originRadius");
26  if (!regionPSet.existsAs<double>("nSigmaZ") && !regionPSet.existsAs<double>("originHalfLength")) {
27  throw cms::Exception("Configuration") << "GlobalTrackingRegionProducerFromBeamSpot: at least one of nSigmaZ, "
28  "originHalfLength must be present in the cfg.\n";
29  }
30  theNSigmaZ = (regionPSet.existsAs<double>("nSigmaZ") ? regionPSet.getParameter<double>("nSigmaZ") : 0.0);
32  (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 =
36  (regionPSet.existsAs<bool>("useMultipleScattering") ? regionPSet.getParameter<bool>("useMultipleScattering")
37  : false);
38  if (theUseMS) {
40  }
41  }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:172
edm::ESGetToken< MultipleScatteringParametrisationMaker, TrackerMultipleScatteringRecord > token_msmaker

◆ ~GlobalTrackingRegionProducerFromBeamSpot()

GlobalTrackingRegionProducerFromBeamSpot::~GlobalTrackingRegionProducerFromBeamSpot ( )
overridedefault

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 45 of file GlobalTrackingRegionProducerFromBeamSpot.h.

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

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

◆ regions()

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

Implements TrackingRegionProducer.

Definition at line 83 of file GlobalTrackingRegionProducerFromBeamSpot.h.

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

84  {
85  std::vector<std::unique_ptr<TrackingRegion> > result;
87  ev.getByToken(token_beamSpot, bsHandle);
88  if (bsHandle.isValid()) {
89  const reco::BeamSpot& bs = *bsHandle;
90 
91  GlobalPoint origin(bs.x0(), bs.y0(), bs.z0());
92 
93  const MultipleScatteringParametrisationMaker* msmaker = nullptr;
94  if (theUseMS) {
95  msmaker = &es.getData(token_msmaker);
96  }
97 
98  result.push_back(std::make_unique<GlobalTrackingRegion>(thePtMin,
99  origin,
102  thePrecise,
103  theUseMS,
104  msmaker));
105  }
106  return result;
107  }
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
bool isValid() const
Definition: HandleBase.h:70
edm::ESGetToken< MultipleScatteringParametrisationMaker, TrackerMultipleScatteringRecord > token_msmaker

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

◆ token_msmaker

edm::ESGetToken<MultipleScatteringParametrisationMaker, TrackerMultipleScatteringRecord> GlobalTrackingRegionProducerFromBeamSpot::token_msmaker
private