CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 "TF1.h"
38 
39 
40 // ----------------------------------------------------------------------
41 // Useful function:
42 // ----------------------------------------------------------------------
43 
44 // static char * formatTime(const std::time_t & t) {
45 // struct std::tm * ptm;
46 // ptm = gmtime(&t);
47 // static char ts[32];
48 // strftime(ts,sizeof(ts),"%Y.%m.%d %H:%M:%S %Z",ptm);
49 // return ts;
50 // }
52  edm::ConsumesCollector &&iColl)
53  : ftree_(0)
54 {
55  initialize(iConfig, iColl);
56 }
57 
60  :ftree_(0)
61 {
62  initialize(iConfig, iColl);
63 }
64 
67 {
68  debug_ = iConfig.getParameter<edm::ParameterSet>("PVFitter").getUntrackedParameter<bool>("Debug");
70  iConfig.getParameter<edm::ParameterSet>("PVFitter")
71  .getUntrackedParameter<edm::InputTag>("VertexCollection",
72  edm::InputTag("offlinePrimaryVertices")));
73  do3DFit_ = iConfig.getParameter<edm::ParameterSet>("PVFitter").getUntrackedParameter<bool>("Apply3DFit");
74  //writeTxt_ = iConfig.getParameter<edm::ParameterSet>("PVFitter").getUntrackedParameter<bool>("WriteAscii");
75  //outputTxt_ = iConfig.getParameter<edm::ParameterSet>("PVFitter").getUntrackedParameter<std::string>("AsciiFileName");
76 
77  maxNrVertices_ = iConfig.getParameter<edm::ParameterSet>("PVFitter").getUntrackedParameter<unsigned int>("maxNrStoredVertices");
78  minNrVertices_ = iConfig.getParameter<edm::ParameterSet>("PVFitter").getUntrackedParameter<unsigned int>("minNrVerticesForFit");
79  minVtxNdf_ = iConfig.getParameter<edm::ParameterSet>("PVFitter").getUntrackedParameter<double>("minVertexNdf");
80  maxVtxNormChi2_ = iConfig.getParameter<edm::ParameterSet>("PVFitter").getUntrackedParameter<double>("maxVertexNormChi2");
81  minVtxTracks_ = iConfig.getParameter<edm::ParameterSet>("PVFitter").getUntrackedParameter<unsigned int>("minVertexNTracks");
82  minVtxWgt_ = iConfig.getParameter<edm::ParameterSet>("PVFitter").getUntrackedParameter<double>("minVertexMeanWeight");
83  maxVtxR_ = iConfig.getParameter<edm::ParameterSet>("PVFitter").getUntrackedParameter<double>("maxVertexR");
84  maxVtxZ_ = iConfig.getParameter<edm::ParameterSet>("PVFitter").getUntrackedParameter<double>("maxVertexZ");
85  errorScale_ = iConfig.getParameter<edm::ParameterSet>("PVFitter").getUntrackedParameter<double>("errorScale");
86  sigmaCut_ = iConfig.getParameter<edm::ParameterSet>("PVFitter").getUntrackedParameter<double>("nSigmaCut");
87  fFitPerBunchCrossing=iConfig.getParameter<edm::ParameterSet>("PVFitter").getUntrackedParameter<bool>("FitPerBunchCrossing");
88 
89  // preset quality cut to "infinite"
90  dynamicQualityCut_ = 1.e30;
91 
92  hPVx = new TH2F("hPVx","PVx vs PVz distribution",200,-maxVtxR_, maxVtxR_, 200, -maxVtxZ_, maxVtxZ_);
93  hPVy = new TH2F("hPVy","PVy vs PVz distribution",200,-maxVtxR_, maxVtxR_, 200, -maxVtxZ_, maxVtxZ_);
94 }
95 
97 
98 }
99 
100 
102 {
103 
104 // frun = iEvent.id().run();
105 // const edm::TimeValue_t ftimestamp = iEvent.time().value();
106 // const std::time_t ftmptime = ftimestamp >> 32;
107 
108 // if (fbeginLumiOfFit == -1) freftime[0] = freftime[1] = ftmptime;
109 // if (freftime[0] == 0 || ftmptime < freftime[0]) freftime[0] = ftmptime;
110 // const char* fbeginTime = formatTime(freftime[0]);
111 // sprintf(fbeginTimeOfFit,"%s",fbeginTime);
112 
113 // if (freftime[1] == 0 || ftmptime > freftime[1]) freftime[1] = ftmptime;
114 // const char* fendTime = formatTime(freftime[1]);
115 // sprintf(fendTimeOfFit,"%s",fendTime);
116 
117 // flumi = iEvent.luminosityBlock();
118 // frunFit = frun;
119 
120 // if (fbeginLumiOfFit == -1 || fbeginLumiOfFit > flumi) fbeginLumiOfFit = flumi;
121 // if (fendLumiOfFit == -1 || fendLumiOfFit < flumi) fendLumiOfFit = flumi;
122 // std::cout << "flumi = " <<flumi<<"; fbeginLumiOfFit = " << fbeginLumiOfFit <<"; fendLumiOfFit = "<<fendLumiOfFit<<std::endl;
123 
124  //------ Primary Vertices
126  bool hasPVs = false;
127  //edm::View<reco::Vertex> vertices;
128  //const reco::VertexCollection & vertices = 0;
129 
130  if ( iEvent.getByToken(vertexToken_, PVCollection ) ) {
131  //pv = *PVCollection;
132  //vertices = *PVCollection;
133  hasPVs = true;
134  }
135  //------
136 
137  if ( hasPVs ) {
138 
139  for (reco::VertexCollection::const_iterator pv = PVCollection->begin(); pv != PVCollection->end(); ++pv ) {
140 
141 
142  //for ( size_t ipv=0; ipv != pv.size(); ++ipv ) {
143 
144  //--- vertex selection
145  if ( pv->isFake() || pv->tracksSize()==0 ) continue;
146  if ( pv->ndof() < minVtxNdf_ || (pv->ndof()+3.)/pv->tracksSize()<2*minVtxWgt_ ) continue;
147  //---
148 
149  hPVx->Fill( pv->x(), pv->z() );
150  hPVy->Fill( pv->y(), pv->z() );
151 
152  //
153  // 3D fit section
154  //
155  // apply additional quality cut
156  if ( pvQuality(*pv)>dynamicQualityCut_ ) continue;
157  // if store exceeds max. size: reduce size and apply new quality cut
158  if ( pvStore_.size()>=maxNrVertices_ ) {
159  compressStore();
160  if ( pvQuality(*pv)>dynamicQualityCut_ ) continue;
161  }
162  //
163  // copy PV to store
164  //
165  int bx = iEvent.bunchCrossing();
166  BeamSpotFitPVData pvData;
167  pvData.bunchCrossing = bx;
168  pvData.position[0] = pv->x();
169  pvData.position[1] = pv->y();
170  pvData.position[2] = pv->z();
171  pvData.posError[0] = pv->xError();
172  pvData.posError[1] = pv->yError();
173  pvData.posError[2] = pv->zError();
174  pvData.posCorr[0] = pv->covariance(0,1)/pv->xError()/pv->yError();
175  pvData.posCorr[1] = pv->covariance(0,2)/pv->xError()/pv->zError();
176  pvData.posCorr[2] = pv->covariance(1,2)/pv->yError()/pv->zError();
177  pvStore_.push_back(pvData);
178 
179  if(ftree_ != 0){
180  theBeamSpotTreeData_.run(iEvent.id().run());
184  ftree_->Fill();
185  }
186 
187  if (fFitPerBunchCrossing) bxMap_[bx].push_back(pvData);
188 
189  }
190 
191  }
192 
193 
194 
195 
196 }
197 
198 void PVFitter::setTree(TTree* tree){
199  ftree_ = tree;
201 }
202 
204 
205  using namespace ROOT::Minuit2;
206 
207  edm::LogInfo("PVFitter") << " Number of bunch crossings: " << bxMap_.size() << std::endl;
208 
209  bool fit_ok = true;
210 
211  for ( std::map<int,std::vector<BeamSpotFitPVData> >::const_iterator pvStore = bxMap_.begin();
212  pvStore!=bxMap_.end(); ++pvStore) {
213 
214  // first set null beam spot in case
215  // fit fails
216  fbspotMap[pvStore->first] = reco::BeamSpot();
217 
218  edm::LogInfo("PVFitter") << " Number of PVs collected for PVFitter: " << (pvStore->second).size() << " in bx: " << pvStore->first << std::endl;
219 
220  if ( (pvStore->second).size() <= minNrVertices_ ) {
221  edm::LogWarning("PVFitter") << " not enough PVs, continue" << std::endl;
222  fit_ok = false;
223  continue;
224  }
225 
226  //bool fit_ok = false;
227  edm::LogInfo("PVFitter") << "Calculating beam spot with PVs ..." << std::endl;
228 
229  //
230  // LL function and fitter
231  //
232  FcnBeamSpotFitPV* fcn = new FcnBeamSpotFitPV(pvStore->second);
233  //
234  // fit parameters: positions, widths, x-y correlations, tilts in xz and yz
235  //
236  MnUserParameters upar;
237  upar.Add("x", 0., 0.02, -10., 10.); // 0
238  upar.Add("y", 0., 0.02, -10., 10.); // 1
239  upar.Add("z", 0., 0.20, -30., 30.); // 2
240  upar.Add("ex", 0.015, 0.01, 0., 10.); // 3
241  upar.Add("corrxy", 0., 0.02, -1., 1.); // 4
242  upar.Add("ey", 0.015, 0.01, 0., 10.); // 5
243  upar.Add("dxdz", 0., 0.0002, -0.1, 0.1); // 6
244  upar.Add("dydz", 0., 0.0002, -0.1, 0.1); // 7
245  upar.Add("ez", 1., 0.1, 0., 30.); // 8
246  upar.Add("scale", errorScale_, errorScale_/10.,
247  errorScale_/2., errorScale_*2.); // 9
248  MnMigrad migrad(*fcn, upar);
249 
250  //
251  // first iteration without correlations
252  //
253  upar.Fix(4);
254  upar.Fix(6);
255  upar.Fix(7);
256  upar.Fix(9);
257  FunctionMinimum ierr = migrad();
258  if ( !ierr.IsValid() ) {
259  edm::LogInfo("PVFitter") << "3D beam spot fit failed in 1st iteration" << std::endl;
260  fit_ok = false;
261  continue;
262  }
263  //
264  // refit with harder selection on vertices
265  //
266  fcn->setLimits(upar.Value(0)-sigmaCut_*upar.Value(3),
267  upar.Value(0)+sigmaCut_*upar.Value(3),
268  upar.Value(1)-sigmaCut_*upar.Value(5),
269  upar.Value(1)+sigmaCut_*upar.Value(5),
270  upar.Value(2)-sigmaCut_*upar.Value(8),
271  upar.Value(2)+sigmaCut_*upar.Value(8));
272  ierr = migrad();
273  if ( !ierr.IsValid() ) {
274  edm::LogInfo("PVFitter") << "3D beam spot fit failed in 2nd iteration" << std::endl;
275  fit_ok = false;
276  continue;
277  }
278  //
279  // refit with correlations
280  //
281  upar.Release(4);
282  upar.Release(6);
283  upar.Release(7);
284  ierr = migrad();
285  if ( !ierr.IsValid() ) {
286  edm::LogInfo("PVFitter") << "3D beam spot fit failed in 3rd iteration" << std::endl;
287  fit_ok = false;
288  continue;
289  }
290  // refit with floating scale factor
291  // minuitx.ReleaseParameter(9);
292  // minuitx.Minimize();
293 
294  //minuitx.PrintResults(0,0);
295 
296  fwidthX = upar.Value(3);
297  fwidthY = upar.Value(5);
298  fwidthZ = upar.Value(8);
299  fwidthXerr = upar.Error(3);
300  fwidthYerr = upar.Error(5);
301  fwidthZerr = upar.Error(8);
302 
304  // need to get the full cov matrix
305  matrix(0,0) = pow( upar.Error(0), 2);
306  matrix(1,1) = pow( upar.Error(1), 2);
307  matrix(2,2) = pow( upar.Error(2), 2);
308  matrix(3,3) = fwidthZerr * fwidthZerr;
309  matrix(4,4) = pow( upar.Error(6), 2);
310  matrix(5,5) = pow( upar.Error(7), 2);
311  matrix(6,6) = fwidthXerr * fwidthXerr;
312 
314  upar.Value(1),
315  upar.Value(2) ),
316  fwidthZ,
317  upar.Value(6), upar.Value(7),
318  fwidthX,
319  matrix );
323 
324  fbspotMap[pvStore->first] = fbeamspot;
325  edm::LogInfo("PVFitter") << "3D PV fit done for this bunch crossing."<<std::endl;
326  //delete fcn;
327  fit_ok = fit_ok & true;
328  }
329 
330  return fit_ok;
331 }
332 
333 
335 
336  using namespace ROOT::Minuit2;
337  edm::LogInfo("PVFitter") << " Number of PVs collected for PVFitter: " << pvStore_.size() << std::endl;
338 
339  if ( pvStore_.size() <= minNrVertices_ ) return false;
340 
341  //bool fit_ok = false;
342 
343  if ( ! do3DFit_ ) {
344  TH1F *h1PVx = (TH1F*) hPVx->ProjectionX("h1PVx", 0, -1, "e");
345  TH1F *h1PVy = (TH1F*) hPVy->ProjectionX("h1PVy", 0, -1, "e");
346  TH1F *h1PVz = (TH1F*) hPVx->ProjectionY("h1PVz", 0, -1, "e");
347 
348  h1PVx->Fit("gaus","QLM0");
349  h1PVy->Fit("gaus","QLM0");
350  h1PVz->Fit("gaus","QLM0");
351 
352  TF1 *gausx = h1PVx->GetFunction("gaus");
353  TF1 *gausy = h1PVy->GetFunction("gaus");
354  TF1 *gausz = h1PVz->GetFunction("gaus");
355 
356  fwidthX = gausx->GetParameter(2);
357  fwidthY = gausy->GetParameter(2);
358  fwidthZ = gausz->GetParameter(2);
359  fwidthXerr = gausx->GetParError(2);
360  fwidthYerr = gausy->GetParError(2);
361  fwidthZerr = gausz->GetParError(2);
362 
364  matrix(2,2) = gausz->GetParError(1) * gausz->GetParError(1);
365  matrix(3,3) = fwidthZerr * fwidthZerr;
366  matrix(6,6) = fwidthXerr * fwidthXerr;
367 
368  fbeamspot = reco::BeamSpot( reco::BeamSpot::Point(gausx->GetParameter(1),
369  gausy->GetParameter(1),
370  gausz->GetParameter(1) ),
371  fwidthZ,
372  0., 0.,
373  fwidthX,
374  matrix );
378 
379  }
380  else { // do 3D fit
381  //
382  // LL function and fitter
383  //
385  //
386  // fit parameters: positions, widths, x-y correlations, tilts in xz and yz
387  //
388  MnUserParameters upar;
389  upar.Add("x", 0., 0.02, -10., 10.); // 0
390  upar.Add("y", 0., 0.02, -10., 10.); // 1
391  upar.Add("z", 0., 0.20, -30., 30.); // 2
392  upar.Add("ex", 0.005, 0.0005, 0.0001, 0.05); // 3
393  upar.Add("corrxy", 0., 0.02, -1., 1.); // 4
394  upar.Add("ey", 0.005, 0.0005, 0.0001, 0.05); // 5
395  upar.Add("dxdz", 0., 0.0002, -0.1, 0.1); // 6
396  upar.Add("dydz", 0., 0.0002, -0.1, 0.1); // 7
397  upar.Add("ez", 1., 0.1, 1.0, 30.); // 8
398  upar.Add("scale", errorScale_, errorScale_/10.,
399  errorScale_/2., errorScale_*2.); // 9
400  MnMigrad migrad(*fcn, upar);
401  //
402  // first iteration without correlations
403  //
404  upar.Fix(4);
405  upar.Fix(6);
406  upar.Fix(7);
407  upar.Fix(9);
408  FunctionMinimum ierr = migrad();
409  if ( !ierr.IsValid() ) {
410  edm::LogWarning("PVFitter") << "3D beam spot fit failed in 1st iteration" << std::endl;
411  return false;
412  }
413  //
414  // refit with harder selection on vertices
415  //
416  fcn->setLimits(upar.Value(0)-sigmaCut_*upar.Value(3),
417  upar.Value(0)+sigmaCut_*upar.Value(3),
418  upar.Value(1)-sigmaCut_*upar.Value(5),
419  upar.Value(1)+sigmaCut_*upar.Value(5),
420  upar.Value(2)-sigmaCut_*upar.Value(8),
421  upar.Value(2)+sigmaCut_*upar.Value(8));
422  ierr = migrad();
423  if ( !ierr.IsValid() ) {
424  edm::LogWarning("PVFitter") << "3D beam spot fit failed in 2nd iteration" << std::endl;
425  return false;
426  }
427  //
428  // refit with correlations
429  //
430  upar.Release(4);
431  upar.Release(6);
432  upar.Release(7);
433  ierr = migrad();
434  if ( !ierr.IsValid() ) {
435  edm::LogWarning("PVFitter") << "3D beam spot fit failed in 3rd iteration" << std::endl;
436  return false;
437  }
438  // refit with floating scale factor
439  // minuitx.ReleaseParameter(9);
440  // minuitx.Minimize();
441 
442  //minuitx.PrintResults(0,0);
443 
444  fwidthX = upar.Value(3);
445  fwidthY = upar.Value(5);
446  fwidthZ = upar.Value(8);
447  fwidthXerr = upar.Error(3);
448  fwidthYerr = upar.Error(5);
449  fwidthZerr = upar.Error(8);
450 
451  // check errors on widths and sigmaZ for nan
453  edm::LogWarning("PVFitter") << "3D beam spot fit returns nan in 3rd iteration" << std::endl;
454  return false;
455  }
456 
458  // need to get the full cov matrix
459  matrix(0,0) = pow( upar.Error(0), 2);
460  matrix(1,1) = pow( upar.Error(1), 2);
461  matrix(2,2) = pow( upar.Error(2), 2);
462  matrix(3,3) = fwidthZerr * fwidthZerr;
463  matrix(6,6) = fwidthXerr * fwidthXerr;
464 
466  upar.Value(1),
467  upar.Value(2) ),
468  fwidthZ,
469  upar.Value(6), upar.Value(7),
470  fwidthX,
471  matrix );
475  }
476 
477  return true; //FIXME: Need to add quality test for the fit results!
478 }
479 
481 /*
482  fasciiFile << "Runnumber " << frun << std::endl;
483  fasciiFile << "BeginTimeOfFit " << fbeginTimeOfFit << std::endl;
484  fasciiFile << "EndTimeOfFit " << fendTimeOfFit << std::endl;
485  fasciiFile << "LumiRange " << fbeginLumiOfFit << " - " << fendLumiOfFit << std::endl;
486  fasciiFile << "Type " << fbeamspot.type() << std::endl;
487  fasciiFile << "X0 " << fbeamspot.x0() << std::endl;
488  fasciiFile << "Y0 " << fbeamspot.y0() << std::endl;
489  fasciiFile << "Z0 " << fbeamspot.z0() << std::endl;
490  fasciiFile << "sigmaZ0 " << fbeamspot.sigmaZ() << std::endl;
491  fasciiFile << "dxdz " << fbeamspot.dxdz() << std::endl;
492  fasciiFile << "dydz " << fbeamspot.dydz() << std::endl;
493  if (inputBeamWidth_ > 0 ) {
494  fasciiFile << "BeamWidthX " << inputBeamWidth_ << std::endl;
495  fasciiFile << "BeamWidthY " << inputBeamWidth_ << std::endl;
496  } else {
497  fasciiFile << "BeamWidthX " << fbeamspot.BeamWidthX() << std::endl;
498  fasciiFile << "BeamWidthY " << fbeamspot.BeamWidthY() << std::endl;
499  }
500 
501  for (int i = 0; i<6; ++i) {
502  fasciiFile << "Cov("<<i<<",j) ";
503  for (int j=0; j<7; ++j) {
504  fasciiFile << fbeamspot.covariance(i,j) << " ";
505  }
506  fasciiFile << std::endl;
507  }
508  // beam width error
509  if (inputBeamWidth_ > 0 ) {
510  fasciiFile << "Cov(6,j) 0 0 0 0 0 0 " << "1e-4" << std::endl;
511  } else {
512  fasciiFile << "Cov(6,j) 0 0 0 0 0 0 " << fbeamspot.covariance(6,6) << std::endl;
513  }
514  fasciiFile << "EmittanceX " << fbeamspot.emittanceX() << std::endl;
515  fasciiFile << "EmittanceY " << fbeamspot.emittanceY() << std::endl;
516  fasciiFile << "BetaStar " << fbeamspot.betaStar() << std::endl;
517 
518 */
519 }
520 
521 
522 void
524 {
525  //
526  // fill vertex qualities
527  //
528  pvQualities_.resize(pvStore_.size());
529  for ( unsigned int i=0; i<pvStore_.size(); ++i ) pvQualities_[i] = pvQuality(pvStore_[i]);
530  sort(pvQualities_.begin(),pvQualities_.end());
531  //
532  // Set new quality cut to median. This cut will be used to reduce the
533  // number of vertices in the store and also apply to all new vertices
534  // until the next reset
535  //
537  //
538  // remove all vertices failing the cut from the store
539  // (to be moved to a more efficient memory management!)
540  //
541  unsigned int iwrite(0);
542  for ( unsigned int i=0; i<pvStore_.size(); ++i ) {
543  if ( pvQuality(pvStore_[i])>dynamicQualityCut_ ) continue;
544  if ( i!=iwrite ) pvStore_[iwrite] = pvStore_[i];
545  ++iwrite;
546  }
547  pvStore_.resize(iwrite);
548  edm::LogInfo("PVFitter") << "Reduced primary vertex store size to "
549  << pvStore_.size() << " ; new dynamic quality cut = "
550  << dynamicQualityCut_ << std::endl;
551 
552 }
553 
554 double
556 {
557  //
558  // determinant of the transverse part of the PV covariance matrix
559  //
560  return
561  pv.covariance(0,0)*pv.covariance(1,1)-
562  pv.covariance(0,1)*pv.covariance(0,1);
563 }
564 
565 double
567 {
568  //
569  // determinant of the transverse part of the PV covariance matrix
570  //
571  double ex = pv.posError[0];
572  double ey = pv.posError[1];
573  return ex*ex*ey*ey*(1-pv.posCorr[0]*pv.posCorr[0]);
574 }
575 
RunNumber_t run() const
Definition: EventID.h:42
std::vector< double > pvQualities_
Definition: PVFitter.h:205
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
math::Error< dimension >::type CovarianceMatrix
Definition: BeamSpot.h:31
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
bool debug_
Definition: PVFitter.h:145
double maxVtxNormChi2_
Definition: PVFitter.h:154
void setTree(TTree *tree)
Definition: PVFitter.cc:198
std::map< int, std::vector< BeamSpotFitPVData > > bxMap_
Definition: PVFitter.h:203
void initialize(const edm::ParameterSet &iConfig, edm::ConsumesCollector &iColl)
Definition: PVFitter.cc:65
void run(unsigned int run)
void compressStore()
reduce size of primary vertex cache by increasing quality limit
Definition: PVFitter.cc:523
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
double minVtxWgt_
Definition: PVFitter.h:156
double minVtxNdf_
Definition: PVFitter.h:153
int bunchCrossing() const
Definition: EventBase.h:62
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:59
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
math::XYZPoint Point
point in the space
Definition: BeamSpot.h:29
double covariance(int i, int j) const
(i, j)-th element of error matrix, i, j = 0, ... 2
Definition: Vertex.h:123
double fwidthY
Definition: PVFitter.h:183
double errorScale_
Definition: PVFitter.h:159
bool do3DFit_
Definition: PVFitter.h:146
double dynamicQualityCut_
Definition: PVFitter.h:204
double fwidthYerr
Definition: PVFitter.h:186
double fwidthZ
Definition: PVFitter.h:184
double fwidthXerr
Definition: PVFitter.h:185
void setType(BeamType type)
set beam type
Definition: BeamSpot.h:131
void bunchCrossing(unsigned int bunchCrossing)
reco::BeamSpot fbeamspot
Definition: PVFitter.h:139
void lumi(unsigned int lumi)
int iEvent
Definition: GenABIO.cc:230
std::vector< BeamSpotFitPVData > pvStore_
Definition: PVFitter.h:202
void readEvent(const edm::Event &iEvent)
Definition: PVFitter.cc:101
bool isNotFinite(T x)
Definition: isFinite.h:10
void setBeamWidthY(double v)
Definition: BeamSpot.h:109
BeamSpotTreeData theBeamSpotTreeData_
Definition: PVFitter.h:207
bool fFitPerBunchCrossing
Definition: PVFitter.h:141
TH2F * hPVy
Definition: PVFitter.h:166
void pvData(const BeamSpotFitPVData &pvData)
TTree * ftree_
Definition: PVFitter.h:168
std::map< int, reco::BeamSpot > fbspotMap
Definition: PVFitter.h:140
edm::EDGetTokenT< reco::VertexCollection > vertexToken_
Definition: PVFitter.h:147
double pvQuality(const reco::Vertex &pv) const
vertex quality measure
Definition: PVFitter.cc:555
double maxVtxR_
Definition: PVFitter.h:157
double maxVtxZ_
Definition: PVFitter.h:158
unsigned int maxNrVertices_
Definition: PVFitter.h:151
double fwidthZerr
Definition: PVFitter.h:187
void branch(TTree *tree)
PVFitter()
Definition: PVFitter.h:45
unsigned int minVtxTracks_
Definition: PVFitter.h:155
void fcn(int &, double *, double &, double *, int)
bool runFitter()
Definition: PVFitter.cc:334
TH2F * hPVx
Definition: PVFitter.h:166
unsigned int minNrVertices_
Definition: PVFitter.h:152
void setLimits(float xmin, float xmax, float ymin, float ymax, float zmin, float zmax)
bool runBXFitter()
Definition: PVFitter.cc:203
double sigmaCut_
Definition: PVFitter.h:160
string bx
Definition: rpc-layouts.py:13
edm::EventID id() const
Definition: EventBase.h:56
void setBeamWidthX(double v)
Definition: BeamSpot.h:108
virtual ~PVFitter()
Definition: PVFitter.cc:96
double fwidthX
Definition: PVFitter.h:182
void dumpTxtFile()
Definition: PVFitter.cc:480
tuple size
Write out results.
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40