CMS 3D CMS Logo

PVFitter.cc
Go to the documentation of this file.
1 
14 
20 
23 
30 
33 
34 #include "Minuit2/FCNBase.h"
35 #include "Minuit2/FunctionMinimum.h"
36 #include "Minuit2/MnMigrad.h"
37 #include "Minuit2/MnPrint.h"
38 #include "TF1.h"
39 #include "TDirectory.h"
40 #include "TMinuitMinimizer.h"
41 
42 #include <iostream>
43 #include <sstream>
44 using namespace std;
45 
46 PVFitter::PVFitter(const edm::ParameterSet& iConfig, edm::ConsumesCollector&& iColl) : ftree_(nullptr) {
47  initialize(iConfig, iColl);
48 }
49 
50 PVFitter::PVFitter(const edm::ParameterSet& iConfig, edm::ConsumesCollector& iColl) : ftree_(nullptr) {
51  initialize(iConfig, iColl);
52 }
53 
55  //In order to make fitting ROOT histograms thread safe
56  // one must call this undocumented function
57  TMinuitMinimizer::UseStaticMinuit(false);
58  debug_ = iConfig.getParameter<edm::ParameterSet>("PVFitter").getUntrackedParameter<bool>("Debug");
60  iConfig.getParameter<edm::ParameterSet>("PVFitter")
61  .getUntrackedParameter<edm::InputTag>("VertexCollection", edm::InputTag("offlinePrimaryVertices")));
62  do3DFit_ = iConfig.getParameter<edm::ParameterSet>("PVFitter").getUntrackedParameter<bool>("Apply3DFit");
63  //writeTxt_ = iConfig.getParameter<edm::ParameterSet>("PVFitter").getUntrackedParameter<bool>("WriteAscii");
64  //outputTxt_ = iConfig.getParameter<edm::ParameterSet>("PVFitter").getUntrackedParameter<std::string>("AsciiFileName");
66  iConfig.getParameter<edm::ParameterSet>("PVFitter").getUntrackedParameter<unsigned int>("maxNrStoredVertices");
68  iConfig.getParameter<edm::ParameterSet>("PVFitter").getUntrackedParameter<unsigned int>("minNrVerticesForFit");
69  minVtxNdf_ = iConfig.getParameter<edm::ParameterSet>("PVFitter").getUntrackedParameter<double>("minVertexNdf");
71  iConfig.getParameter<edm::ParameterSet>("PVFitter").getUntrackedParameter<double>("maxVertexNormChi2");
73  iConfig.getParameter<edm::ParameterSet>("PVFitter").getUntrackedParameter<unsigned int>("minVertexNTracks");
74  minVtxWgt_ = iConfig.getParameter<edm::ParameterSet>("PVFitter").getUntrackedParameter<double>("minVertexMeanWeight");
75  maxVtxR_ = iConfig.getParameter<edm::ParameterSet>("PVFitter").getUntrackedParameter<double>("maxVertexR");
76  maxVtxZ_ = iConfig.getParameter<edm::ParameterSet>("PVFitter").getUntrackedParameter<double>("maxVertexZ");
77  errorScale_ = iConfig.getParameter<edm::ParameterSet>("PVFitter").getUntrackedParameter<double>("errorScale");
78  sigmaCut_ = iConfig.getParameter<edm::ParameterSet>("PVFitter").getUntrackedParameter<double>("nSigmaCut");
80  iConfig.getParameter<edm::ParameterSet>("PVFitter").getUntrackedParameter<bool>("FitPerBunchCrossing");
81  useOnlyFirstPV_ = iConfig.getParameter<edm::ParameterSet>("PVFitter").getUntrackedParameter<bool>("useOnlyFirstPV");
82  minSumPt_ = iConfig.getParameter<edm::ParameterSet>("PVFitter").getUntrackedParameter<double>("minSumPt");
83 
84  // preset quality cut to "infinite"
85  dynamicQualityCut_ = 1.e30;
86 
87  hPVx = std::unique_ptr<TH2F>(
88  new TH2F("hPVx", "PVx vs PVz distribution", 200, -maxVtxR_, maxVtxR_, 200, -maxVtxZ_, maxVtxZ_));
89  hPVy = std::unique_ptr<TH2F>(
90  new TH2F("hPVy", "PVy vs PVz distribution", 200, -maxVtxR_, maxVtxR_, 200, -maxVtxZ_, maxVtxZ_));
91  hPVx->SetDirectory(nullptr);
92  hPVy->SetDirectory(nullptr);
93 }
94 
96 
98  //------ Primary Vertices
100  bool hasPVs = false;
101 
102  if (iEvent.getByToken(vertexToken_, PVCollection)) {
103  hasPVs = true;
104  }
105  //------
106 
107  if (hasPVs) {
108  for (reco::VertexCollection::const_iterator pv = PVCollection->begin(); pv != PVCollection->end(); ++pv) {
109  if (useOnlyFirstPV_) {
110  if (pv != PVCollection->begin())
111  break;
112  }
113 
114  //--- vertex selection
115  if (pv->isFake() || pv->tracksSize() == 0)
116  continue;
117  if (pv->ndof() < minVtxNdf_ || (pv->ndof() + 3.) / pv->tracksSize() < 2 * minVtxWgt_)
118  continue;
119  //---
120 
121  if (pv->tracksSize() < minVtxTracks_)
122  continue;
123 
124  const auto& testTrack = pv->trackRefAt(0);
125  if (testTrack.isNull() || !testTrack.isAvailable()) {
126  edm::LogInfo("") << "Track collection not found. Skipping cut on sumPt.";
127  } else {
128  double sumPt = 0;
129  for (auto iTrack = pv->tracks_begin(); iTrack != pv->tracks_end(); ++iTrack) {
130  const auto pt = (*iTrack)->pt();
131  sumPt += pt;
132  }
133  if (sumPt < minSumPt_)
134  continue;
135  }
136 
137  hPVx->Fill(pv->x(), pv->z());
138  hPVy->Fill(pv->y(), pv->z());
139 
140  //
141  // 3D fit section
142  //
143  // apply additional quality cut
145  continue;
146  // if store exceeds max. size: reduce size and apply new quality cut
147  if (pvStore_.size() >= maxNrVertices_) {
148  compressStore();
150  continue;
151  }
152  //
153  // copy PV to store
154  //
155  int bx = iEvent.bunchCrossing();
156  BeamSpotFitPVData pvData;
157  pvData.bunchCrossing = bx;
158  pvData.position[0] = pv->x();
159  pvData.position[1] = pv->y();
160  pvData.position[2] = pv->z();
161  pvData.posError[0] = pv->xError();
162  pvData.posError[1] = pv->yError();
163  pvData.posError[2] = pv->zError();
164  pvData.posCorr[0] = pv->covariance(0, 1) / pv->xError() / pv->yError();
165  pvData.posCorr[1] = pv->covariance(0, 2) / pv->xError() / pv->zError();
166  pvData.posCorr[2] = pv->covariance(1, 2) / pv->yError() / pv->zError();
167  pvStore_.push_back(pvData);
168 
169  if (ftree_ != nullptr) {
170  theBeamSpotTreeData_.run(iEvent.id().run());
171  theBeamSpotTreeData_.lumi(iEvent.luminosityBlock());
174  ftree_->Fill();
175  }
176 
178  bxMap_[bx].push_back(pvData);
179  }
180  }
181 }
182 
183 void PVFitter::setTree(TTree* tree) {
184  ftree_ = tree;
186 }
187 
189  using namespace ROOT::Minuit2;
190  edm::LogInfo("PVFitter") << " Number of bunch crossings: " << bxMap_.size() << std::endl;
191 
192  bool fit_ok = true;
193 
194  for (std::map<int, std::vector<BeamSpotFitPVData> >::const_iterator pvStore = bxMap_.begin(); pvStore != bxMap_.end();
195  ++pvStore) {
196  // first set null beam spot in case
197  // fit fails
198  fbspotMap[pvStore->first] = reco::BeamSpot();
199 
200  edm::LogInfo("PVFitter") << " Number of PVs collected for PVFitter: " << (pvStore->second).size()
201  << " in bx: " << pvStore->first << std::endl;
202 
203  if ((pvStore->second).size() <= minNrVertices_) {
204  edm::LogWarning("PVFitter") << " not enough PVs, continue" << std::endl;
205  fit_ok = false;
206  continue;
207  }
208 
209  edm::LogInfo("PVFitter") << "Calculating beam spot with PVs ..." << std::endl;
210 
211  //
212  // LL function and fitter
213  //
214  FcnBeamSpotFitPV fcn(pvStore->second);
215  //
216  // fit parameters: positions, widths, x-y correlations, tilts in xz and yz
217  //
218  MnUserParameters upar;
219  upar.Add("x", 0., 0.02, -10., 10.); // 0
220  upar.Add("y", 0., 0.02, -10., 10.); // 1
221  upar.Add("z", 0., 0.20, -30., 30.); // 2
222  upar.Add("ex", 0.015, 0.01, 0., 10.); // 3
223  upar.Add("corrxy", 0., 0.02, -1., 1.); // 4
224  upar.Add("ey", 0.015, 0.01, 0., 10.); // 5
225  upar.Add("dxdz", 0., 0.0002, -0.1, 0.1); // 6
226  upar.Add("dydz", 0., 0.0002, -0.1, 0.1); // 7
227  upar.Add("ez", 1., 0.1, 0., 30.); // 8
228  upar.Add("scale", errorScale_, errorScale_ / 10., errorScale_ / 2., errorScale_ * 2.); // 9
229  MnMigrad migrad(fcn, upar);
230 
231  //
232  // first iteration without correlations
233  //
234  upar.Fix(4);
235  upar.Fix(6);
236  upar.Fix(7);
237  upar.Fix(9);
238  FunctionMinimum ierr = migrad(0, 1.);
239  if (!ierr.IsValid()) {
240  edm::LogInfo("PVFitter") << "3D beam spot fit failed in 1st iteration" << std::endl;
241  fit_ok = false;
242  continue;
243  }
244  //
245  // refit with harder selection on vertices
246  //
247  fcn.setLimits(upar.Value(0) - sigmaCut_ * upar.Value(3),
248  upar.Value(0) + sigmaCut_ * upar.Value(3),
249  upar.Value(1) - sigmaCut_ * upar.Value(5),
250  upar.Value(1) + sigmaCut_ * upar.Value(5),
251  upar.Value(2) - sigmaCut_ * upar.Value(8),
252  upar.Value(2) + sigmaCut_ * upar.Value(8));
253  ierr = migrad(0, 1.);
254  if (!ierr.IsValid()) {
255  edm::LogInfo("PVFitter") << "3D beam spot fit failed in 2nd iteration" << std::endl;
256  fit_ok = false;
257  continue;
258  }
259  //
260  // refit with correlations
261  //
262  upar.Release(4);
263  upar.Release(6);
264  upar.Release(7);
265  ierr = migrad(0, 1.);
266  if (!ierr.IsValid()) {
267  edm::LogInfo("PVFitter") << "3D beam spot fit failed in 3rd iteration" << std::endl;
268  fit_ok = false;
269  continue;
270  }
271 
272  fwidthX = upar.Value(3);
273  fwidthY = upar.Value(5);
274  fwidthZ = upar.Value(8);
275  fwidthXerr = upar.Error(3);
276  fwidthYerr = upar.Error(5);
277  fwidthZerr = upar.Error(8);
278 
280  // need to get the full cov matrix
281  matrix(0, 0) = pow(upar.Error(0), 2);
282  matrix(1, 1) = pow(upar.Error(1), 2);
283  matrix(2, 2) = pow(upar.Error(2), 2);
284  matrix(3, 3) = fwidthZerr * fwidthZerr;
285  matrix(4, 4) = pow(upar.Error(6), 2);
286  matrix(5, 5) = pow(upar.Error(7), 2);
287  matrix(6, 6) = fwidthXerr * fwidthXerr;
288 
289  fbeamspot = reco::BeamSpot(reco::BeamSpot::Point(upar.Value(0), upar.Value(1), upar.Value(2)),
290  fwidthZ,
291  upar.Value(6),
292  upar.Value(7),
293  fwidthX,
294  matrix);
298 
299  fbspotMap[pvStore->first] = fbeamspot;
300  edm::LogInfo("PVFitter") << "3D PV fit done for this bunch crossing." << std::endl;
301  fit_ok = fit_ok & true;
302  }
303 
304  return fit_ok;
305 }
306 
308  using namespace ROOT::Minuit2;
309  edm::LogInfo("PVFitter") << " Number of PVs collected for PVFitter: " << pvStore_.size() << std::endl;
310 
311  if (pvStore_.size() <= minNrVertices_)
312  return false;
313 
314  //need to create a unique histogram name to avoid ROOT trying to re-use one
315  // also tell ROOT to hide its global state
316  TDirectory::TContext guard{nullptr};
317  std::ostringstream str;
318  str << this;
319  std::unique_ptr<TH1D> h1PVx{hPVx->ProjectionX((std::string("h1PVx") + str.str()).c_str(), 0, -1, "e")};
320  std::unique_ptr<TH1D> h1PVy{hPVy->ProjectionX((std::string("h1PVy") + str.str()).c_str(), 0, -1, "e")};
321  std::unique_ptr<TH1D> h1PVz{hPVx->ProjectionY((std::string("h1PVz") + str.str()).c_str(), 0, -1, "e")};
322 
323  //Use our own copy for thread safety
324  // also do not add to global list of functions
325  TF1 gausx("localGausX", "gaus", 0., 1., TF1::EAddToList::kNo);
326  TF1 gausy("localGausY", "gaus", 0., 1., TF1::EAddToList::kNo);
327  TF1 gausz("localGausZ", "gaus", 0., 1., TF1::EAddToList::kNo);
328 
329  h1PVx->Fit(&gausx, "QLMN0 SERIAL");
330  h1PVy->Fit(&gausy, "QLMN0 SERIAL");
331  h1PVz->Fit(&gausz, "QLMN0 SERIAL");
332 
333  fwidthX = gausx.GetParameter(2);
334  fwidthY = gausy.GetParameter(2);
335  fwidthZ = gausz.GetParameter(2);
336  fwidthXerr = gausx.GetParError(2);
337  fwidthYerr = gausy.GetParError(2);
338  fwidthZerr = gausz.GetParError(2);
339 
340  double estX = gausx.GetParameter(1);
341  double estY = gausy.GetParameter(1);
342  double estZ = gausz.GetParameter(1);
343  double errX = fwidthX * 3.;
344  double errY = fwidthY * 3.;
345  double errZ = fwidthZ * 3.;
346 
347  if (!do3DFit_) {
349  matrix(2, 2) = gausz.GetParError(1) * gausz.GetParError(1);
350  matrix(3, 3) = fwidthZerr * fwidthZerr;
351  matrix(6, 6) = fwidthXerr * fwidthXerr;
352 
353  fbeamspot =
354  reco::BeamSpot(reco::BeamSpot::Point(gausx.GetParameter(1), gausy.GetParameter(1), gausz.GetParameter(1)),
355  fwidthZ,
356  0.,
357  0.,
358  fwidthX,
359  matrix);
363 
364  } else { // do 3D fit
365  //
366  // LL function and fitter
367  //
369  //
370  // fit parameters: positions, widths, x-y correlations, tilts in xz and yz
371  //
372  MnUserParameters upar;
373  upar.Add("x", estX, errX, -10., 10.); // 0
374  upar.Add("y", estY, errY, -10., 10.); // 1
375  upar.Add("z", estZ, errZ, -30., 30.); // 2
376  upar.Add("ex", 0.015, 0.01, 0., 10.); // 3
377  upar.Add("corrxy", 0., 0.02, -1., 1.); // 4
378  upar.Add("ey", 0.015, 0.01, 0., 10.); // 5
379  upar.Add("dxdz", 0., 0.0002, -0.1, 0.1); // 6
380  upar.Add("dydz", 0., 0.0002, -0.1, 0.1); // 7
381  upar.Add("ez", 1., 0.1, 0., 30.); // 8
382  upar.Add("scale", errorScale_, errorScale_ / 10., errorScale_ / 2., errorScale_ * 2.); // 9
383  MnMigrad migrad(fcn, upar);
384  //
385  // first iteration without correlations
386  //
387  migrad.Fix(4);
388  migrad.Fix(6);
389  migrad.Fix(7);
390  migrad.Fix(9);
391  FunctionMinimum ierr = migrad(0, 1.);
392  if (!ierr.IsValid()) {
393  edm::LogWarning("PVFitter") << "3D beam spot fit failed in 1st iteration" << std::endl;
394  return false;
395  }
396  //
397  // refit with harder selection on vertices
398  //
399 
400  vector<double> results;
401  vector<double> errors;
402  results = ierr.UserParameters().Params();
403  errors = ierr.UserParameters().Errors();
404 
405  fcn.setLimits(results[0] - sigmaCut_ * results[3],
406  results[0] + sigmaCut_ * results[3],
407  results[1] - sigmaCut_ * results[5],
408  results[1] + sigmaCut_ * results[5],
409  results[2] - sigmaCut_ * results[8],
410  results[2] + sigmaCut_ * results[8]);
411  ierr = migrad(0, 1.);
412  if (!ierr.IsValid()) {
413  edm::LogWarning("PVFitter") << "3D beam spot fit failed in 2nd iteration" << std::endl;
414  return false;
415  }
416  //
417  // refit with correlations
418  //
419  migrad.Release(4);
420  migrad.Release(6);
421  migrad.Release(7);
422  ierr = migrad(0, 1.);
423  if (!ierr.IsValid()) {
424  edm::LogWarning("PVFitter") << "3D beam spot fit failed in 3rd iteration" << std::endl;
425  return false;
426  }
427 
428  results = ierr.UserParameters().Params();
429  errors = ierr.UserParameters().Errors();
430 
431  fwidthX = results[3];
432  fwidthY = results[5];
433  fwidthZ = results[8];
434  fwidthXerr = errors[3];
435  fwidthYerr = errors[5];
436  fwidthZerr = errors[8];
437 
438  // check errors on widths and sigmaZ for nan
440  edm::LogWarning("PVFitter") << "3D beam spot fit returns nan in 3rd iteration" << std::endl;
441  return false;
442  }
443 
445  // need to get the full cov matrix
446  matrix(0, 0) = pow(errors[0], 2);
447  matrix(1, 1) = pow(errors[1], 2);
448  matrix(2, 2) = pow(errors[2], 2);
449  matrix(3, 3) = fwidthZerr * fwidthZerr;
450  matrix(6, 6) = fwidthXerr * fwidthXerr;
451 
457  }
458 
459  return true;
460 }
461 
463 
465  //
466  // fill vertex qualities
467  //
468  pvQualities_.resize(pvStore_.size());
469  for (unsigned int i = 0; i < pvStore_.size(); ++i)
471  sort(pvQualities_.begin(), pvQualities_.end());
472  //
473  // Set new quality cut to median. This cut will be used to reduce the
474  // number of vertices in the store and also apply to all new vertices
475  // until the next reset
476  //
478  //
479  // remove all vertices failing the cut from the store
480  // (to be moved to a more efficient memory management!)
481  //
482  unsigned int iwrite(0);
483  for (unsigned int i = 0; i < pvStore_.size(); ++i) {
485  continue;
486  if (i != iwrite)
487  pvStore_[iwrite] = pvStore_[i];
488  ++iwrite;
489  }
490  pvStore_.resize(iwrite);
491  edm::LogInfo("PVFitter") << "Reduced primary vertex store size to " << pvStore_.size()
492  << " ; new dynamic quality cut = " << dynamicQualityCut_ << std::endl;
493 }
494 
495 double PVFitter::pvQuality(const reco::Vertex& pv) const {
496  //
497  // determinant of the transverse part of the PV covariance matrix
498  //
499  return pv.covariance(0, 0) * pv.covariance(1, 1) - pv.covariance(0, 1) * pv.covariance(0, 1);
500 }
501 
503  //
504  // determinant of the transverse part of the PV covariance matrix
505  //
506  double ex = pv.posError[0];
507  double ey = pv.posError[1];
508  return ex * ex * ey * ey * (1 - pv.posCorr[0] * pv.posCorr[0]);
509 }
FcnBeamSpotFitPV
Definition: FcnBeamSpotFitPV.h:22
PVFitter.h
PVFitter::hPVx
std::unique_ptr< TH2F > hPVx
Definition: PVFitter.h:158
PVFitter::minVtxNdf_
double minVtxNdf_
Definition: PVFitter.h:146
fftjetvertexadder_cfi.errZ
errZ
Definition: fftjetvertexadder_cfi.py:39
PVFitter::minVtxTracks_
unsigned int minVtxTracks_
Definition: PVFitter.h:148
PVFitter::maxVtxNormChi2_
double maxVtxNormChi2_
Definition: PVFitter.h:147
PVFitter::fwidthX
double fwidthX
Definition: PVFitter.h:166
mps_fire.i
i
Definition: mps_fire.py:355
reco::BeamSpot::setBeamWidthY
void setBeamWidthY(double v)
Definition: BeamSpot.h:105
MessageLogger.h
PVFitter::minSumPt_
double minSumPt_
Definition: PVFitter.h:154
makeMuonMisalignmentScenario.matrix
list matrix
Definition: makeMuonMisalignmentScenario.py:141
PVFitter::fwidthXerr
double fwidthXerr
Definition: PVFitter.h:169
TrackCandidateCollection.h
align::BeamSpot
Definition: StructureType.h:89
edm::isNotFinite
constexpr bool isNotFinite(T x)
Definition: isFinite.h:9
fftjetvertexadder_cfi.errY
errY
Definition: fftjetvertexadder_cfi.py:38
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
PVFitter::PVFitter
PVFitter()
Definition: PVFitter.h:46
tree
Definition: tree.py:1
reco::VertexCollection
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
edm::LogInfo
Definition: MessageLogger.h:254
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
BeamSpotTreeData::branch
void branch(TTree *tree)
Definition: BeamSpotTreeData.cc:8
PVFitter::theBeamSpotTreeData_
BeamSpotTreeData theBeamSpotTreeData_
Definition: PVFitter.h:178
MessageLogger_cfi.errors
errors
Definition: MessageLogger_cfi.py:18
bookConverter.results
results
Definition: bookConverter.py:144
ROOT::Minuit2
Definition: HybridMinimizer.h:28
fcn
void fcn(int &, double *, double &, double *, int)
Definition: LASBarrelAlgorithm.cc:388
tools.TF1
TF1
Definition: tools.py:23
edm::Handle< reco::VertexCollection >
TtFullHadEvtBuilder_cfi.sumPt
sumPt
Definition: TtFullHadEvtBuilder_cfi.py:38
BeamSpotFitPVData::bunchCrossing
float bunchCrossing
Definition: BeamSpotFitPVData.h:8
PVFitter::maxVtxZ_
double maxVtxZ_
Definition: PVFitter.h:151
BeamSpotObjects.h
PVFitter::dynamicQualityCut_
double dynamicQualityCut_
Definition: PVFitter.h:175
PVFitter::fwidthZ
double fwidthZ
Definition: PVFitter.h:168
PoolDBOutputService.h
Track.h
PVFitter::fwidthY
double fwidthY
Definition: PVFitter.h:167
TrackFwd.h
errors
Definition: errors.py:1
Service.h
L1TEGammaOffline_cfi.PVCollection
PVCollection
Definition: L1TEGammaOffline_cfi.py:34
PVFitter::readEvent
void readEvent(const edm::Event &iEvent)
Definition: PVFitter.cc:97
reco::BeamSpot::Tracker
Definition: BeamSpot.h:24
str
#define str(s)
Definition: TestProcessor.cc:48
PVFitter::sigmaCut_
double sigmaCut_
Definition: PVFitter.h:153
reco::BeamSpot::setBeamWidthX
void setBeamWidthX(double v)
Definition: BeamSpot.h:104
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:49
BeamSpotFitPVData::posCorr
float posCorr[3]
Definition: BeamSpotFitPVData.h:11
PVFitter::fbeamspot
reco::BeamSpot fbeamspot
Definition: PVFitter.h:132
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
Vertex.h
PVFitter::pvQuality
double pvQuality(const reco::Vertex &pv) const
vertex quality measure
Definition: PVFitter.cc:495
PVFitter::hPVy
std::unique_ptr< TH2F > hPVy
Definition: PVFitter.h:159
edm::LogWarning
Definition: MessageLogger.h:141
PVFitter::fwidthZerr
double fwidthZerr
Definition: PVFitter.h:171
edm::ParameterSet
Definition: ParameterSet.h:36
MainPageGenerator.tree
tree
Definition: MainPageGenerator.py:264
MetAnalyzer.pv
def pv(vc)
Definition: MetAnalyzer.py:7
iEvent
int iEvent
Definition: GenABIO.cc:224
PVFitter::runBXFitter
bool runBXFitter()
Definition: PVFitter.cc:188
reco::BeamSpot::CovarianceMatrix
math::Error< dimension >::type CovarianceMatrix
Definition: BeamSpot.h:29
PVFitter::fwidthYerr
double fwidthYerr
Definition: PVFitter.h:170
HitPattern.h
PVFitter::bxMap_
std::map< int, std::vector< BeamSpotFitPVData > > bxMap_
Definition: PVFitter.h:174
BeamSpotTreeData::bunchCrossing
void bunchCrossing(unsigned int bunchCrossing)
Definition: BeamSpotTreeData.h:18
InputTag.h
PVFitter::~PVFitter
virtual ~PVFitter()
Definition: PVFitter.cc:95
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
BeamSpotFitPVData::position
float position[3]
Definition: BeamSpotFitPVData.h:9
PVFitter::vertexToken_
edm::EDGetTokenT< reco::VertexCollection > vertexToken_
Definition: PVFitter.h:141
BeamSpotTreeData::lumi
void lumi(unsigned int lumi)
Definition: BeamSpotTreeData.h:17
std
Definition: JetResolutionObject.h:76
PVFitter::pvQualities_
std::vector< double > pvQualities_
Definition: PVFitter.h:176
BeamSpotTreeData::run
void run(unsigned int run)
Definition: BeamSpotTreeData.h:16
PVFitter::dumpTxtFile
void dumpTxtFile()
Definition: PVFitter.cc:462
isFinite.h
PVFitter::useOnlyFirstPV_
bool useOnlyFirstPV_
Definition: PVFitter.h:135
PVFitter::fFitPerBunchCrossing
bool fFitPerBunchCrossing
Definition: PVFitter.h:134
PVFitter::fbspotMap
std::map< int, reco::BeamSpot > fbspotMap
Definition: PVFitter.h:133
PVFitter::initialize
void initialize(const edm::ParameterSet &iConfig, edm::ConsumesCollector &iColl)
Definition: PVFitter.cc:54
PVFitter::minNrVertices_
unsigned int minNrVertices_
Definition: PVFitter.h:145
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:30
ConsumesCollector.h
reco::BeamSpot::Point
math::XYZPoint Point
point in the space
Definition: BeamSpot.h:27
FcnBeamSpotFitPV.h
genParticles_cff.map
map
Definition: genParticles_cff.py:11
PVFitter::debug_
bool debug_
Definition: PVFitter.h:139
View.h
BeamSpotTreeData::pvData
void pvData(const BeamSpotFitPVData &pvData)
Definition: BeamSpotTreeData.h:19
TrackCandidate.h
PVFitter::runFitter
bool runFitter()
Definition: PVFitter.cc:307
reco::BeamSpot::setType
void setType(BeamType type)
set beam type
Definition: BeamSpot.h:124
PVFitter::errorScale_
double errorScale_
Definition: PVFitter.h:152
edm::Event
Definition: Event.h:73
PVFitter::minVtxWgt_
double minVtxWgt_
Definition: PVFitter.h:149
PVFitter::ftree_
TTree * ftree_
Definition: PVFitter.h:161
BeamSpotFitPVData::posError
float posError[3]
Definition: BeamSpotFitPVData.h:10
PVFitter::compressStore
void compressStore()
reduce size of primary vertex cache by increasing quality limit
Definition: PVFitter.cc:464
PVFitter::maxNrVertices_
unsigned int maxNrVertices_
Definition: PVFitter.h:144
fftjetvertexadder_cfi.errX
errX
Definition: fftjetvertexadder_cfi.py:37
edm::InputTag
Definition: InputTag.h:15
edm::ConsumesCollector
Definition: ConsumesCollector.h:39
PVFitter::do3DFit_
bool do3DFit_
Definition: PVFitter.h:140
PVFitter::pvStore_
std::vector< BeamSpotFitPVData > pvStore_
Definition: PVFitter.h:173
reco::Vertex
Definition: Vertex.h:35
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
PVFitter::setTree
void setTree(TTree *tree)
Definition: PVFitter.cc:183
BeamSpotFitPVData
Definition: BeamSpotFitPVData.h:7
PVFitter::maxVtxR_
double maxVtxR_
Definition: PVFitter.h:150