CMS 3D CMS Logo

GlobalTrackingRegionProducerFromBeamSpot.h
Go to the documentation of this file.
1 #ifndef RecoTracker_TkTrackingRegions_GlobalTrackingRegionProducerFromBeamSpot_H
2 #define RecoTracker_TkTrackingRegions_GlobalTrackingRegionProducerFromBeamSpot_H
3 
15 
17 public:
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  }
37 
39 
40  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
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  }
77 
78  std::vector<std::unique_ptr<TrackingRegion> > regions(const edm::Event& ev, const edm::EventSetup&) const override {
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  }
96 
97 private:
98  double thePtMin;
101  double theNSigmaZ;
104  bool theUseMS;
105 };
106 
107 #endif
ConfigurationDescriptions.h
GlobalTrackingRegionProducerFromBeamSpot::~GlobalTrackingRegionProducerFromBeamSpot
~GlobalTrackingRegionProducerFromBeamSpot() override
Definition: GlobalTrackingRegionProducerFromBeamSpot.h:38
Handle.h
GlobalTrackingRegion.h
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
GlobalTrackingRegionProducerFromBeamSpot::regions
std::vector< std::unique_ptr< TrackingRegion > > regions(const edm::Event &ev, const edm::EventSetup &) const override
Definition: GlobalTrackingRegionProducerFromBeamSpot.h:78
GlobalTrackingRegionProducerFromBeamSpot::token_beamSpot
edm::EDGetTokenT< reco::BeamSpot > token_beamSpot
Definition: GlobalTrackingRegionProducerFromBeamSpot.h:102
edm::EDGetTokenT< reco::BeamSpot >
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 >
TrackingRegionProducer.h
cms::cuda::bs
bs
Definition: HistoContainer.h:127
BeamSpot.h
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 >
ParameterSetDescription.h
GlobalTrackingRegionProducerFromBeamSpot::GlobalTrackingRegionProducerFromBeamSpot
GlobalTrackingRegionProducerFromBeamSpot(const edm::ParameterSet &cfg, edm::ConsumesCollector &iC)
Definition: GlobalTrackingRegionProducerFromBeamSpot.h:20
GlobalTrackingRegionProducerFromBeamSpot::thePtMin
double thePtMin
Definition: GlobalTrackingRegionProducerFromBeamSpot.h:98
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
GlobalTrackingRegionProducerFromBeamSpot::theNSigmaZ
double theNSigmaZ
Definition: GlobalTrackingRegionProducerFromBeamSpot.h:101
GlobalTrackingRegionProducerFromBeamSpot::thePrecise
bool thePrecise
Definition: GlobalTrackingRegionProducerFromBeamSpot.h:103
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
GlobalTrackingRegionProducerFromBeamSpot::theOriginHalfLength
double theOriginHalfLength
Definition: GlobalTrackingRegionProducerFromBeamSpot.h:100
GlobalTrackingRegionProducerFromBeamSpot::theUseMS
bool theUseMS
Definition: GlobalTrackingRegionProducerFromBeamSpot.h:104
edm::EventSetup
Definition: EventSetup.h:57
InputTag.h
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
TrackingRegionProducer
Definition: TrackingRegionProducer.h:12
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
Exception.h
mps_fire.result
result
Definition: mps_fire.py:311
ConsumesCollector.h
GlobalTrackingRegionProducerFromBeamSpot::GlobalTrackingRegionProducerFromBeamSpot
GlobalTrackingRegionProducerFromBeamSpot(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
Definition: GlobalTrackingRegionProducerFromBeamSpot.h:18
ParameterSet.h
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
edm::Event
Definition: Event.h:73
edm::InputTag
Definition: InputTag.h:15
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
GlobalTrackingRegionProducerFromBeamSpot::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: GlobalTrackingRegionProducerFromBeamSpot.h:40
GlobalTrackingRegionProducerFromBeamSpot
Definition: GlobalTrackingRegionProducerFromBeamSpot.h:16