CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
GlobalTrackingRegionProducerFromBeamSpot.h
Go to the documentation of this file.
1 #ifndef RecoTracker_TkTrackingRegions_GlobalTrackingRegionProducerFromBeamSpot_H
2 #define RecoTracker_TkTrackingRegions_GlobalTrackingRegionProducerFromBeamSpot_H
3 
10 
12 
13 public:
14 
16 
17  edm::ParameterSet regionPSet = cfg.getParameter<edm::ParameterSet>("RegionPSet");
18  thePtMin = regionPSet.getParameter<double>("ptMin");
19  theOriginRadius = regionPSet.getParameter<double>("originRadius");
20  if (!regionPSet.existsAs<double>("nSigmaZ") && !regionPSet.existsAs<double>("originHalfLength")) {
21  throw cms::Exception("Configuration") << "GlobalTrackingRegionProducerFromBeamSpot: at least one of nSigmaZ, originHalfLength must be present in the cfg.\n";
22  }
23  theNSigmaZ = (regionPSet.existsAs<double>("nSigmaZ") ? regionPSet.getParameter<double>("nSigmaZ") : 0.0);
24  theOriginHalfLength = (regionPSet.existsAs<double>("originHalfLength") ? regionPSet.getParameter<double>("originHalfLength") : 0.0);
25  theBeamSpotTag = regionPSet.getParameter<edm::InputTag>("beamSpot");
26  thePrecise = regionPSet.getParameter<bool>("precise");
27  }
28 
30 
31  virtual std::vector<TrackingRegion* > regions(const edm::Event&ev, const edm::EventSetup&) const {
32  std::vector<TrackingRegion* > result;
34  ev.getByLabel( theBeamSpotTag, bsHandle);
35  if(bsHandle.isValid()) {
36 
37  const reco::BeamSpot & bs = *bsHandle;
38 
39  GlobalPoint origin(bs.x0(), bs.y0(), bs.z0());
40 
41  result.push_back( new GlobalTrackingRegion(
43 
44  }
45  return result;
46  }
47 
48 private:
49  double thePtMin;
52  double theNSigmaZ;
54  bool thePrecise;
55 };
56 
57 #endif
58 
T getParameter(std::string const &) const
double z0() const
z coordinate
Definition: BeamSpot.h:69
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:187
const T & max(const T &a, const T &b)
tuple result
Definition: query.py:137
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
double sigmaZ() const
sigma z
Definition: BeamSpot.h:81
virtual std::vector< TrackingRegion * > regions(const edm::Event &ev, const edm::EventSetup &) const
double y0() const
y coordinate
Definition: BeamSpot.h:67
double x0() const
x coordinate
Definition: BeamSpot.h:65