31 #include <TFitterMinuit.h>
57 nLumiReset = iConfig.
getParameter<
unsigned int>(
"nLumiReset");
59 minNentries = iConfig.
getParameter<
unsigned int>(
"minNentries");
90 if (debugMode ==
true)
92 stringstream debugFile;
95 if (outputDebugFile.is_open() ==
true) outputDebugFile.close();
96 tmp.erase(strlen(
fileName.c_str())-4,4);
97 debugFile << tmp.c_str() <<
"_Run" << iEvent.
id().
run() <<
".txt";
98 outputDebugFile.open(debugFile.str().c_str(),
ios::out);
99 outputDebugFile.close();
100 outputDebugFile.open(debugFile.str().c_str(), ios::app);
105 else if (beginTimeOfFit != 0)
107 totalHits += HitCounter(iEvent);
109 for (vector<Vertex>::const_iterator it3DVx = Vx3DCollection->begin(); it3DVx != Vx3DCollection->end(); it3DVx++)
111 if ((it3DVx->isValid() ==
true) &&
112 (it3DVx->isFake() ==
false) &&
113 (it3DVx->ndof() >= minVxDoF))
115 for (i = 0; i <
DIM; i++)
117 for (j = 0; j <
DIM; j++)
127 if ((i == DIM) && (det > 0.))
129 MyVertex.
x = it3DVx->x();
130 MyVertex.
y = it3DVx->y();
131 MyVertex.
z = it3DVx->z();
134 else if (internalDebug ==
true)
136 cout <<
"Vertex discarded !" << endl;
137 for (i = 0; i <
DIM; i++)
138 for (j = 0; j <
DIM; j++)
139 cout <<
"(i,j) --> " << i <<
"," << j <<
" --> " << MyVertex.
Covariance[i][j] << endl;
142 Vx_X->Fill(it3DVx->x());
143 Vx_Y->Fill(it3DVx->y());
144 Vx_Z->Fill(it3DVx->z());
146 Vx_ZX->Fill(it3DVx->z(), it3DVx->x());
147 Vx_ZY->Fill(it3DVx->z(), it3DVx->y());
148 Vx_XY->Fill(it3DVx->x(), it3DVx->y());
158 iEvent.
getByLabel(
"siPixelRecHits",rechitspixel);
160 unsigned int counter = 0;
172 strftime(ts,
sizeof(ts),
"%Y.%m.%d %H:%M:%S %Z", gmtime(&t));
178 void Gauss3DFunc(
int& ,
double* ,
double& fval,
double* par,
int )
207 K[1][2] = K[2][1] = par[4]*(std::fabs(par[2])-std::fabs(par[1])) - par[5]*par[3] +
VxErrCorr*
VxErrCorr *
Vertices[
i].Covariance[1][2];
208 K[0][2] = K[2][0] = par[5]*(std::fabs(par[2])-std::fabs(par[0])) - par[4]*par[3] +
VxErrCorr*
VxErrCorr *
Vertices[
i].Covariance[0][2];
212 K[0][0] = std::fabs(par[0]);
213 K[1][1] = std::fabs(par[1]);
214 K[2][2] = std::fabs(par[2]);
215 K[0][1] = K[1][0] = par[3];
216 K[1][2] = K[2][1] = par[4]*(std::fabs(par[2])-std::fabs(par[1])) - par[5]*par[3];
217 K[0][2] = K[2][0] = par[5]*(std::fabs(par[2])-std::fabs(par[0])) - par[4]*par[3];
220 det = K[0][0]*(K[1][1]*K[2][2] - K[1][2]*K[1][2]) -
221 K[0][1]*(K[0][1]*K[2][2] - K[0][2]*K[1][2]) +
222 K[0][2]*(K[0][1]*K[1][2] - K[0][2]*K[1][1]);
224 M[0][0] = (K[1][1]*K[2][2] - K[1][2]*K[1][2]) / det;
225 M[1][1] = (K[0][0]*K[2][2] - K[0][2]*K[0][2]) / det;
226 M[2][2] = (K[0][0]*K[1][1] - K[0][1]*K[0][1]) / det;
227 M[0][1] = M[1][0] = (K[0][2]*K[1][2] - K[0][1]*K[2][2]) / det;
228 M[1][2] = M[2][1] = (K[0][2]*K[0][1] - K[1][2]*K[0][0]) / det;
229 M[0][2] = M[2][0] = (K[0][1]*K[1][2] - K[0][2]*K[1][1]) / det;
253 unsigned int nParams = 9;
255 if ((vals !=
NULL) && (vals->size() == nParams*2))
257 double nSigmaXY = 100.;
258 double nSigmaZ = 100.;
259 double varFactor = 4./25.;
260 double parDistanceXY = 0.005;
261 double parDistanceZ = 0.5;
262 double parDistanceddZ = 1
e-3;
263 double parDistanceCxy = 1
e-5;
264 double bestEdm = 1
e-1;
266 const unsigned int trials = 4;
267 double largerDist[trials] = {0.1, 5., 10., 100.};
269 double covxz,covyz,det;
271 int bestMovementX = 1;
272 int bestMovementY = 1;
273 int bestMovementZ = 1;
277 double amin,errdef,edm;
280 vector<double>::const_iterator it = vals->begin();
282 TFitterMinuit* Gauss3D =
new TFitterMinuit(nParams);
283 if (internalDebug ==
true) Gauss3D->SetPrintLevel(3);
284 else Gauss3D->SetPrintLevel(0);
289 if (internalDebug ==
true)
cout <<
"\n@@@ START FITTING @@@" << endl;
293 for (
int i = 0;
i < 3;
i++)
295 deltaMean = (double(
i)-1.)*
std::sqrt((*(it+0))*varFactor);
296 if (internalDebug ==
true)
cout <<
"deltaMean --> " << deltaMean << endl;
302 Gauss3D->SetParameter(0,
"var x ", *(it+0)*varFactor, parDistanceXY*parDistanceXY, 0., 0.);
303 Gauss3D->SetParameter(1,
"var y ", *(it+1)*varFactor, parDistanceXY*parDistanceXY, 0., 0.);
304 Gauss3D->SetParameter(2,
"var z ", *(it+2), parDistanceZ*parDistanceZ, 0., 0.);
305 Gauss3D->SetParameter(3,
"cov xy", *(it+3), parDistanceCxy, 0., 0.);
306 Gauss3D->SetParameter(4,
"dydz ", *(it+4), parDistanceddZ, 0., 0.);
307 Gauss3D->SetParameter(5,
"dxdz ", *(it+5), parDistanceddZ, 0., 0.);
308 Gauss3D->SetParameter(6,
"mean x", *(it+6)+deltaMean, parDistanceXY, 0., 0.);
309 Gauss3D->SetParameter(7,
"mean y", *(it+7), parDistanceXY, 0., 0.);
310 Gauss3D->SetParameter(8,
"mean z", *(it+8), parDistanceZ, 0., 0.);
313 xPos = Gauss3D->GetParameter(6);
314 yPos = Gauss3D->GetParameter(7);
315 zPos = Gauss3D->GetParameter(8);
318 maxTransRadius = nSigmaXY *
std::sqrt(std::fabs(Gauss3D->GetParameter(0)) + std::fabs(Gauss3D->GetParameter(1))) / 2.;
321 goodData = Gauss3D->ExecuteCommand(
"MIGRAD",arglist,2);
322 Gauss3D->GetStats(amin, edm, errdef, nvpar, nparx);
324 if (
counterVx < minNentries) goodData = -2;
326 else for (
unsigned int j = 0;
j < nParams;
j++)
if (
edm::isNotFinite(Gauss3D->GetParError(
j)) ==
true) { goodData = -1;
break; }
329 covyz = Gauss3D->GetParameter(4)*(std::fabs(Gauss3D->GetParameter(2))-std::fabs(Gauss3D->GetParameter(1))) - Gauss3D->GetParameter(5)*Gauss3D->GetParameter(3);
330 covxz = Gauss3D->GetParameter(5)*(std::fabs(Gauss3D->GetParameter(2))-std::fabs(Gauss3D->GetParameter(0))) - Gauss3D->GetParameter(4)*Gauss3D->GetParameter(3);
332 det = std::fabs(Gauss3D->GetParameter(0)) * (std::fabs(Gauss3D->GetParameter(1))*std::fabs(Gauss3D->GetParameter(2)) - covyz*covyz) -
333 Gauss3D->GetParameter(3) * (Gauss3D->GetParameter(3)*std::fabs(Gauss3D->GetParameter(2)) - covxz*covyz) +
334 covxz * (Gauss3D->GetParameter(3)*covyz - covxz*std::fabs(Gauss3D->GetParameter(1)));
335 if (det < 0.) { goodData = -1;
if (internalDebug ==
true)
cout <<
"Negative determinant !" << endl; }
338 if ((goodData == 0) && (std::fabs(edm) < bestEdm)) { bestEdm = edm; bestMovementX =
i; }
340 if (internalDebug ==
true)
cout <<
"Found bestMovementX --> " << bestMovementX << endl;
344 for (
int i = 0;
i < 3;
i++)
346 deltaMean = (double(
i)-1.)*
std::sqrt((*(it+1))*varFactor);
347 if (internalDebug ==
true)
349 cout <<
"deltaMean --> " << deltaMean << endl;
350 cout <<
"deltaMean X --> " << (double(bestMovementX)-1.)*
std::sqrt((*(it+0))*varFactor) << endl;
357 Gauss3D->SetParameter(0,
"var x ", *(it+0)*varFactor, parDistanceXY*parDistanceXY, 0., 0.);
358 Gauss3D->SetParameter(1,
"var y ", *(it+1)*varFactor, parDistanceXY*parDistanceXY, 0., 0.);
359 Gauss3D->SetParameter(2,
"var z ", *(it+2), parDistanceZ*parDistanceZ, 0., 0.);
360 Gauss3D->SetParameter(3,
"cov xy", *(it+3), parDistanceCxy, 0., 0.);
361 Gauss3D->SetParameter(4,
"dydz ", *(it+4), parDistanceddZ, 0., 0.);
362 Gauss3D->SetParameter(5,
"dxdz ", *(it+5), parDistanceddZ, 0., 0.);
363 Gauss3D->SetParameter(6,
"mean x", *(it+6)+(
double(bestMovementX)-1.)*
std::sqrt((*(it+0))*varFactor), parDistanceXY, 0., 0.);
364 Gauss3D->SetParameter(7,
"mean y", *(it+7)+deltaMean, parDistanceXY, 0., 0.);
365 Gauss3D->SetParameter(8,
"mean z", *(it+8), parDistanceZ, 0., 0.);
368 xPos = Gauss3D->GetParameter(6);
369 yPos = Gauss3D->GetParameter(7);
370 zPos = Gauss3D->GetParameter(8);
373 maxTransRadius = nSigmaXY *
std::sqrt(std::fabs(Gauss3D->GetParameter(0)) + std::fabs(Gauss3D->GetParameter(1))) / 2.;
376 goodData = Gauss3D->ExecuteCommand(
"MIGRAD",arglist,2);
377 Gauss3D->GetStats(amin, edm, errdef, nvpar, nparx);
379 if (
counterVx < minNentries) goodData = -2;
381 else for (
unsigned int j = 0;
j < nParams;
j++)
if (
edm::isNotFinite(Gauss3D->GetParError(
j)) ==
true) { goodData = -1;
break; }
384 covyz = Gauss3D->GetParameter(4)*(std::fabs(Gauss3D->GetParameter(2))-std::fabs(Gauss3D->GetParameter(1))) - Gauss3D->GetParameter(5)*Gauss3D->GetParameter(3);
385 covxz = Gauss3D->GetParameter(5)*(std::fabs(Gauss3D->GetParameter(2))-std::fabs(Gauss3D->GetParameter(0))) - Gauss3D->GetParameter(4)*Gauss3D->GetParameter(3);
387 det = std::fabs(Gauss3D->GetParameter(0)) * (std::fabs(Gauss3D->GetParameter(1))*std::fabs(Gauss3D->GetParameter(2)) - covyz*covyz) -
388 Gauss3D->GetParameter(3) * (Gauss3D->GetParameter(3)*std::fabs(Gauss3D->GetParameter(2)) - covxz*covyz) +
389 covxz * (Gauss3D->GetParameter(3)*covyz - covxz*std::fabs(Gauss3D->GetParameter(1)));
390 if (det < 0.) { goodData = -1;
if (internalDebug ==
true)
cout <<
"Negative determinant !" << endl; }
393 if ((goodData == 0) && (std::fabs(edm) < bestEdm)) { bestEdm = edm; bestMovementY =
i; }
395 if (internalDebug ==
true)
cout <<
"Found bestMovementY --> " << bestMovementY << endl;
399 for (
int i = 0;
i < 3;
i++)
401 deltaMean = (double(
i)-1.)*
std::sqrt(*(it+2));
402 if (internalDebug ==
true)
404 cout <<
"deltaMean --> " << deltaMean << endl;
405 cout <<
"deltaMean X --> " << (double(bestMovementX)-1.)*
std::sqrt((*(it+0))*varFactor) << endl;
406 cout <<
"deltaMean Y --> " << (double(bestMovementY)-1.)*
std::sqrt((*(it+1))*varFactor) << endl;
413 Gauss3D->SetParameter(0,
"var x ", *(it+0)*varFactor, parDistanceXY*parDistanceXY, 0., 0.);
414 Gauss3D->SetParameter(1,
"var y ", *(it+1)*varFactor, parDistanceXY*parDistanceXY, 0., 0.);
415 Gauss3D->SetParameter(2,
"var z ", *(it+2), parDistanceZ*parDistanceZ, 0., 0.);
416 Gauss3D->SetParameter(3,
"cov xy", *(it+3), parDistanceCxy, 0., 0.);
417 Gauss3D->SetParameter(4,
"dydz ", *(it+4), parDistanceddZ, 0., 0.);
418 Gauss3D->SetParameter(5,
"dxdz ", *(it+5), parDistanceddZ, 0., 0.);
419 Gauss3D->SetParameter(6,
"mean x", *(it+6)+(
double(bestMovementX)-1.)*
std::sqrt((*(it+0))*varFactor), parDistanceXY, 0., 0.);
420 Gauss3D->SetParameter(7,
"mean y", *(it+7)+(
double(bestMovementY)-1.)*
std::sqrt((*(it+1))*varFactor), parDistanceXY, 0., 0.);
421 Gauss3D->SetParameter(8,
"mean z", *(it+8)+deltaMean, parDistanceZ, 0., 0.);
424 xPos = Gauss3D->GetParameter(6);
425 yPos = Gauss3D->GetParameter(7);
426 zPos = Gauss3D->GetParameter(8);
429 maxTransRadius = nSigmaXY *
std::sqrt(std::fabs(Gauss3D->GetParameter(0)) + std::fabs(Gauss3D->GetParameter(1))) / 2.;
432 goodData = Gauss3D->ExecuteCommand(
"MIGRAD",arglist,2);
433 Gauss3D->GetStats(amin, edm, errdef, nvpar, nparx);
435 if (
counterVx < minNentries) goodData = -2;
437 else for (
unsigned int j = 0;
j < nParams;
j++)
if (
edm::isNotFinite(Gauss3D->GetParError(
j)) ==
true) { goodData = -1;
break; }
440 covyz = Gauss3D->GetParameter(4)*(std::fabs(Gauss3D->GetParameter(2))-std::fabs(Gauss3D->GetParameter(1))) - Gauss3D->GetParameter(5)*Gauss3D->GetParameter(3);
441 covxz = Gauss3D->GetParameter(5)*(std::fabs(Gauss3D->GetParameter(2))-std::fabs(Gauss3D->GetParameter(0))) - Gauss3D->GetParameter(4)*Gauss3D->GetParameter(3);
443 det = std::fabs(Gauss3D->GetParameter(0)) * (std::fabs(Gauss3D->GetParameter(1))*std::fabs(Gauss3D->GetParameter(2)) - covyz*covyz) -
444 Gauss3D->GetParameter(3) * (Gauss3D->GetParameter(3)*std::fabs(Gauss3D->GetParameter(2)) - covxz*covyz) +
445 covxz * (Gauss3D->GetParameter(3)*covyz - covxz*std::fabs(Gauss3D->GetParameter(1)));
446 if (det < 0.) { goodData = -1;
if (internalDebug ==
true)
cout <<
"Negative determinant !" << endl; }
449 if ((goodData == 0) && (std::fabs(edm) < bestEdm)) { bestEdm = edm; bestMovementZ =
i; }
451 if (internalDebug ==
true)
cout <<
"Found bestMovementZ --> " << bestMovementZ << endl;
458 Gauss3D->SetParameter(0,
"var x ", *(it+0)*varFactor, parDistanceXY*parDistanceXY, 0., 0.);
459 Gauss3D->SetParameter(1,
"var y ", *(it+1)*varFactor, parDistanceXY*parDistanceXY, 0., 0.);
460 Gauss3D->SetParameter(2,
"var z ", *(it+2), parDistanceZ*parDistanceZ, 0., 0.);
461 Gauss3D->SetParameter(3,
"cov xy", *(it+3), parDistanceCxy, 0., 0.);
462 Gauss3D->SetParameter(4,
"dydz ", *(it+4), parDistanceddZ, 0., 0.);
463 Gauss3D->SetParameter(5,
"dxdz ", *(it+5), parDistanceddZ, 0., 0.);
464 Gauss3D->SetParameter(6,
"mean x", *(it+6)+(
double(bestMovementX)-1.)*
std::sqrt((*(it+0))*varFactor), parDistanceXY, 0., 0.);
465 Gauss3D->SetParameter(7,
"mean y", *(it+7)+(
double(bestMovementY)-1.)*
std::sqrt((*(it+1))*varFactor), parDistanceXY, 0., 0.);
466 Gauss3D->SetParameter(8,
"mean z", *(it+8)+(
double(bestMovementZ)-1.)*
std::sqrt(*(it+2)), parDistanceZ, 0., 0.);
469 xPos = Gauss3D->GetParameter(6);
470 yPos = Gauss3D->GetParameter(7);
471 zPos = Gauss3D->GetParameter(8);
474 maxTransRadius = nSigmaXY *
std::sqrt(std::fabs(Gauss3D->GetParameter(0)) + std::fabs(Gauss3D->GetParameter(1))) / 2.;
477 goodData = Gauss3D->ExecuteCommand(
"MIGRAD",arglist,2);
478 Gauss3D->GetStats(amin, edm, errdef, nvpar, nparx);
480 if (
counterVx < minNentries) goodData = -2;
482 else for (
unsigned int j = 0;
j < nParams;
j++)
if (
edm::isNotFinite(Gauss3D->GetParError(
j)) ==
true) { goodData = -1;
break; }
485 covyz = Gauss3D->GetParameter(4)*(std::fabs(Gauss3D->GetParameter(2))-std::fabs(Gauss3D->GetParameter(1))) - Gauss3D->GetParameter(5)*Gauss3D->GetParameter(3);
486 covxz = Gauss3D->GetParameter(5)*(std::fabs(Gauss3D->GetParameter(2))-std::fabs(Gauss3D->GetParameter(0))) - Gauss3D->GetParameter(4)*Gauss3D->GetParameter(3);
488 det = std::fabs(Gauss3D->GetParameter(0)) * (std::fabs(Gauss3D->GetParameter(1))*std::fabs(Gauss3D->GetParameter(2)) - covyz*covyz) -
489 Gauss3D->GetParameter(3) * (Gauss3D->GetParameter(3)*std::fabs(Gauss3D->GetParameter(2)) - covxz*covyz) +
490 covxz * (Gauss3D->GetParameter(3)*covyz - covxz*std::fabs(Gauss3D->GetParameter(1)));
491 if (det < 0.) { goodData = -1;
if (internalDebug ==
true)
cout <<
"Negative determinant !" << endl; }
497 for (
unsigned int i = 0;
i < trials;
i++)
499 if ((goodData != 0) && (goodData != -2))
503 if (internalDebug ==
true)
cout <<
"FIT WITH DIFFERENT PARAMETER DISTANCES - STEP " <<
i+1 << endl;
505 Gauss3D->SetParameter(0,
"var x ", *(it+0)*varFactor, parDistanceXY*parDistanceXY * largerDist[
i], 0, 0);
506 Gauss3D->SetParameter(1,
"var y ", *(it+1)*varFactor, parDistanceXY*parDistanceXY * largerDist[i], 0, 0);
507 Gauss3D->SetParameter(2,
"var z ", *(it+2), parDistanceZ*parDistanceZ * largerDist[i], 0, 0);
508 Gauss3D->SetParameter(3,
"cov xy", *(it+3), parDistanceCxy * largerDist[i], 0, 0);
509 Gauss3D->SetParameter(4,
"dydz ", *(it+4), parDistanceddZ * largerDist[i], 0, 0);
510 Gauss3D->SetParameter(5,
"dxdz ", *(it+5), parDistanceddZ * largerDist[i], 0, 0);
511 Gauss3D->SetParameter(6,
"mean x", *(it+6)+(
double(bestMovementX)-1.)*std::sqrt((*(it+0))*varFactor), parDistanceXY * largerDist[i], 0, 0);
512 Gauss3D->SetParameter(7,
"mean y", *(it+7)+(
double(bestMovementY)-1.)*std::sqrt((*(it+1))*varFactor), parDistanceXY * largerDist[i], 0, 0);
513 Gauss3D->SetParameter(8,
"mean z", *(it+8)+(
double(bestMovementZ)-1.)*std::sqrt(*(it+2)), parDistanceZ * largerDist[i], 0, 0);
516 xPos = Gauss3D->GetParameter(6);
517 yPos = Gauss3D->GetParameter(7);
518 zPos = Gauss3D->GetParameter(8);
521 maxTransRadius = nSigmaXY *
std::sqrt(std::fabs(Gauss3D->GetParameter(0)) + std::fabs(Gauss3D->GetParameter(1))) / 2.;
524 goodData = Gauss3D->ExecuteCommand(
"MIGRAD",arglist,2);
525 Gauss3D->GetStats(amin, edm, errdef, nvpar, nparx);
527 if (
counterVx < minNentries) goodData = -2;
529 else for (
unsigned int j = 0;
j < nParams;
j++)
if (
edm::isNotFinite(Gauss3D->GetParError(
j)) ==
true) { goodData = -1;
break; }
532 covyz = Gauss3D->GetParameter(4)*(std::fabs(Gauss3D->GetParameter(2))-std::fabs(Gauss3D->GetParameter(1))) - Gauss3D->GetParameter(5)*Gauss3D->GetParameter(3);
533 covxz = Gauss3D->GetParameter(5)*(std::fabs(Gauss3D->GetParameter(2))-std::fabs(Gauss3D->GetParameter(0))) - Gauss3D->GetParameter(4)*Gauss3D->GetParameter(3);
535 det = std::fabs(Gauss3D->GetParameter(0)) * (std::fabs(Gauss3D->GetParameter(1))*std::fabs(Gauss3D->GetParameter(2)) - covyz*covyz) -
536 Gauss3D->GetParameter(3) * (Gauss3D->GetParameter(3)*std::fabs(Gauss3D->GetParameter(2)) - covxz*covyz) +
537 covxz * (Gauss3D->GetParameter(3)*covyz - covxz*std::fabs(Gauss3D->GetParameter(1)));
538 if (det < 0.) { goodData = -1;
if (internalDebug ==
true)
cout <<
"Negative determinant !" << endl; }
544 for (
unsigned int i = 0;
i < nParams;
i++)
546 vals->operator[](
i) = Gauss3D->GetParameter(
i);
547 vals->operator[](
i+nParams) = Gauss3D->GetParError(
i);
560 if (ResetType.compare(
"scratch") == 0)
587 hitCountHistory->Reset();
588 goodVxCounter->Reset();
589 goodVxCountHistory->Reset();
592 reportSummary->Fill(0.);
593 reportSummaryMap->Fill(0.5, 0.5, 0.);
598 lumiCounterHisto = 0;
605 else if (ResetType.compare(
"whole") == 0)
618 lumiCounterHisto = 0;
625 else if (ResetType.compare(
"partial") == 0)
640 else if (ResetType.compare(
"nohisto") == 0)
645 lumiCounterHisto = 0;
652 else if (ResetType.compare(
"hitCounter") == 0)
660 unsigned int BeginLumiOfFit,
661 unsigned int EndLumiOfFit,
664 stringstream BufferString;
665 BufferString.precision(5);
669 if ((
outputFile.is_open() ==
true) && (vals !=
NULL) && (vals->size() == 8*2))
671 vector<double>::const_iterator it = vals->begin();
674 outputFile <<
"BeginTimeOfFit " <<
formatTime(beginTimeOfFit >> 32) <<
" " << (beginTimeOfFit >> 32) << endl;
675 outputFile <<
"EndTimeOfFit " <<
formatTime(endTimeOfFit >> 32) <<
" " << (endTimeOfFit >> 32) << endl;
676 outputFile <<
"LumiRange " << beginLumiOfFit <<
" - " << endLumiOfFit << endl;
682 BufferString << *(it+0);
683 outputFile <<
"X0 " << BufferString.str().c_str() << endl;
684 BufferString.str(
"");
686 BufferString << *(it+1);
687 outputFile <<
"Y0 " << BufferString.str().c_str() << endl;
688 BufferString.str(
"");
690 BufferString << *(it+2);
691 outputFile <<
"Z0 " << BufferString.str().c_str() << endl;
692 BufferString.str(
"");
694 BufferString << *(it+3);
695 outputFile <<
"sigmaZ0 " << BufferString.str().c_str() << endl;
696 BufferString.str(
"");
698 BufferString << *(it+4);
699 outputFile <<
"dxdz " << BufferString.str().c_str() << endl;
700 BufferString.str(
"");
702 BufferString << *(it+5);
703 outputFile <<
"dydz " << BufferString.str().c_str() << endl;
704 BufferString.str(
"");
706 BufferString << *(it+6);
707 outputFile <<
"BeamWidthX " << BufferString.str().c_str() << endl;
708 BufferString.str(
"");
710 BufferString << *(it+7);
711 outputFile <<
"BeamWidthY " << BufferString.str().c_str() << endl;
712 BufferString.str(
"");
714 outputFile <<
"Cov(0,j) " << *(it+8) <<
" 0.0 0.0 0.0 0.0 0.0 0.0" << endl;
715 outputFile <<
"Cov(1,j) 0.0 " << *(it+9) <<
" 0.0 0.0 0.0 0.0 0.0" << endl;
716 outputFile <<
"Cov(2,j) 0.0 0.0 " << *(it+10) <<
" 0.0 0.0 0.0 0.0" << endl;
717 outputFile <<
"Cov(3,j) 0.0 0.0 0.0 " << *(it+11) <<
" 0.0 0.0 0.0" << endl;
718 outputFile <<
"Cov(4,j) 0.0 0.0 0.0 0.0 " << *(it+12) <<
" 0.0 0.0" << endl;
719 outputFile <<
"Cov(5,j) 0.0 0.0 0.0 0.0 0.0 " << *(it+13) <<
" 0.0" << endl;
720 outputFile <<
"Cov(6,j) 0.0 0.0 0.0 0.0 0.0 0.0 " << ((*(it+14)) + (*(it+15)) + 2.*
std::sqrt((*(it+14))*(*(it+15)))) / 4. << endl;
728 if ((debugMode ==
true) && (outputDebugFile.is_open() ==
true) && (vals !=
NULL) && (vals->size() == 8*2))
730 vector<double>::const_iterator it = vals->begin();
732 outputDebugFile <<
"Runnumber " <<
runNumber << endl;
733 outputDebugFile <<
"BeginTimeOfFit " <<
formatTime(beginTimeOfFit >> 32) <<
" " << (beginTimeOfFit >> 32) << endl;
734 outputDebugFile <<
"EndTimeOfFit " <<
formatTime(endTimeOfFit >> 32) <<
" " << (endTimeOfFit >> 32) << endl;
735 outputDebugFile <<
"LumiRange " << beginLumiOfFit <<
" - " << endLumiOfFit << endl;
736 outputDebugFile <<
"Type " << dataType << endl;
741 BufferString << *(it+0);
742 outputDebugFile <<
"X0 " << BufferString.str().c_str() << endl;
743 BufferString.str(
"");
745 BufferString << *(it+1);
746 outputDebugFile <<
"Y0 " << BufferString.str().c_str() << endl;
747 BufferString.str(
"");
749 BufferString << *(it+2);
750 outputDebugFile <<
"Z0 " << BufferString.str().c_str() << endl;
751 BufferString.str(
"");
753 BufferString << *(it+3);
754 outputDebugFile <<
"sigmaZ0 " << BufferString.str().c_str() << endl;
755 BufferString.str(
"");
757 BufferString << *(it+4);
758 outputDebugFile <<
"dxdz " << BufferString.str().c_str() << endl;
759 BufferString.str(
"");
761 BufferString << *(it+5);
762 outputDebugFile <<
"dydz " << BufferString.str().c_str() << endl;
763 BufferString.str(
"");
765 BufferString << *(it+6);
766 outputDebugFile <<
"BeamWidthX " << BufferString.str().c_str() << endl;
767 BufferString.str(
"");
769 BufferString << *(it+7);
770 outputDebugFile <<
"BeamWidthY " << BufferString.str().c_str() << endl;
771 BufferString.str(
"");
773 outputDebugFile <<
"Cov(0,j) " << *(it+8) <<
" 0.0 0.0 0.0 0.0 0.0 0.0" << endl;
774 outputDebugFile <<
"Cov(1,j) 0.0 " << *(it+9) <<
" 0.0 0.0 0.0 0.0 0.0" << endl;
775 outputDebugFile <<
"Cov(2,j) 0.0 0.0 " << *(it+10) <<
" 0.0 0.0 0.0 0.0" << endl;
776 outputDebugFile <<
"Cov(3,j) 0.0 0.0 0.0 " << *(it+11) <<
" 0.0 0.0 0.0" << endl;
777 outputDebugFile <<
"Cov(4,j) 0.0 0.0 0.0 0.0 " << *(it+12) <<
" 0.0 0.0" << endl;
778 outputDebugFile <<
"Cov(5,j) 0.0 0.0 0.0 0.0 0.0 " << *(it+13) <<
" 0.0" << endl;
779 outputDebugFile <<
"Cov(6,j) 0.0 0.0 0.0 0.0 0.0 0.0 " << ((*(it+14)) + (*(it+15)) + 2.*
std::sqrt((*(it+14))*(*(it+15)))) / 4. << endl;
781 outputDebugFile <<
"EmittanceX 0.0" << endl;
782 outputDebugFile <<
"EmittanceY 0.0" << endl;
783 outputDebugFile <<
"BetaStar 0.0" << endl;
791 if ((lumiCounter == 0) && (lumiBlock.
luminosityBlock() > lastLumiOfFit))
798 else if ((lumiCounter != 0) && (lumiBlock.
luminosityBlock() >= (beginLumiOfFit+lumiCounter))) { lumiCounter++; lumiCounterHisto++; }
805 stringstream histTitle;
807 unsigned int nParams = 9;
809 if ((lumiCounter%nLumiReset == 0) && (nLumiReset != 0) && (beginTimeOfFit != 0) && (
runNumber != 0))
813 lastLumiOfFit = endLumiOfFit;
816 hitCounter->ShiftFillLast((
double)totalHits,
std::sqrt((
double)totalHits), nLumiReset);
818 if (lastLumiOfFit % prescaleHistory == 0)
820 hitCountHistory->getTH1()->SetBinContent(lastLumiOfFit, (
double)totalHits);
821 hitCountHistory->getTH1()->SetBinError(lastLumiOfFit,
std::sqrt((
double)totalHits));
824 if (dataFromFit ==
true)
826 vector<double> fitResults;
828 fitResults.push_back(Vx_X->getTH1()->GetRMS()*Vx_X->getTH1()->GetRMS());
829 fitResults.push_back(Vx_Y->getTH1()->GetRMS()*Vx_Y->getTH1()->GetRMS());
830 fitResults.push_back(Vx_Z->getTH1()->GetRMS()*Vx_Z->getTH1()->GetRMS());
831 fitResults.push_back(0.0);
832 fitResults.push_back(0.0);
833 fitResults.push_back(0.0);
834 fitResults.push_back(Vx_X->getTH1()->GetMean());
835 fitResults.push_back(Vx_Y->getTH1()->GetMean());
836 fitResults.push_back(Vx_Z->getTH1()->GetMean());
837 for (
unsigned int i = 0;
i < nParams;
i++) fitResults.push_back(0.0);
839 goodData = MyFit(&fitResults);
841 if (internalDebug ==
true)
843 cout <<
"goodData --> " << goodData << endl;
845 cout <<
"var x --> " << fitResults[0] <<
" +/- " << fitResults[0+nParams] << endl;
846 cout <<
"var y --> " << fitResults[1] <<
" +/- " << fitResults[1+nParams] << endl;
847 cout <<
"var z --> " << fitResults[2] <<
" +/- " << fitResults[2+nParams] << endl;
848 cout <<
"cov xy --> " << fitResults[3] <<
" +/- " << fitResults[3+nParams] << endl;
849 cout <<
"dydz --> " << fitResults[4] <<
" +/- " << fitResults[4+nParams] << endl;
850 cout <<
"dxdz --> " << fitResults[5] <<
" +/- " << fitResults[5+nParams] << endl;
851 cout <<
"mean x --> " << fitResults[6] <<
" +/- " << fitResults[6+nParams] << endl;
852 cout <<
"mean y --> " << fitResults[7] <<
" +/- " << fitResults[7+nParams] << endl;
853 cout <<
"mean z --> " << fitResults[8] <<
" +/- " << fitResults[8+nParams] << endl;
858 vals.push_back(fitResults[6]);
859 vals.push_back(fitResults[7]);
860 vals.push_back(fitResults[8]);
861 vals.push_back(
std::sqrt(std::fabs(fitResults[2])));
862 vals.push_back(fitResults[5]);
863 vals.push_back(fitResults[4]);
864 vals.push_back(
std::sqrt(std::fabs(fitResults[0])));
865 vals.push_back(
std::sqrt(std::fabs(fitResults[1])));
867 vals.push_back(
std::pow(fitResults[6+nParams],2.));
868 vals.push_back(
std::pow(fitResults[7+nParams],2.));
869 vals.push_back(
std::pow(fitResults[8+nParams],2.));
870 vals.push_back(
std::pow(std::fabs(fitResults[2+nParams]) / (2.*
std::sqrt(std::fabs(fitResults[2]))),2.));
871 vals.push_back(
std::pow(fitResults[5+nParams],2.));
872 vals.push_back(
std::pow(fitResults[4+nParams],2.));
873 vals.push_back(
std::pow(std::fabs(fitResults[0+nParams]) / (2.*
std::sqrt(std::fabs(fitResults[0]))),2.));
874 vals.push_back(
std::pow(std::fabs(fitResults[1+nParams]) / (2.*
std::sqrt(std::fabs(fitResults[1]))),2.));
876 else for (
unsigned int i = 0;
i < 8*2;
i++) vals.push_back(0.0);
882 counterVx = Vx_X->getTH1F()->GetEntries();
884 if (Vx_X->getTH1F()->GetEntries() >= minNentries)
888 vals.push_back(Vx_X->getTH1F()->GetMean());
889 vals.push_back(Vx_Y->getTH1F()->GetMean());
890 vals.push_back(Vx_Z->getTH1F()->GetMean());
891 vals.push_back(Vx_Z->getTH1F()->GetRMS());
894 vals.push_back(Vx_X->getTH1F()->GetRMS());
895 vals.push_back(Vx_Y->getTH1F()->GetRMS());
897 vals.push_back(
std::pow(Vx_X->getTH1F()->GetMeanError(),2.));
898 vals.push_back(
std::pow(Vx_Y->getTH1F()->GetMeanError(),2.));
899 vals.push_back(
std::pow(Vx_Z->getTH1F()->GetMeanError(),2.));
900 vals.push_back(
std::pow(Vx_Z->getTH1F()->GetRMSError(),2.));
903 vals.push_back(
std::pow(Vx_X->getTH1F()->GetRMSError(),2.));
904 vals.push_back(
std::pow(Vx_Y->getTH1F()->GetRMSError(),2.));
909 for (
unsigned int i = 0;
i < 8*2;
i++) vals.push_back(0.0);
939 writeToFile(&vals, beginTimeOfFit, endTimeOfFit, beginLumiOfFit, endLumiOfFit, 3);
940 if ((internalDebug ==
true) && (outputDebugFile.is_open() ==
true)) outputDebugFile <<
"Used vertices: " <<
counterVx << endl;
944 histTitle <<
"Fitted Beam Spot [cm] (Lumi start: " << beginLumiOfFit <<
" - Lumi end: " << endLumiOfFit <<
")";
945 if (lumiCounterHisto >= maxLumiIntegration)
reset(
"whole");
946 else reset(
"partial");
950 writeToFile(&vals, beginTimeOfFit, endTimeOfFit, beginLumiOfFit, endLumiOfFit, -1);
951 if ((internalDebug ==
true) && (outputDebugFile.is_open() ==
true)) outputDebugFile <<
"Used vertices: " <<
counterVx << endl;
955 histTitle <<
"Fitted Beam Spot [cm] (not enough statistics)";
956 if (lumiCounter >= maxLumiIntegration)
reset(
"whole");
957 else reset(
"hitCounter");
961 histTitle <<
"Fitted Beam Spot [cm] (problems)";
962 if (lumiCounterHisto >= maxLumiIntegration)
reset(
"whole");
963 else reset(
"partial");
969 reportSummary->Fill(numberFits != 0 ? (
double)numberGoodFits/(
double)numberFits : 0.0);
970 reportSummaryMap->Fill(0.5, 0.5, numberFits != 0 ? (
double)numberGoodFits/(
double)numberFits : 0.0);
972 fitResults->setAxisTitle(histTitle.str().c_str(), 1);
974 fitResults->setBinContent(1, 9, vals[0]);
975 fitResults->setBinContent(1, 8, vals[1]);
976 fitResults->setBinContent(1, 7, vals[2]);
977 fitResults->setBinContent(1, 6, vals[3]);
978 fitResults->setBinContent(1, 5, vals[4]);
979 fitResults->setBinContent(1, 4, vals[5]);
980 fitResults->setBinContent(1, 3, vals[6]);
981 fitResults->setBinContent(1, 2, vals[7]);
982 fitResults->setBinContent(1, 1,
counterVx);
984 fitResults->setBinContent(2, 9,
std::sqrt(vals[8]));
985 fitResults->setBinContent(2, 8,
std::sqrt(vals[9]));
986 fitResults->setBinContent(2, 7,
std::sqrt(vals[10]));
987 fitResults->setBinContent(2, 6,
std::sqrt(vals[11]));
988 fitResults->setBinContent(2, 5,
std::sqrt(vals[12]));
989 fitResults->setBinContent(2, 4,
std::sqrt(vals[13]));
990 fitResults->setBinContent(2, 3,
std::sqrt(vals[14]));
991 fitResults->setBinContent(2, 2,
std::sqrt(vals[15]));
995 TF1* myLinFit =
new TF1(
"myLinFit",
"[0] + [1]*x", mXlumi->getTH1()->GetXaxis()->GetXmin(), mXlumi->getTH1()->GetXaxis()->GetXmax());
996 myLinFit->SetLineColor(2);
997 myLinFit->SetLineWidth(2);
998 myLinFit->SetParName(0,
"Intercept");
999 myLinFit->SetParName(1,
"Slope");
1001 mXlumi->ShiftFillLast(vals[0],
std::sqrt(vals[8]), nLumiReset);
1002 myLinFit->SetParameter(0, mXlumi->getTH1()->GetMean(2));
1003 myLinFit->SetParameter(1, 0.0);
1004 mXlumi->getTH1()->Fit(
"myLinFit",
"QR");
1006 mYlumi->ShiftFillLast(vals[1],
std::sqrt(vals[9]), nLumiReset);
1007 myLinFit->SetParameter(0, mYlumi->getTH1()->GetMean(2));
1008 myLinFit->SetParameter(1, 0.0);
1009 mYlumi->getTH1()->Fit(
"myLinFit",
"QR");
1011 mZlumi->ShiftFillLast(vals[2],
std::sqrt(vals[10]), nLumiReset);
1012 myLinFit->SetParameter(0, mZlumi->getTH1()->GetMean(2));
1013 myLinFit->SetParameter(1, 0.0);
1014 mZlumi->getTH1()->Fit(
"myLinFit",
"QR");
1016 sXlumi->ShiftFillLast(vals[6],
std::sqrt(vals[14]), nLumiReset);
1017 myLinFit->SetParameter(0, sXlumi->getTH1()->GetMean(2));
1018 myLinFit->SetParameter(1, 0.0);
1019 sXlumi->getTH1()->Fit(
"myLinFit",
"QR");
1021 sYlumi->ShiftFillLast(vals[7],
std::sqrt(vals[15]), nLumiReset);
1022 myLinFit->SetParameter(0, sYlumi->getTH1()->GetMean(2));
1023 myLinFit->SetParameter(1, 0.0);
1024 sYlumi->getTH1()->Fit(
"myLinFit",
"QR");
1026 sZlumi->ShiftFillLast(vals[3],
std::sqrt(vals[11]), nLumiReset);
1027 myLinFit->SetParameter(0, sZlumi->getTH1()->GetMean(2));
1028 myLinFit->SetParameter(1, 0.0);
1029 sZlumi->getTH1()->Fit(
"myLinFit",
"QR");
1031 dxdzlumi->ShiftFillLast(vals[4],
std::sqrt(vals[12]), nLumiReset);
1032 myLinFit->SetParameter(0, dxdzlumi->getTH1()->GetMean(2));
1033 myLinFit->SetParameter(1, 0.0);
1034 dxdzlumi->getTH1()->Fit(
"myLinFit",
"QR");
1036 dydzlumi->ShiftFillLast(vals[5],
std::sqrt(vals[13]), nLumiReset);
1037 myLinFit->SetParameter(0, dydzlumi->getTH1()->GetMean(2));
1038 myLinFit->SetParameter(1, 0.0);
1039 dydzlumi->getTH1()->Fit(
"myLinFit",
"QR");
1041 goodVxCounter->ShiftFillLast((
double)
counterVx,
std::sqrt((
double)counterVx), nLumiReset);
1042 myLinFit->SetParameter(0, goodVxCounter->getTH1()->GetMean(2));
1043 myLinFit->SetParameter(1, 0.0);
1044 goodVxCounter->getTH1()->Fit(
"myLinFit",
"QR");
1046 if (lastLumiOfFit % prescaleHistory == 0)
1048 goodVxCountHistory->getTH1()->SetBinContent(lastLumiOfFit, (
double)counterVx);
1049 goodVxCountHistory->getTH1()->SetBinError(lastLumiOfFit,
std::sqrt((
double)counterVx));
1056 else if (nLumiReset == 0)
1058 histTitle <<
"Fitted Beam Spot [cm] (no ongoing fits)";
1059 fitResults->setAxisTitle(histTitle.str().c_str(), 1);
1060 reportSummaryMap->Fill(0.5, 0.5, 1.0);
1061 hitCounter->ShiftFillLast(totalHits,
std::sqrt(totalHits), 1);
1073 nBinsHistoricalPlot = 80;
1074 nBinsWholeHistory = 3000;
1081 Vx_X = dbe->
book1D(
"vertex x",
"Primary Vertex X Coordinate Distribution",
int(rint(xRange/xStep)), -xRange/2., xRange/2.);
1082 Vx_Y = dbe->
book1D(
"vertex y",
"Primary Vertex Y Coordinate Distribution",
int(rint(yRange/yStep)), -yRange/2., yRange/2.);
1083 Vx_Z = dbe->
book1D(
"vertex z",
"Primary Vertex Z Coordinate Distribution",
int(rint(zRange/zStep)), -zRange/2., zRange/2.);
1085 Vx_X->setAxisTitle(
"Entries [#]",2);
1086 Vx_Y->setAxisTitle(
"Primary Vertices Y [cm]",1);
1087 Vx_Y->setAxisTitle(
"Entries [#]",2);
1088 Vx_Z->setAxisTitle(
"Primary Vertices Z [cm]",1);
1089 Vx_Z->setAxisTitle(
"Entries [#]",2);
1091 mXlumi = dbe->
book1D(
"muX vs lumi",
"\\mu_{x} vs. Lumisection", nBinsHistoricalPlot, 0.5, (
double)nBinsHistoricalPlot+0.5);
1092 mYlumi = dbe->
book1D(
"muY vs lumi",
"\\mu_{y} vs. Lumisection", nBinsHistoricalPlot, 0.5, (
double)nBinsHistoricalPlot+0.5);
1093 mZlumi = dbe->
book1D(
"muZ vs lumi",
"\\mu_{z} vs. Lumisection", nBinsHistoricalPlot, 0.5, (
double)nBinsHistoricalPlot+0.5);
1095 mXlumi->setAxisTitle(
"\\mu_{x} [cm]",2);
1096 mXlumi->getTH1()->SetOption(
"E1");
1097 mYlumi->setAxisTitle(
"Lumisection [#]",1);
1098 mYlumi->setAxisTitle(
"\\mu_{y} [cm]",2);
1099 mYlumi->getTH1()->SetOption(
"E1");
1100 mZlumi->setAxisTitle(
"Lumisection [#]",1);
1101 mZlumi->setAxisTitle(
"\\mu_{z} [cm]",2);
1102 mZlumi->getTH1()->SetOption(
"E1");
1104 sXlumi = dbe->
book1D(
"sigmaX vs lumi",
"\\sigma_{x} vs. Lumisection", nBinsHistoricalPlot, 0.5, (
double)nBinsHistoricalPlot+0.5);
1105 sYlumi = dbe->
book1D(
"sigmaY vs lumi",
"\\sigma_{y} vs. Lumisection", nBinsHistoricalPlot, 0.5, (
double)nBinsHistoricalPlot+0.5);
1106 sZlumi = dbe->
book1D(
"sigmaZ vs lumi",
"\\sigma_{z} vs. Lumisection", nBinsHistoricalPlot, 0.5, (
double)nBinsHistoricalPlot+0.5);
1108 sXlumi->setAxisTitle(
"\\sigma_{x} [cm]",2);
1109 sXlumi->getTH1()->SetOption(
"E1");
1110 sYlumi->setAxisTitle(
"Lumisection [#]",1);
1111 sYlumi->setAxisTitle(
"\\sigma_{y} [cm]",2);
1112 sYlumi->getTH1()->SetOption(
"E1");
1113 sZlumi->setAxisTitle(
"Lumisection [#]",1);
1114 sZlumi->setAxisTitle(
"\\sigma_{z} [cm]",2);
1115 sZlumi->getTH1()->SetOption(
"E1");
1117 dxdzlumi = dbe->
book1D(
"dxdz vs lumi",
"dX/dZ vs. Lumisection", nBinsHistoricalPlot, 0.5, (
double)nBinsHistoricalPlot+0.5);
1118 dydzlumi = dbe->
book1D(
"dydz vs lumi",
"dY/dZ vs. Lumisection", nBinsHistoricalPlot, 0.5, (
double)nBinsHistoricalPlot+0.5);
1120 dxdzlumi->setAxisTitle(
"dX/dZ [rad]",2);
1121 dxdzlumi->getTH1()->SetOption(
"E1");
1122 dydzlumi->setAxisTitle(
"Lumisection [#]",1);
1123 dydzlumi->setAxisTitle(
"dY/dZ [rad]",2);
1124 dydzlumi->getTH1()->SetOption(
"E1");
1126 Vx_ZX = dbe->
book2D(
"vertex zx",
"Primary Vertex ZX Coordinate Distribution",
int(rint(zRange/zStep/5.)), -zRange/2., zRange/2.,
int(rint(xRange/xStep/5.)), -xRange/2., xRange/2.);
1127 Vx_ZY = dbe->
book2D(
"vertex zy",
"Primary Vertex ZY Coordinate Distribution",
int(rint(zRange/zStep/5.)), -zRange/2., zRange/2.,
int(rint(yRange/yStep/5.)), -yRange/2., yRange/2.);
1128 Vx_XY = dbe->
book2D(
"vertex xy",
"Primary Vertex XY Coordinate Distribution",
int(rint(xRange/xStep/5.)), -xRange/2., xRange/2.,
int(rint(yRange/yStep/5.)), -yRange/2., yRange/2.);
1130 Vx_ZX->setAxisTitle(
"Primary Vertices X [cm]",2);
1131 Vx_ZX->setAxisTitle(
"Entries [#]",3);
1132 Vx_ZY->setAxisTitle(
"Primary Vertices Z [cm]",1);
1133 Vx_ZY->setAxisTitle(
"Primary Vertices Y [cm]",2);
1134 Vx_ZY->setAxisTitle(
"Entries [#]",3);
1135 Vx_XY->setAxisTitle(
"Primary Vertices X [cm]",1);
1136 Vx_XY->setAxisTitle(
"Primary Vertices Y [cm]",2);
1137 Vx_XY->setAxisTitle(
"Entries [#]",3);
1139 hitCounter = dbe->
book1D(
"pixelHits vs lumi",
"# Pixel-Hits vs. Lumisection", nBinsHistoricalPlot, 0.5, (
double)nBinsHistoricalPlot+0.5);
1141 hitCounter->setAxisTitle(
"Pixel-Hits [#]",2);
1142 hitCounter->getTH1()->SetOption(
"E1");
1144 hitCountHistory = dbe->
book1D(
"hist pixelHits vs lumi",
"History: # Pixel-Hits vs. Lumi", nBinsWholeHistory, 0.5, (
double)nBinsWholeHistory+0.5);
1146 hitCountHistory->setAxisTitle(
"Pixel-Hits [#]",2);
1147 hitCountHistory->getTH1()->SetOption(
"E1");
1149 goodVxCounter = dbe->
book1D(
"good vertices vs lumi",
"# Good vertices vs. Lumisection", nBinsHistoricalPlot, 0.5, (
double)nBinsHistoricalPlot+0.5);
1151 goodVxCounter->setAxisTitle(
"Good vertices [#]",2);
1152 goodVxCounter->getTH1()->SetOption(
"E1");
1154 goodVxCountHistory = dbe->
book1D(
"hist good vx vs lumi",
"History: # Good vx vs. Lumi", nBinsWholeHistory, 0.5, (
double)nBinsWholeHistory+0.5);
1156 goodVxCountHistory->setAxisTitle(
"Good vertices [#]",2);
1157 goodVxCountHistory->getTH1()->SetOption(
"E1");
1159 fitResults = dbe->
book2D(
"fit results",
"Results of Beam Spot Fit", 2, 0., 2., 9, 0., 9.);
1161 fitResults->setBinLabel(9,
"X", 2);
1162 fitResults->setBinLabel(8,
"Y", 2);
1163 fitResults->setBinLabel(7,
"Z", 2);
1164 fitResults->setBinLabel(6,
"\\sigma_{Z}", 2);
1165 fitResults->setBinLabel(5,
"#frac{dX}{dZ}[rad]", 2);
1166 fitResults->setBinLabel(4,
"#frac{dY}{dZ}[rad]", 2);
1167 fitResults->setBinLabel(3,
"\\sigma_{X}", 2);
1168 fitResults->setBinLabel(2,
"\\sigma_{Y}", 2);
1169 fitResults->setBinLabel(1,
"Vertices", 2);
1170 fitResults->setBinLabel(1,
"Value", 1);
1171 fitResults->setBinLabel(2,
"Stat. Error", 1);
1172 fitResults->getTH1()->SetOption(
"text");
1175 reportSummary = dbe->
bookFloat(
"reportSummary");
1176 reportSummary->
Fill(0.);
1177 reportSummaryMap = dbe->
book2D(
"reportSummaryMap",
"Pixel-Vertices Beam Spot: % Good Fits", 1, 0., 1., 1, 0., 1.);
1178 reportSummaryMap->
Fill(0.5, 0.5, 0.);
1188 prescaleHistory = 1;
1189 maxLumiIntegration = 15;
1193 internalDebug =
false;
1195 pi = 3.141592653589793238;
T getParameter(std::string const &) const
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
virtual char * formatTime(const time_t &t)
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
#define DEFINE_FWK_MODULE(type)
virtual int MyFit(std::vector< double > *vals)
data_type const * const_iterator
Timestamp const & beginTime() const
virtual unsigned int HitCounter(const edm::Event &iEvent)
virtual void writeToFile(std::vector< double > *vals, edm::TimeValue_t BeginTimeOfFit, edm::TimeValue_t EndTimeOfFit, unsigned int BeginLumiOfFit, unsigned int EndLumiOfFit, int dataType)
MonitorElement * bookFloat(const char *name)
Book float.
LuminosityBlockNumber_t luminosityBlock() const
bool considerVxCovariance
virtual void endLuminosityBlock(const edm::LuminosityBlock &lumiBlock, const edm::EventSetup &iSetup)
Vx3DHLTAnalyzer(const edm::ParameterSet &)
Timestamp const & endTime() const
virtual void analyze(const edm::Event &, const edm::EventSetup &)
LuminosityBlock const & getLuminosityBlock() const
virtual void reset(std::string ResetType)
unsigned long long TimeValue_t
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
double Covariance[DIM][DIM]
virtual void beginLuminosityBlock(const edm::LuminosityBlock &lumiBlock, const edm::EventSetup &iSetup)
TimeValue_t value() const
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
static char * formatTime(const time_t t)
void Gauss3DFunc(int &, double *, double &fval, double *par, int)
std::vector< std::vector< double > > tmp
std::vector< VertexType > Vertices
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void reset(double vett[256])
Power< A, B >::type pow(const A &a, const B &b)
void setCurrentFolder(const std::string &fullpath)