CMS 3D CMS Logo

PrimaryVertexResolution.cc
Go to the documentation of this file.
7 
10 
17 
22 
24 
25 #include <random>
26 
27 namespace {
28  template <typename T, size_t N>
29  std::array<T, N + 1> makeLogBins(const double min, const double max) {
30  const double minLog10 = std::log10(min);
31  const double maxLog10 = std::log10(max);
32  const double width = (maxLog10 - minLog10) / N;
33  std::array<T, N + 1> ret;
34  ret[0] = std::pow(10, minLog10);
35  const double mult = std::pow(10, width);
36  for (size_t i = 1; i <= N; ++i) {
37  ret[i] = ret[i - 1] * mult;
38  }
39  return ret;
40  }
41 
42  template <typename T>
43  T sqr(T val) {
44  return val * val;
45  }
46 } // namespace
47 
49 public:
51  ~PrimaryVertexResolution() override;
52 
53  void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
54  void analyze(const edm::Event&, const edm::EventSetup&) override;
55 
56  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
57 
58 private:
59  std::vector<reco::TransientTrack> sortTracksByPt(const reco::Vertex& thePV,
60  const TransientTrackBuilder& ttBuilder,
61  const reco::BeamSpot& beamspot);
62 
67  const bool forceSCAL_;
70 
72 
73  struct BinningY {
74  explicit BinningY(const edm::ParameterSet& iConfig)
75  : maxResol_(iConfig.getUntrackedParameter<double>("maxResol")),
76  binsResol_(iConfig.getUntrackedParameter<int>("binsResol")),
77  maxPull_(iConfig.getUntrackedParameter<double>("maxPull")),
78  binsPull_(iConfig.getUntrackedParameter<int>("binsPull")) {}
79 
80  const double maxResol_;
81  const int binsResol_;
82  const double maxPull_;
83  const int binsPull_;
84  };
85 
86  struct BinningX {
87  explicit BinningX(const edm::ParameterSet& iConfig)
88  : minNtracks_(iConfig.getUntrackedParameter<double>("minNtracks")),
89  maxNtracks_(iConfig.getUntrackedParameter<double>("maxNtracks")),
90  binsNtracks_(iConfig.getUntrackedParameter<int>("binsNtracks")),
91  minNvertices_(iConfig.getUntrackedParameter<double>("minNvertices")),
92  maxNvertices_(iConfig.getUntrackedParameter<double>("maxNvertices")),
93  binsNvertices_(iConfig.getUntrackedParameter<int>("binsNvertices")),
94  maxXY_(iConfig.getUntrackedParameter<double>("maxXY")),
95  binsXY_(iConfig.getUntrackedParameter<int>("binsXY")),
96  maxZ_(iConfig.getUntrackedParameter<double>("maxZ")),
97  binsZ_(iConfig.getUntrackedParameter<int>("binsZ")),
98  minPt_(iConfig.getUntrackedParameter<double>("minPt")),
99  maxPt_(iConfig.getUntrackedParameter<double>("maxPt")),
100  minLumi_(iConfig.getUntrackedParameter<double>("minLumi")),
101  maxLumi_(iConfig.getUntrackedParameter<double>("maxLumi")) {}
102 
103  const int minNtracks_;
104  const int maxNtracks_;
105  const int binsNtracks_;
106  const int minNvertices_;
107  const int maxNvertices_;
108  const int binsNvertices_;
109  const double maxXY_;
110  const int binsXY_;
111  const double maxZ_;
112  const int binsZ_;
113  const double minPt_;
114  const double maxPt_;
115  const double minLumi_;
116  const double maxLumi_;
117  };
118 
119  class Resolution {
120  public:
121  Resolution(const reco::Vertex& vertex1, const reco::Vertex& vertex2) {
122  const double diffx = vertex1.x() - vertex2.x();
123  const double diffy = vertex1.y() - vertex2.y();
124  const double diffz = vertex1.z() - vertex2.z();
125 
126  // Take into account the need to divide by sqrt(2) already in
127  // the filling so that we can use DQMGenericClient for the
128  // gaussian fits
129  const double invSqrt2 = 1. / std::sqrt(2.);
130  resx_ = diffx * invSqrt2;
131  resy_ = diffy * invSqrt2;
132  resz_ = diffz * invSqrt2;
133 
134  pullx_ = diffx / std::sqrt(sqr(vertex1.xError()) + sqr(vertex2.xError()));
135  pully_ = diffy / std::sqrt(sqr(vertex1.yError()) + sqr(vertex2.yError()));
136  pullz_ = diffz / std::sqrt(sqr(vertex1.zError()) + sqr(vertex2.zError()));
137 
138  avgx_ = (vertex1.x() + vertex2.x()) / 2.;
139  avgy_ = (vertex1.y() + vertex2.y()) / 2.;
140  avgz_ = (vertex1.z() + vertex2.z()) / 2.;
141  }
142 
143  double resx() const { return resx_; }
144  double resy() const { return resy_; }
145  double resz() const { return resz_; }
146 
147  double pullx() const { return pullx_; }
148  double pully() const { return pully_; }
149  double pullz() const { return pullz_; }
150 
151  double avgx() const { return avgx_; }
152  double avgy() const { return avgy_; }
153  double avgz() const { return avgz_; }
154 
155  private:
156  double resx_;
157  double resy_;
158  double resz_;
159  double pullx_;
160  double pully_;
161  double pullz_;
162  double avgx_;
163  double avgy_;
164  double avgz_;
165  };
166 
167  class DiffPlots {
168  public:
169  explicit DiffPlots(const std::string& postfix, const BinningY& binY) : postfix_(postfix), binningY_(binY) {}
170 
171  template <typename T>
172  void bookLogX(DQMStore::IBooker& iBooker, const T& binArray) {
173  book(iBooker, binArray.size() - 1, binArray.front(), binArray.back());
174  setLogX(binArray.size() - 1, binArray.data());
175  }
176 
177  template <typename... Args>
178  void book(DQMStore::IBooker& iBooker, Args&&... args) {
179  const auto binsResol = binningY_.binsResol_;
180  const auto maxResol = binningY_.maxResol_;
181  hDiffX_ = iBooker.book2D("res_x_vs_" + postfix_,
182  "Resolution of X vs. " + postfix_,
183  std::forward<Args>(args)...,
184  binsResol,
185  -maxResol,
186  maxResol);
187  hDiffY_ = iBooker.book2D("res_y_vs_" + postfix_,
188  "Resolution of Y vs. " + postfix_,
189  std::forward<Args>(args)...,
190  binsResol,
191  -maxResol,
192  maxResol);
193  hDiffZ_ = iBooker.book2D("res_z_vs_" + postfix_,
194  "Resolution of Z vs. " + postfix_,
195  std::forward<Args>(args)...,
196  binsResol,
197  -maxResol,
198  maxResol);
199 
200  const auto binsPull = binningY_.binsPull_;
201  const auto maxPull = binningY_.maxPull_;
202  hPullX_ = iBooker.book2D("pull_x_vs_" + postfix_,
203  "Pull of X vs. " + postfix_,
204  std::forward<Args>(args)...,
205  binsPull,
206  -maxPull,
207  maxPull);
208  hPullY_ = iBooker.book2D("pull_y_vs_" + postfix_,
209  "Pull of Y vs. " + postfix_,
210  std::forward<Args>(args)...,
211  binsPull,
212  -maxPull,
213  maxPull);
214  hPullZ_ = iBooker.book2D("pull_z_vs_" + postfix_,
215  "Pull of Z vs. " + postfix_,
216  std::forward<Args>(args)...,
217  binsPull,
218  -maxPull,
219  maxPull);
220  }
221  template <typename... Args>
222  void setLogX(Args&&... args) {
223  hDiffX_->getTH2F()->GetXaxis()->Set(std::forward<Args>(args)...);
224  hDiffY_->getTH2F()->GetXaxis()->Set(std::forward<Args>(args)...);
225  hDiffZ_->getTH2F()->GetXaxis()->Set(std::forward<Args>(args)...);
226 
227  hPullX_->getTH2F()->GetXaxis()->Set(std::forward<Args>(args)...);
228  hPullY_->getTH2F()->GetXaxis()->Set(std::forward<Args>(args)...);
229  hPullZ_->getTH2F()->GetXaxis()->Set(std::forward<Args>(args)...);
230  }
231 
232  template <typename T>
233  void fill(const Resolution& res, const T ref) {
234  hDiffX_->Fill(ref, res.resx());
235  hDiffY_->Fill(ref, res.resy());
236  hDiffZ_->Fill(ref, res.resz());
237  hPullX_->Fill(ref, res.pullx());
238  hPullY_->Fill(ref, res.pully());
239  hPullZ_->Fill(ref, res.pullz());
240  }
241 
242  private:
251  };
252 
253  class Plots {
254  public:
255  Plots(const BinningX& binX, const BinningY& binY)
256  : binningX_(binX),
257  binningY_(binY),
258  hDiff_Ntracks_("ntracks", binY),
259  hDiff_sumPt_("sumpt", binY),
260  hDiff_Nvertices_("nvertices", binY),
261  hDiff_X_("X", binY),
262  hDiff_Y_("Y", binY),
263  hDiff_Z_("Z", binY),
264  hDiff_instLumiScal_("instLumiScal", binY) {}
265 
266  void book(DQMStore::IBooker& iBooker) {
267  const auto binsResol = binningY_.binsResol_;
268  const auto maxResol = binningY_.maxResol_;
269  hDiffX_ = iBooker.book1D("res_x", "Resolution of X", binsResol, -maxResol, maxResol);
270  hDiffY_ = iBooker.book1D("res_y", "Resolution of Y", binsResol, -maxResol, maxResol);
271  hDiffZ_ = iBooker.book1D("res_z", "Resolution of Z", binsResol, -maxResol, maxResol);
272 
273  const auto binsPull = binningY_.binsPull_;
274  const auto maxPull = binningY_.maxPull_;
275  hPullX_ = iBooker.book1D(+"pull_x", "Pull of X", binsPull, -maxPull, maxPull);
276  hPullY_ = iBooker.book1D(+"pull_y", "Pull of Y", binsPull, -maxPull, maxPull);
277  hPullZ_ = iBooker.book1D(+"pull_z", "Pull of Z", binsPull, -maxPull, maxPull);
278 
284 
285  constexpr int binsPt = 30;
286  hDiff_sumPt_.bookLogX(iBooker, makeLogBins<float, binsPt>(binningX_.minPt_, binningX_.maxPt_));
287 
288  constexpr int binsLumi = 100;
289  hDiff_instLumiScal_.bookLogX(iBooker, makeLogBins<float, binsLumi>(binningX_.minLumi_, binningX_.maxLumi_));
290  }
291 
292  void calculateAndFillResolution(const std::vector<reco::TransientTrack>& tracks,
293  size_t nvertices,
294  float lumi,
295  std::mt19937& engine,
296  AdaptiveVertexFitter& fitter);
297 
298  private:
301 
308 
316  };
317 
318  // Binning
321 
322  // Histograms
325 
326  std::mt19937 engine_;
327 };
328 
330  : vertexSrc_(consumes<reco::VertexCollection>(iConfig.getUntrackedParameter<edm::InputTag>("vertexSrc"))),
331  beamspotSrc_(consumes<reco::BeamSpot>(iConfig.getUntrackedParameter<edm::InputTag>("beamspotSrc"))),
332  lumiScalersSrc_(consumes<LumiScalersCollection>(iConfig.getUntrackedParameter<edm::InputTag>("lumiScalersSrc"))),
333  metaDataSrc_(consumes<OnlineLuminosityRecord>(iConfig.getUntrackedParameter<edm::InputTag>("metaDataSrc"))),
334  forceSCAL_(iConfig.getUntrackedParameter<bool>("forceSCAL")),
335  rootFolder_(iConfig.getUntrackedParameter<std::string>("rootFolder")),
336  transientTrackBuilder_(iConfig.getUntrackedParameter<std::string>("transientTrackBuilder")),
337  binningX_(iConfig),
338  binningY_(iConfig),
339  hPV_(binningX_, binningY_),
340  hOtherV_(binningX_, binningY_) {}
341 
343 
346  desc.addUntracked<edm::InputTag>("vertexSrc", edm::InputTag("trackingDQMgoodOfflinePrimaryVertices"));
347  desc.addUntracked<edm::InputTag>("beamspotSrc", edm::InputTag("offlineBeamSpot"));
348  desc.addUntracked<edm::InputTag>("lumiScalersSrc", edm::InputTag("scalersRawToDigi"));
349  desc.addUntracked<edm::InputTag>("metaDataSrc", edm::InputTag("onlineMetaDataDigis"));
350  desc.addUntracked<bool>("forceSCAL", true);
351  desc.addUntracked<std::string>("rootFolder", "OfflinePV/Resolution");
352  desc.addUntracked<std::string>("transientTrackBuilder", "TransientTrackBuilder");
353 
354  // Y axes
355  desc.addUntracked<double>("maxResol", 0.02);
356  desc.addUntracked<int>("binsResol", 100);
357 
358  desc.addUntracked<double>("maxPull", 5);
359  desc.addUntracked<int>("binsPull", 100);
360 
361  // X axes
362  desc.addUntracked<double>("minNtracks", -0.5);
363  desc.addUntracked<double>("maxNtracks", 119.5);
364  desc.addUntracked<int>("binsNtracks", 60);
365 
366  desc.addUntracked<double>("minNvertices", -0.5);
367  desc.addUntracked<double>("maxNvertices", 199.5);
368  desc.addUntracked<int>("binsNvertices", 100);
369 
370  desc.addUntracked<double>("maxXY", 0.15);
371  desc.addUntracked<int>("binsXY", 100);
372 
373  desc.addUntracked<double>("maxZ", 30.);
374  desc.addUntracked<int>("binsZ", 100);
375 
376  desc.addUntracked<double>("minPt", 1);
377  desc.addUntracked<double>("maxPt", 1e3);
378 
379  desc.addUntracked<double>("minLumi", 200.);
380  desc.addUntracked<double>("maxLumi", 20000.);
381 
382  descriptions.add("primaryVertexResolution", desc);
383 }
384 
386  iBooker.setCurrentFolder(rootFolder_ + "/PV");
387  hPV_.book(iBooker);
388 
389  iBooker.setCurrentFolder(rootFolder_ + "/OtherV");
390  hOtherV_.book(iBooker);
391 }
392 
395  iEvent.getByToken(vertexSrc_, hvertices);
396  const reco::VertexCollection& vertices = *hvertices;
397  if (vertices.empty())
398  return;
399 
400  edm::Handle<reco::BeamSpot> hbeamspot;
401  iEvent.getByToken(beamspotSrc_, hbeamspot);
402  const reco::BeamSpot& beamspot = *hbeamspot;
403 
404  float lumi = -1.;
405  if (forceSCAL_) {
407  iEvent.getByToken(lumiScalersSrc_, lumiScalers);
408  if (lumiScalers.isValid() && !lumiScalers->empty()) {
409  LumiScalersCollection::const_iterator scalit = lumiScalers->begin();
410  lumi = scalit->instantLumi();
411  }
412  } else {
414  iEvent.getByToken(metaDataSrc_, metaData);
415  if (metaData.isValid())
416  lumi = metaData->instLumi();
417  }
418 
419  edm::ESHandle<TransientTrackBuilder> ttBuilderHandle;
420  iSetup.get<TransientTrackRecord>().get(transientTrackBuilder_, ttBuilderHandle);
421  const TransientTrackBuilder& ttBuilder = *ttBuilderHandle;
422 
423  // deterministic seed from the event number
424  // should not bias the result as the event number is already
425  // assigned randomly-enough
426  engine_.seed(iEvent.id().event() + (iEvent.id().luminosityBlock() << 10) + (iEvent.id().run() << 20));
427 
428  // The PV
429  auto iPV = cbegin(vertices);
430  const reco::Vertex& thePV = *iPV;
431  const auto nvertices = vertices.size();
432  if (thePV.tracksSize() >= 4) {
433  auto sortedTracks = sortTracksByPt(thePV, ttBuilder, beamspot);
434  hPV_.calculateAndFillResolution(sortedTracks, nvertices, lumi, engine_, fitter_);
435  }
436  ++iPV;
437 
438  // Other vertices
439  for (auto endPV = cend(vertices); iPV != endPV; ++iPV) {
440  if (iPV->tracksSize() >= 4) {
441  auto sortedTracks = sortTracksByPt(*iPV, ttBuilder, beamspot);
442  hOtherV_.calculateAndFillResolution(sortedTracks, nvertices, lumi, engine_, fitter_);
443  }
444  }
445 }
446 
447 std::vector<reco::TransientTrack> PrimaryVertexResolution::sortTracksByPt(const reco::Vertex& thePV,
448  const TransientTrackBuilder& ttBuilder,
449  const reco::BeamSpot& beamspot) {
450  std::vector<const reco::Track*> sortedTracks;
451  sortedTracks.reserve(thePV.tracksSize());
453  thePV.tracks_begin(), thePV.tracks_end(), std::back_inserter(sortedTracks), [](const reco::TrackBaseRef& ref) {
454  return &(*ref);
455  });
456  std::sort(sortedTracks.begin(), sortedTracks.end(), [](const reco::Track* a, const reco::Track* b) {
457  return a->pt() > b->pt();
458  });
459 
460  std::vector<reco::TransientTrack> ttracks;
461  ttracks.reserve(sortedTracks.size());
462  std::transform(sortedTracks.begin(), sortedTracks.end(), std::back_inserter(ttracks), [&](const reco::Track* track) {
463  auto tt = ttBuilder.build(track);
464  tt.setBeamSpot(beamspot);
465  return tt;
466  });
467  return ttracks;
468 }
469 
470 void PrimaryVertexResolution::Plots::calculateAndFillResolution(const std::vector<reco::TransientTrack>& tracks,
471  size_t nvertices,
472  float lumi,
473  std::mt19937& engine,
474  AdaptiveVertexFitter& fitter) {
475  const size_t end = tracks.size() % 2 == 0 ? tracks.size() : tracks.size() - 1;
476 
477  std::vector<reco::TransientTrack> set1, set2;
478  set1.reserve(end / 2);
479  set2.reserve(end / 2);
480 
481  auto dis = std::uniform_int_distribution<>(0, 1); // [0, 1]
482 
483  double sumpt1 = 0, sumpt2 = 0;
484  for (size_t i = 0; i < end; i += 2) {
485  const size_t set1_i = dis(engine);
486  const size_t set2_i = 1 - set1_i;
487 
488  set1.push_back(tracks[i + set1_i]);
489  set2.push_back(tracks[i + set2_i]);
490 
491  sumpt1 += set1.back().track().pt();
492  sumpt2 += set2.back().track().pt();
493  }
494 
495  // For resolution we only fit
496  TransientVertex vertex1 = fitter.vertex(set1);
497  TransientVertex vertex2 = fitter.vertex(set2);
498 
499  Resolution res(vertex1, vertex2);
500  hDiffX_->Fill(res.resx());
501  hDiffY_->Fill(res.resy());
502  hDiffZ_->Fill(res.resz());
503  hPullX_->Fill(res.pullx());
504  hPullY_->Fill(res.pully());
505  hPullZ_->Fill(res.pullz());
506 
507  hDiff_Ntracks_.fill(res, set1.size());
509  res,
510  (sumpt1 + sumpt2) /
511  2.0); // taking average is probably the best we can do, anyway they should be close to each other
512  hDiff_Nvertices_.fill(res, nvertices);
513 
514  if (vertex1.isValid() && vertex2.isValid()) {
515  hDiff_X_.fill(res, res.avgx());
516  hDiff_Y_.fill(res, res.avgy());
517  hDiff_Z_.fill(res, res.avgz());
518  }
519 
521 }
522 
PrimaryVertexResolution::Resolution::avgz_
double avgz_
Definition: PrimaryVertexResolution.cc:164
AdaptiveVertexFitter
Definition: AdaptiveVertexFitter.h:29
ConfigurationDescriptions.h
runTheMatrix.ret
ret
prodAgent to be discontinued
Definition: runTheMatrix.py:367
writedatasetfile.args
args
Definition: writedatasetfile.py:18
dqm::impl::MonitorElement
Definition: MonitorElement.h:98
LumiScalers.h
ApeEstimator_cff.width
width
Definition: ApeEstimator_cff.py:24
Handle.h
PrimaryVertexResolution::PrimaryVertexResolution
PrimaryVertexResolution(const edm::ParameterSet &iConfig)
Definition: PrimaryVertexResolution.cc:329
PDWG_EXOHSCP_cff.tracks
tracks
Definition: PDWG_EXOHSCP_cff.py:28
PrimaryVertexResolution::Resolution
Definition: PrimaryVertexResolution.cc:119
electrons_cff.bool
bool
Definition: electrons_cff.py:393
mps_fire.i
i
Definition: mps_fire.py:428
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11779
MessageLogger.h
PrimaryVertexResolution::BinningY::maxPull_
const double maxPull_
Definition: PrimaryVertexResolution.cc:82
PrimaryVertexResolution::BinningY::BinningY
BinningY(const edm::ParameterSet &iConfig)
Definition: PrimaryVertexResolution.cc:74
ESHandle.h
align::BeamSpot
Definition: StructureType.h:89
PrimaryVertexResolution::DiffPlots::hDiffX_
MonitorElement * hDiffX_
Definition: PrimaryVertexResolution.cc:245
groupFilesInBlocks.tt
int tt
Definition: groupFilesInBlocks.py:144
PrimaryVertexResolution::Plots::hDiff_Ntracks_
DiffPlots hDiff_Ntracks_
Definition: PrimaryVertexResolution.cc:309
TransientVertex::isValid
bool isValid() const
Definition: TransientVertex.h:195
PrimaryVertexResolution::Resolution::pully
double pully() const
Definition: PrimaryVertexResolution.cc:148
edm::Run
Definition: Run.h:45
min
T min(T a, T b)
Definition: MathUtil.h:58
reco::Vertex::z
double z() const
z coordinate
Definition: Vertex.h:120
PrimaryVertexResolution::Resolution::pullz
double pullz() const
Definition: PrimaryVertexResolution.cc:149
PrimaryVertexResolution::Resolution::pully_
double pully_
Definition: PrimaryVertexResolution.cc:160
edm::EDGetTokenT< reco::VertexCollection >
PrimaryVertexResolution::Plots::hDiffZ_
MonitorElement * hDiffZ_
Definition: PrimaryVertexResolution.cc:304
PrimaryVertexResolution::Plots::hDiff_X_
DiffPlots hDiff_X_
Definition: PrimaryVertexResolution.cc:312
edm
HLT enums.
Definition: AlignableModifier.h:19
V0Monitor_cfi.lumiScalers
lumiScalers
Definition: V0Monitor_cfi.py:9
reco::VertexCollection
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
PrimaryVertexResolution::DiffPlots::setLogX
void setLogX(Args &&... args)
Definition: PrimaryVertexResolution.cc:222
PrimaryVertexResolution::Plots::calculateAndFillResolution
void calculateAndFillResolution(const std::vector< reco::TransientTrack > &tracks, size_t nvertices, float lumi, std::mt19937 &engine, AdaptiveVertexFitter &fitter)
Definition: PrimaryVertexResolution.cc:470
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89353
PrimaryVertexResolution::Plots::hDiff_Y_
DiffPlots hDiff_Y_
Definition: PrimaryVertexResolution.cc:313
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
PrimaryVertexResolution::DiffPlots::DiffPlots
DiffPlots(const std::string &postfix, const BinningY &binY)
Definition: PrimaryVertexResolution.cc:169
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
sqr
int sqr(const T &t)
Definition: pfalgo_common_ref.h:9
PrimaryVertexResolution::engine_
std::mt19937 engine_
Definition: PrimaryVertexResolution.cc:326
DQMStore.h
PrimaryVertexResolution::DiffPlots
Definition: PrimaryVertexResolution.cc:167
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
TransientTrack.h
PrimaryVertexResolution::Plots::book
void book(DQMStore::IBooker &iBooker)
Definition: PrimaryVertexResolution.cc:266
AdaptiveVertexFitter::vertex
CachingVertex< 5 > vertex(const std::vector< reco::TransientTrack > &) const override
Definition: AdaptiveVertexFitter.cc:158
edm::Handle< reco::VertexCollection >
PrimaryVertexResolution::DiffPlots::postfix_
std::string postfix_
Definition: PrimaryVertexResolution.cc:243
PrimaryVertexResolution::Plots::hDiff_instLumiScal_
DiffPlots hDiff_instLumiScal_
Definition: PrimaryVertexResolution.cc:315
PrimaryVertexResolution::hPV_
Plots hPV_
Definition: PrimaryVertexResolution.cc:323
PrimaryVertexResolution::BinningX::maxNvertices_
const int maxNvertices_
Definition: PrimaryVertexResolution.cc:107
PrimaryVertexResolution::DiffPlots::hPullZ_
MonitorElement * hPullZ_
Definition: PrimaryVertexResolution.cc:250
PrimaryVertexResolution::BinningX::maxLumi_
const double maxLumi_
Definition: PrimaryVertexResolution.cc:116
PrimaryVertexResolution::Resolution::avgz
double avgz() const
Definition: PrimaryVertexResolution.cc:153
PrimaryVertexResolution::transientTrackBuilder_
std::string transientTrackBuilder_
Definition: PrimaryVertexResolution.cc:69
PrimaryVertexResolution::binningX_
BinningX binningX_
Definition: PrimaryVertexResolution.cc:319
PrimaryVertexResolution::BinningY::binsPull_
const int binsPull_
Definition: PrimaryVertexResolution.cc:83
dqm::impl::MonitorElement::getTH2F
virtual TH2F * getTH2F()
Definition: MonitorElement.cc:992
MakerMacros.h
PrimaryVertexResolution::Plots::hPullZ_
MonitorElement * hPullZ_
Definition: PrimaryVertexResolution.cc:307
PrimaryVertexResolution::BinningY::binsResol_
const int binsResol_
Definition: PrimaryVertexResolution.cc:81
PrimaryVertexResolution::lumiScalersSrc_
edm::EDGetTokenT< LumiScalersCollection > lumiScalersSrc_
Definition: PrimaryVertexResolution.cc:65
PrimaryVertexResolution::Resolution::resz
double resz() const
Definition: PrimaryVertexResolution.cc:145
PrimaryVertexResolution::BinningX::maxNtracks_
const int maxNtracks_
Definition: PrimaryVertexResolution.cc:104
PrimaryVertexResolution::BinningX::minNvertices_
const int minNvertices_
Definition: PrimaryVertexResolution.cc:106
PrimaryVertexResolution::binningY_
BinningY binningY_
Definition: PrimaryVertexResolution.cc:320
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
BeamSpot.h
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
reco::Vertex::xError
double xError() const
error on x
Definition: Vertex.h:124
PrimaryVertexResolution::~PrimaryVertexResolution
~PrimaryVertexResolution() override
Definition: PrimaryVertexResolution.cc:342
PrimaryVertexResolution::DiffPlots::hPullX_
MonitorElement * hPullX_
Definition: PrimaryVertexResolution.cc:248
PVValHelper::makeLogBins
std::array< T, N+1 > makeLogBins(const T &min, const T &max)
Definition: PVValidationHelpers.h:29
PrimaryVertexResolution::BinningX::binsNvertices_
const int binsNvertices_
Definition: PrimaryVertexResolution.cc:108
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
mps_fire.end
end
Definition: mps_fire.py:242
reco::Vertex::tracks_end
trackRef_iterator tracks_end() const
last iterator over tracks
Definition: Vertex.cc:73
reco::BeamSpot
Definition: BeamSpot.h:21
TransientTrackRecord
Definition: TransientTrackRecord.h:11
PrimaryVertexResolution::Resolution::Resolution
Resolution(const reco::Vertex &vertex1, const reco::Vertex &vertex2)
Definition: PrimaryVertexResolution.cc:121
reco::Track
Definition: Track.h:27
PrimaryVertexResolution::DiffPlots::hDiffY_
MonitorElement * hDiffY_
Definition: PrimaryVertexResolution.cc:246
edm::ESHandle< TransientTrackBuilder >
N
#define N
Definition: blowfish.cc:9
PrimaryVertexResolution::BinningX::BinningX
BinningX(const edm::ParameterSet &iConfig)
Definition: PrimaryVertexResolution.cc:87
PrimaryVertexResolution::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: PrimaryVertexResolution.cc:393
beamspot
Definition: BeamSpotWrite2Txt.h:8
PrimaryVertexResolution::Resolution::pullx
double pullx() const
Definition: PrimaryVertexResolution.cc:147
PrimaryVertexResolution::vertexSrc_
edm::EDGetTokenT< reco::VertexCollection > vertexSrc_
Definition: PrimaryVertexResolution.cc:63
PrimaryVertexResolution::DiffPlots::bookLogX
void bookLogX(DQMStore::IBooker &iBooker, const T &binArray)
Definition: PrimaryVertexResolution.cc:172
HcalDetIdTransform::transform
unsigned transform(const HcalDetId &id, unsigned transformCode)
Definition: HcalDetIdTransform.cc:7
PrimaryVertexResolution::Resolution::resx
double resx() const
Definition: PrimaryVertexResolution.cc:143
PrimaryVertexResolution::Plots::binningX_
const BinningX & binningX_
Definition: PrimaryVertexResolution.cc:299
ParameterSetDescription.h
PrimaryVertexResolution::BinningX::binsZ_
const int binsZ_
Definition: PrimaryVertexResolution.cc:112
b
double b
Definition: hdecay.h:118
PrimaryVertexResolution::Resolution::resy
double resy() const
Definition: PrimaryVertexResolution.cc:144
DQMEDAnalyzer.h
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
reco::Vertex::zError
double zError() const
error on z
Definition: Vertex.h:128
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
Vertex.h
PrimaryVertexResolution::Plots::hDiffY_
MonitorElement * hDiffY_
Definition: PrimaryVertexResolution.cc:303
PrimaryVertexResolution::rootFolder_
std::string rootFolder_
Definition: PrimaryVertexResolution.cc:68
PrimaryVertexResolution::BinningX::minLumi_
const double minLumi_
Definition: PrimaryVertexResolution.cc:115
DQMEDAnalyzer
Definition: DQMEDAnalyzer.py:1
PrimaryVertexResolution::DiffPlots::hDiffZ_
MonitorElement * hDiffZ_
Definition: PrimaryVertexResolution.cc:247
TransientTrackBuilder.h
edm::ParameterSet
Definition: ParameterSet.h:47
PrimaryVertexResolution::Resolution::pullz_
double pullz_
Definition: PrimaryVertexResolution.cc:161
a
double a
Definition: hdecay.h:119
PrimaryVertexResolution::Plots::hDiff_Nvertices_
DiffPlots hDiff_Nvertices_
Definition: PrimaryVertexResolution.cc:311
Event.h
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
reco::Vertex::tracks_begin
trackRef_iterator tracks_begin() const
first iterator over tracks
Definition: Vertex.cc:71
PrimaryVertexResolution::DiffPlots::fill
void fill(const Resolution &res, const T ref)
Definition: PrimaryVertexResolution.cc:233
PrimaryVertexResolution::BinningX::minPt_
const double minPt_
Definition: PrimaryVertexResolution.cc:113
reco::Vertex::x
double x() const
x coordinate
Definition: Vertex.h:116
LumiScalersCollection
std::vector< LumiScalers > LumiScalersCollection
Definition: LumiScalers.h:144
PrimaryVertexResolution::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: PrimaryVertexResolution.cc:344
PrimaryVertexResolution::Resolution::resz_
double resz_
Definition: PrimaryVertexResolution.cc:158
createfilelist.int
int
Definition: createfilelist.py:10
reco::Vertex::tracksSize
size_t tracksSize() const
number of tracks
Definition: Vertex.cc:69
iEvent
int iEvent
Definition: GenABIO.cc:224
PrimaryVertexResolution::Resolution::avgy_
double avgy_
Definition: PrimaryVertexResolution.cc:163
PrimaryVertexResolution::hOtherV_
Plots hOtherV_
Definition: PrimaryVertexResolution.cc:324
PrimaryVertexResolution::DiffPlots::binningY_
const BinningY & binningY_
Definition: PrimaryVertexResolution.cc:244
PrimaryVertexResolution::bookHistograms
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: PrimaryVertexResolution.cc:385
PrimaryVertexResolution::Plots
Definition: PrimaryVertexResolution.cc:253
TransientTrackBuilder
Definition: TransientTrackBuilder.h:16
PrimaryVertexResolution::BinningX::binsNtracks_
const int binsNtracks_
Definition: PrimaryVertexResolution.cc:105
TransientVertex
Definition: TransientVertex.h:18
edm::EventSetup
Definition: EventSetup.h:57
PrimaryVertexResolution::BinningX::binsXY_
const int binsXY_
Definition: PrimaryVertexResolution.cc:110
TransientTrackRecord.h
PrimaryVertexResolution::Plots::hDiff_Z_
DiffPlots hDiff_Z_
Definition: PrimaryVertexResolution.cc:314
get
#define get
res
Definition: Electron.h:6
PrimaryVertexResolution::sortTracksByPt
std::vector< reco::TransientTrack > sortTracksByPt(const reco::Vertex &thePV, const TransientTrackBuilder &ttBuilder, const reco::BeamSpot &beamspot)
Definition: PrimaryVertexResolution.cc:447
PrimaryVertexResolution::Plots::hDiffX_
MonitorElement * hDiffX_
Definition: PrimaryVertexResolution.cc:302
OnlineLuminosityRecord.h
PrimaryVertexResolution::BinningY
Definition: PrimaryVertexResolution.cc:73
SiPixelPhase1Clusters_cfi.e3
e3
Definition: SiPixelPhase1Clusters_cfi.py:9
VertexFwd.h
PrimaryVertexResolution::fitter_
AdaptiveVertexFitter fitter_
Definition: PrimaryVertexResolution.cc:71
PrimaryVertexResolution::DiffPlots::book
void book(DQMStore::IBooker &iBooker, Args &&... args)
Definition: PrimaryVertexResolution.cc:178
PrimaryVertexResolution::Plots::hPullX_
MonitorElement * hPullX_
Definition: PrimaryVertexResolution.cc:305
TransientVertex.h
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
heppy_batch.val
val
Definition: heppy_batch.py:351
std
Definition: JetResolutionObject.h:76
reco::Vertex::y
double y() const
y coordinate
Definition: Vertex.h:118
PrimaryVertexResolution::Plots::Plots
Plots(const BinningX &binX, const BinningY &binY)
Definition: PrimaryVertexResolution.cc:255
PrimaryVertexResolution::beamspotSrc_
edm::EDGetTokenT< reco::BeamSpot > beamspotSrc_
Definition: PrimaryVertexResolution.cc:64
PrimaryVertexResolution
Definition: PrimaryVertexResolution.cc:48
T
long double T
Definition: Basic3DVectorLD.h:48
dqm::implementation::IBooker::book2D
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:177
PrimaryVertexResolution::metaDataSrc_
edm::EDGetTokenT< OnlineLuminosityRecord > metaDataSrc_
Definition: PrimaryVertexResolution.cc:66
PrimaryVertexResolution::Plots::hPullY_
MonitorElement * hPullY_
Definition: PrimaryVertexResolution.cc:306
PrimaryVertexResolution::Resolution::pullx_
double pullx_
Definition: PrimaryVertexResolution.cc:159
PrimaryVertexResolution::Resolution::avgx_
double avgx_
Definition: PrimaryVertexResolution.cc:162
OnlineLuminosityRecord::instLumi
float instLumi() const
Return the luminosity for the current nibble.
Definition: OnlineLuminosityRecord.h:33
PrimaryVertexResolution::Resolution::avgx
double avgx() const
Definition: PrimaryVertexResolution.cc:151
PrimaryVertexResolution::forceSCAL_
const bool forceSCAL_
Definition: PrimaryVertexResolution.cc:67
edm::RefToBase< reco::Track >
VarParsing.mult
mult
Definition: VarParsing.py:659
dqm::implementation::IBooker
Definition: DQMStore.h:43
PrimaryVertexResolution::BinningX::maxXY_
const double maxXY_
Definition: PrimaryVertexResolution.cc:109
PrimaryVertexResolution::Resolution::resy_
double resy_
Definition: PrimaryVertexResolution.cc:157
PrimaryVertexResolution::Plots::hDiff_sumPt_
DiffPlots hDiff_sumPt_
Definition: PrimaryVertexResolution.cc:310
TransientTrackBuilder::build
reco::TransientTrack build(const reco::Track *p) const
Definition: TransientTrackBuilder.cc:20
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
reco::Vertex::yError
double yError() const
error on y
Definition: Vertex.h:126
PrimaryVertexResolution::Plots::binningY_
const BinningY & binningY_
Definition: PrimaryVertexResolution.cc:300
ParameterSet.h
PrimaryVertexResolution::BinningX::maxPt_
const double maxPt_
Definition: PrimaryVertexResolution.cc:114
PrimaryVertexResolution::BinningX
Definition: PrimaryVertexResolution.cc:86
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
edm::Event
Definition: Event.h:73
PrimaryVertexResolution::DiffPlots::hPullY_
MonitorElement * hPullY_
Definition: PrimaryVertexResolution.cc:249
AdaptiveVertexFitter.h
lumi
Definition: LumiSectionData.h:20
PrimaryVertexResolution::BinningX::minNtracks_
const int minNtracks_
Definition: PrimaryVertexResolution.cc:103
PrimaryVertexResolution::BinningY::maxResol_
const double maxResol_
Definition: PrimaryVertexResolution.cc:80
edm::InputTag
Definition: InputTag.h:15
OnlineLuminosityRecord
Class to contain the online luminosity from soft FED 1022.
Definition: OnlineLuminosityRecord.h:17
reco::Vertex
Definition: Vertex.h:35
PrimaryVertexResolution::Resolution::avgy
double avgy() const
Definition: PrimaryVertexResolution.cc:152
dqm::implementation::IBooker::book1D
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
PrimaryVertexResolution::Resolution::resx_
double resx_
Definition: PrimaryVertexResolution.cc:156
pwdgSkimBPark_cfi.vertices
vertices
Definition: pwdgSkimBPark_cfi.py:7
PrimaryVertexResolution::BinningX::maxZ_
const double maxZ_
Definition: PrimaryVertexResolution.cc:111