CMS 3D CMS Logo

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