30 #include <TFitterMinuit.h>
56 nLumiReset = iConfig.
getParameter<
unsigned int>(
"nLumiReset");
58 minNentries = iConfig.
getParameter<
unsigned int>(
"minNentries");
91 stringstream debugFile;
94 if (outputDebugFile.is_open() ==
true) outputDebugFile.close();
95 tmp.erase(strlen(
fileName.c_str())-4,4);
96 debugFile << tmp.c_str() <<
"_Run" << iEvent.
id().
run() <<
".txt";
97 outputDebugFile.open(debugFile.str().c_str(),
ios::out);
98 outputDebugFile.close();
99 outputDebugFile.open(debugFile.str().c_str(), ios::app);
102 else if (beginTimeOfFit != 0)
104 totalHits += HitCounter(iEvent);
106 for (vector<Vertex>::const_iterator it3DVx = Vx3DCollection->begin(); it3DVx != Vx3DCollection->end(); it3DVx++) {
108 if ((it3DVx->isValid() ==
true) &&
109 (it3DVx->isFake() ==
false) &&
110 (it3DVx->ndof() >= minVxDoF) &&
111 (it3DVx->tracksSize() != 0))
113 for (i = 0; i <
DIM; i++)
115 for (j = 0; j <
DIM; j++)
125 if ((i == DIM) && (det > 0.))
127 MyVertex.
x = it3DVx->x();
128 MyVertex.
y = it3DVx->y();
129 MyVertex.
z = it3DVx->z();
132 else if (internalDebug ==
true)
134 cout <<
"Vertex discarded !" << endl;
135 for (i = 0; i <
DIM; i++)
136 for (j = 0; j <
DIM; j++)
137 cout <<
"(i,j) --> " << i <<
"," << j <<
" --> " << MyVertex.
Covariance[i][j] << endl;
140 Vx_X->Fill(it3DVx->x());
141 Vx_Y->Fill(it3DVx->y());
142 Vx_Z->Fill(it3DVx->z());
144 Vx_ZX->Fill(it3DVx->z(), it3DVx->x());
145 Vx_ZY->Fill(it3DVx->z(), it3DVx->y());
146 Vx_XY->Fill(it3DVx->x(), it3DVx->y());
156 iEvent.
getByLabel(
"siPixelRecHits",rechitspixel);
170 strftime(ts,
sizeof(ts),
"%Y.%m.%d %H:%M:%S %Z", gmtime(&t));
205 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];
206 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];
210 K[0][0] = std::fabs(par[0]);
211 K[1][1] = std::fabs(par[1]);
212 K[2][2] = std::fabs(par[2]);
213 K[0][1] = K[1][0] = par[3];
214 K[1][2] = K[2][1] = par[4]*(std::fabs(par[2])-std::fabs(par[1])) - par[5]*par[3];
215 K[0][2] = K[2][0] = par[5]*(std::fabs(par[2])-std::fabs(par[0])) - par[4]*par[3];
218 det = K[0][0]*(K[1][1]*K[2][2] - K[1][2]*K[1][2]) -
219 K[0][1]*(K[0][1]*K[2][2] - K[0][2]*K[1][2]) +
220 K[0][2]*(K[0][1]*K[1][2] - K[0][2]*K[1][1]);
222 M[0][0] = (K[1][1]*K[2][2] - K[1][2]*K[1][2]) / det;
223 M[1][1] = (K[0][0]*K[2][2] - K[0][2]*K[0][2]) / det;
224 M[2][2] = (K[0][0]*K[1][1] - K[0][1]*K[0][1]) / det;
225 M[0][1] = M[1][0] = (K[0][2]*K[1][2] - K[0][1]*K[2][2]) / det;
226 M[1][2] = M[2][1] = (K[0][2]*K[0][1] - K[1][2]*K[0][0]) / det;
227 M[0][2] = M[2][0] = (K[0][1]*K[1][2] - K[0][2]*K[1][1]) / det;
251 unsigned int nParams = 9;
253 if ((vals !=
NULL) && (vals->size() == nParams*2))
255 double nSigmaXY = 100.;
257 double varFactor = 4./25.;
258 double parDistanceXY = 0.005;
259 double parDistanceZ = 0.5;
260 double parDistanceddZ = 1
e-3;
261 double parDistanceCxy = 1
e-5;
262 double bestEdm = 1
e-1;
264 const unsigned int trials = 4;
265 double largerDist[trials] = {0.1, 5., 10., 100.};
267 double covxz,covyz,det;
269 int bestMovementX = 1;
270 int bestMovementY = 1;
271 int bestMovementZ = 1;
275 double amin,errdef,edm;
278 vector<double>::const_iterator it = vals->begin();
280 TFitterMinuit* Gauss3D =
new TFitterMinuit(nParams);
281 if (internalDebug ==
true) Gauss3D->SetPrintLevel(3);
282 else Gauss3D->SetPrintLevel(0);
287 if (internalDebug ==
true)
cout <<
"\n@@@ START FITTING @@@" << endl;
291 for (
int i = 0;
i < 3;
i++)
293 deltaMean = (double(
i)-1.)*
std::sqrt((*(it+0))*varFactor);
294 if (internalDebug ==
true)
cout <<
"deltaMean --> " << deltaMean << endl;
300 Gauss3D->SetParameter(0,
"var x ", *(it+0)*varFactor, parDistanceXY*parDistanceXY, 0., 0.);
301 Gauss3D->SetParameter(1,
"var y ", *(it+1)*varFactor, parDistanceXY*parDistanceXY, 0., 0.);
302 Gauss3D->SetParameter(2,
"var z ", *(it+2), parDistanceZ*parDistanceZ, 0., 0.);
303 Gauss3D->SetParameter(3,
"cov xy", *(it+3), parDistanceCxy, 0., 0.);
304 Gauss3D->SetParameter(4,
"dydz ", *(it+4), parDistanceddZ, 0., 0.);
305 Gauss3D->SetParameter(5,
"dxdz ", *(it+5), parDistanceddZ, 0., 0.);
306 Gauss3D->SetParameter(6,
"mean x", *(it+6)+deltaMean, parDistanceXY, 0., 0.);
307 Gauss3D->SetParameter(7,
"mean y", *(it+7), parDistanceXY, 0., 0.);
308 Gauss3D->SetParameter(8,
"mean z", *(it+8), parDistanceZ, 0., 0.);
311 xPos = Gauss3D->GetParameter(6);
312 yPos = Gauss3D->GetParameter(7);
313 zPos = Gauss3D->GetParameter(8);
316 maxTransRadius = nSigmaXY *
std::sqrt(std::fabs(Gauss3D->GetParameter(0)) + std::fabs(Gauss3D->GetParameter(1))) / 2.;
319 goodData = Gauss3D->ExecuteCommand(
"MIGRAD",arglist,2);
320 Gauss3D->GetStats(amin, edm, errdef, nvpar, nparx);
322 if (
counterVx < minNentries) goodData = -2;
323 else if (
std::isnan(edm) ==
true) goodData = -1;
324 else for (
unsigned int j = 0;
j < nParams;
j++)
if (
std::isnan(Gauss3D->GetParError(
j)) ==
true) { goodData = -1;
break; }
327 covyz = Gauss3D->GetParameter(4)*(std::fabs(Gauss3D->GetParameter(2))-std::fabs(Gauss3D->GetParameter(1))) - Gauss3D->GetParameter(5)*Gauss3D->GetParameter(3);
328 covxz = Gauss3D->GetParameter(5)*(std::fabs(Gauss3D->GetParameter(2))-std::fabs(Gauss3D->GetParameter(0))) - Gauss3D->GetParameter(4)*Gauss3D->GetParameter(3);
330 det = std::fabs(Gauss3D->GetParameter(0)) * (std::fabs(Gauss3D->GetParameter(1))*std::fabs(Gauss3D->GetParameter(2)) - covyz*covyz) -
331 Gauss3D->GetParameter(3) * (Gauss3D->GetParameter(3)*std::fabs(Gauss3D->GetParameter(2)) - covxz*covyz) +
332 covxz * (Gauss3D->GetParameter(3)*covyz - covxz*std::fabs(Gauss3D->GetParameter(1)));
333 if (det < 0.) { goodData = -1;
if (internalDebug ==
true)
cout <<
"Negative determinant !" << endl; }
336 if ((goodData == 0) && (std::fabs(edm) < bestEdm)) { bestEdm = edm; bestMovementX =
i; }
338 if (internalDebug ==
true)
cout <<
"Found bestMovementX --> " << bestMovementX << endl;
342 for (
int i = 0;
i < 3;
i++)
344 deltaMean = (double(
i)-1.)*
std::sqrt((*(it+1))*varFactor);
345 if (internalDebug ==
true)
347 cout <<
"deltaMean --> " << deltaMean << endl;
348 cout <<
"deltaMean X --> " << (double(bestMovementX)-1.)*
std::sqrt((*(it+0))*varFactor) << endl;
355 Gauss3D->SetParameter(0,
"var x ", *(it+0)*varFactor, parDistanceXY*parDistanceXY, 0., 0.);
356 Gauss3D->SetParameter(1,
"var y ", *(it+1)*varFactor, parDistanceXY*parDistanceXY, 0., 0.);
357 Gauss3D->SetParameter(2,
"var z ", *(it+2), parDistanceZ*parDistanceZ, 0., 0.);
358 Gauss3D->SetParameter(3,
"cov xy", *(it+3), parDistanceCxy, 0., 0.);
359 Gauss3D->SetParameter(4,
"dydz ", *(it+4), parDistanceddZ, 0., 0.);
360 Gauss3D->SetParameter(5,
"dxdz ", *(it+5), parDistanceddZ, 0., 0.);
361 Gauss3D->SetParameter(6,
"mean x", *(it+6)+(
double(bestMovementX)-1.)*
std::sqrt((*(it+0))*varFactor), parDistanceXY, 0., 0.);
362 Gauss3D->SetParameter(7,
"mean y", *(it+7)+deltaMean, parDistanceXY, 0., 0.);
363 Gauss3D->SetParameter(8,
"mean z", *(it+8), parDistanceZ, 0., 0.);
366 xPos = Gauss3D->GetParameter(6);
367 yPos = Gauss3D->GetParameter(7);
368 zPos = Gauss3D->GetParameter(8);
371 maxTransRadius = nSigmaXY *
std::sqrt(std::fabs(Gauss3D->GetParameter(0)) + std::fabs(Gauss3D->GetParameter(1))) / 2.;
374 goodData = Gauss3D->ExecuteCommand(
"MIGRAD",arglist,2);
375 Gauss3D->GetStats(amin, edm, errdef, nvpar, nparx);
377 if (
counterVx < minNentries) goodData = -2;
378 else if (
std::isnan(edm) ==
true) goodData = -1;
379 else for (
unsigned int j = 0;
j < nParams;
j++)
if (
std::isnan(Gauss3D->GetParError(
j)) ==
true) { goodData = -1;
break; }
382 covyz = Gauss3D->GetParameter(4)*(std::fabs(Gauss3D->GetParameter(2))-std::fabs(Gauss3D->GetParameter(1))) - Gauss3D->GetParameter(5)*Gauss3D->GetParameter(3);
383 covxz = Gauss3D->GetParameter(5)*(std::fabs(Gauss3D->GetParameter(2))-std::fabs(Gauss3D->GetParameter(0))) - Gauss3D->GetParameter(4)*Gauss3D->GetParameter(3);
385 det = std::fabs(Gauss3D->GetParameter(0)) * (std::fabs(Gauss3D->GetParameter(1))*std::fabs(Gauss3D->GetParameter(2)) - covyz*covyz) -
386 Gauss3D->GetParameter(3) * (Gauss3D->GetParameter(3)*std::fabs(Gauss3D->GetParameter(2)) - covxz*covyz) +
387 covxz * (Gauss3D->GetParameter(3)*covyz - covxz*std::fabs(Gauss3D->GetParameter(1)));
388 if (det < 0.) { goodData = -1;
if (internalDebug ==
true)
cout <<
"Negative determinant !" << endl; }
391 if ((goodData == 0) && (std::fabs(edm) < bestEdm)) { bestEdm = edm; bestMovementY =
i; }
393 if (internalDebug ==
true)
cout <<
"Found bestMovementY --> " << bestMovementY << endl;
397 for (
int i = 0;
i < 3;
i++)
399 deltaMean = (double(
i)-1.)*
std::sqrt(*(it+2));
400 if (internalDebug ==
true)
402 cout <<
"deltaMean --> " << deltaMean << endl;
403 cout <<
"deltaMean X --> " << (double(bestMovementX)-1.)*
std::sqrt((*(it+0))*varFactor) << endl;
404 cout <<
"deltaMean Y --> " << (double(bestMovementY)-1.)*
std::sqrt((*(it+1))*varFactor) << endl;
411 Gauss3D->SetParameter(0,
"var x ", *(it+0)*varFactor, parDistanceXY*parDistanceXY, 0., 0.);
412 Gauss3D->SetParameter(1,
"var y ", *(it+1)*varFactor, parDistanceXY*parDistanceXY, 0., 0.);
413 Gauss3D->SetParameter(2,
"var z ", *(it+2), parDistanceZ*parDistanceZ, 0., 0.);
414 Gauss3D->SetParameter(3,
"cov xy", *(it+3), parDistanceCxy, 0., 0.);
415 Gauss3D->SetParameter(4,
"dydz ", *(it+4), parDistanceddZ, 0., 0.);
416 Gauss3D->SetParameter(5,
"dxdz ", *(it+5), parDistanceddZ, 0., 0.);
417 Gauss3D->SetParameter(6,
"mean x", *(it+6)+(
double(bestMovementX)-1.)*
std::sqrt((*(it+0))*varFactor), parDistanceXY, 0., 0.);
418 Gauss3D->SetParameter(7,
"mean y", *(it+7)+(
double(bestMovementY)-1.)*
std::sqrt((*(it+1))*varFactor), parDistanceXY, 0., 0.);
419 Gauss3D->SetParameter(8,
"mean z", *(it+8)+deltaMean, parDistanceZ, 0., 0.);
422 xPos = Gauss3D->GetParameter(6);
423 yPos = Gauss3D->GetParameter(7);
424 zPos = Gauss3D->GetParameter(8);
427 maxTransRadius = nSigmaXY *
std::sqrt(std::fabs(Gauss3D->GetParameter(0)) + std::fabs(Gauss3D->GetParameter(1))) / 2.;
430 goodData = Gauss3D->ExecuteCommand(
"MIGRAD",arglist,2);
431 Gauss3D->GetStats(amin, edm, errdef, nvpar, nparx);
433 if (
counterVx < minNentries) goodData = -2;
434 else if (
std::isnan(edm) ==
true) goodData = -1;
435 else for (
unsigned int j = 0;
j < nParams;
j++)
if (
std::isnan(Gauss3D->GetParError(
j)) ==
true) { goodData = -1;
break; }
438 covyz = Gauss3D->GetParameter(4)*(std::fabs(Gauss3D->GetParameter(2))-std::fabs(Gauss3D->GetParameter(1))) - Gauss3D->GetParameter(5)*Gauss3D->GetParameter(3);
439 covxz = Gauss3D->GetParameter(5)*(std::fabs(Gauss3D->GetParameter(2))-std::fabs(Gauss3D->GetParameter(0))) - Gauss3D->GetParameter(4)*Gauss3D->GetParameter(3);
441 det = std::fabs(Gauss3D->GetParameter(0)) * (std::fabs(Gauss3D->GetParameter(1))*std::fabs(Gauss3D->GetParameter(2)) - covyz*covyz) -
442 Gauss3D->GetParameter(3) * (Gauss3D->GetParameter(3)*std::fabs(Gauss3D->GetParameter(2)) - covxz*covyz) +
443 covxz * (Gauss3D->GetParameter(3)*covyz - covxz*std::fabs(Gauss3D->GetParameter(1)));
444 if (det < 0.) { goodData = -1;
if (internalDebug ==
true)
cout <<
"Negative determinant !" << endl; }
447 if ((goodData == 0) && (std::fabs(edm) < bestEdm)) { bestEdm = edm; bestMovementZ =
i; }
449 if (internalDebug ==
true)
cout <<
"Found bestMovementZ --> " << bestMovementZ << endl;
456 Gauss3D->SetParameter(0,
"var x ", *(it+0)*varFactor, parDistanceXY*parDistanceXY, 0., 0.);
457 Gauss3D->SetParameter(1,
"var y ", *(it+1)*varFactor, parDistanceXY*parDistanceXY, 0., 0.);
458 Gauss3D->SetParameter(2,
"var z ", *(it+2), parDistanceZ*parDistanceZ, 0., 0.);
459 Gauss3D->SetParameter(3,
"cov xy", *(it+3), parDistanceCxy, 0., 0.);
460 Gauss3D->SetParameter(4,
"dydz ", *(it+4), parDistanceddZ, 0., 0.);
461 Gauss3D->SetParameter(5,
"dxdz ", *(it+5), parDistanceddZ, 0., 0.);
462 Gauss3D->SetParameter(6,
"mean x", *(it+6)+(
double(bestMovementX)-1.)*
std::sqrt((*(it+0))*varFactor), parDistanceXY, 0., 0.);
463 Gauss3D->SetParameter(7,
"mean y", *(it+7)+(
double(bestMovementY)-1.)*
std::sqrt((*(it+1))*varFactor), parDistanceXY, 0., 0.);
464 Gauss3D->SetParameter(8,
"mean z", *(it+8)+(
double(bestMovementZ)-1.)*
std::sqrt(*(it+2)), parDistanceZ, 0., 0.);
467 xPos = Gauss3D->GetParameter(6);
468 yPos = Gauss3D->GetParameter(7);
469 zPos = Gauss3D->GetParameter(8);
472 maxTransRadius = nSigmaXY *
std::sqrt(std::fabs(Gauss3D->GetParameter(0)) + std::fabs(Gauss3D->GetParameter(1))) / 2.;
475 goodData = Gauss3D->ExecuteCommand(
"MIGRAD",arglist,2);
476 Gauss3D->GetStats(amin, edm, errdef, nvpar, nparx);
478 if (
counterVx < minNentries) goodData = -2;
479 else if (
std::isnan(edm) ==
true) goodData = -1;
480 else for (
unsigned int j = 0;
j < nParams;
j++)
if (
std::isnan(Gauss3D->GetParError(
j)) ==
true) { goodData = -1;
break; }
483 covyz = Gauss3D->GetParameter(4)*(std::fabs(Gauss3D->GetParameter(2))-std::fabs(Gauss3D->GetParameter(1))) - Gauss3D->GetParameter(5)*Gauss3D->GetParameter(3);
484 covxz = Gauss3D->GetParameter(5)*(std::fabs(Gauss3D->GetParameter(2))-std::fabs(Gauss3D->GetParameter(0))) - Gauss3D->GetParameter(4)*Gauss3D->GetParameter(3);
486 det = std::fabs(Gauss3D->GetParameter(0)) * (std::fabs(Gauss3D->GetParameter(1))*std::fabs(Gauss3D->GetParameter(2)) - covyz*covyz) -
487 Gauss3D->GetParameter(3) * (Gauss3D->GetParameter(3)*std::fabs(Gauss3D->GetParameter(2)) - covxz*covyz) +
488 covxz * (Gauss3D->GetParameter(3)*covyz - covxz*std::fabs(Gauss3D->GetParameter(1)));
489 if (det < 0.) { goodData = -1;
if (internalDebug ==
true)
cout <<
"Negative determinant !" << endl; }
495 for (
unsigned int i = 0;
i < trials;
i++)
497 if ((goodData != 0) && (goodData != -2))
501 if (internalDebug ==
true)
cout <<
"FIT WITH DIFFERENT PARAMETER DISTANCES - STEP " <<
i+1 << endl;
503 Gauss3D->SetParameter(0,
"var x ", *(it+0)*varFactor, parDistanceXY*parDistanceXY * largerDist[
i], 0, 0);
504 Gauss3D->SetParameter(1,
"var y ", *(it+1)*varFactor, parDistanceXY*parDistanceXY * largerDist[i], 0, 0);
505 Gauss3D->SetParameter(2,
"var z ", *(it+2), parDistanceZ*parDistanceZ * largerDist[i], 0, 0);
506 Gauss3D->SetParameter(3,
"cov xy", *(it+3), parDistanceCxy * largerDist[i], 0, 0);
507 Gauss3D->SetParameter(4,
"dydz ", *(it+4), parDistanceddZ * largerDist[i], 0, 0);
508 Gauss3D->SetParameter(5,
"dxdz ", *(it+5), parDistanceddZ * largerDist[i], 0, 0);
509 Gauss3D->SetParameter(6,
"mean x", *(it+6)+(
double(bestMovementX)-1.)*std::sqrt((*(it+0))*varFactor), parDistanceXY * largerDist[i], 0, 0);
510 Gauss3D->SetParameter(7,
"mean y", *(it+7)+(
double(bestMovementY)-1.)*std::sqrt((*(it+1))*varFactor), parDistanceXY * largerDist[i], 0, 0);
511 Gauss3D->SetParameter(8,
"mean z", *(it+8)+(
double(bestMovementZ)-1.)*std::sqrt(*(it+2)), parDistanceZ * largerDist[i], 0, 0);
514 xPos = Gauss3D->GetParameter(6);
515 yPos = Gauss3D->GetParameter(7);
516 zPos = Gauss3D->GetParameter(8);
519 maxTransRadius = nSigmaXY *
std::sqrt(std::fabs(Gauss3D->GetParameter(0)) + std::fabs(Gauss3D->GetParameter(1))) / 2.;
522 goodData = Gauss3D->ExecuteCommand(
"MIGRAD",arglist,2);
523 Gauss3D->GetStats(amin, edm, errdef, nvpar, nparx);
525 if (
counterVx < minNentries) goodData = -2;
526 else if (
std::isnan(edm) ==
true) goodData = -1;
527 else for (
unsigned int j = 0;
j < nParams;
j++)
if (
std::isnan(Gauss3D->GetParError(
j)) ==
true) { goodData = -1;
break; }
530 covyz = Gauss3D->GetParameter(4)*(std::fabs(Gauss3D->GetParameter(2))-std::fabs(Gauss3D->GetParameter(1))) - Gauss3D->GetParameter(5)*Gauss3D->GetParameter(3);
531 covxz = Gauss3D->GetParameter(5)*(std::fabs(Gauss3D->GetParameter(2))-std::fabs(Gauss3D->GetParameter(0))) - Gauss3D->GetParameter(4)*Gauss3D->GetParameter(3);
533 det = std::fabs(Gauss3D->GetParameter(0)) * (std::fabs(Gauss3D->GetParameter(1))*std::fabs(Gauss3D->GetParameter(2)) - covyz*covyz) -
534 Gauss3D->GetParameter(3) * (Gauss3D->GetParameter(3)*std::fabs(Gauss3D->GetParameter(2)) - covxz*covyz) +
535 covxz * (Gauss3D->GetParameter(3)*covyz - covxz*std::fabs(Gauss3D->GetParameter(1)));
536 if (det < 0.) { goodData = -1;
if (internalDebug ==
true)
cout <<
"Negative determinant !" << endl; }
542 for (
unsigned int i = 0;
i < nParams;
i++)
544 vals->operator[](
i) = Gauss3D->GetParameter(
i);
545 vals->operator[](
i+nParams) = Gauss3D->GetParError(
i);
558 if (ResetType.compare(
"scratch") == 0)
585 hitCountHistory->Reset();
586 goodVxCounter->Reset();
587 goodVxCountHistory->Reset();
590 reportSummary->Fill(0.);
591 reportSummaryMap->Fill(0.5, 0.5, 0.);
596 lumiCounterHisto = 0;
603 else if (ResetType.compare(
"whole") == 0)
616 lumiCounterHisto = 0;
623 else if (ResetType.compare(
"partial") == 0)
638 else if (ResetType.compare(
"nohisto") == 0)
643 lumiCounterHisto = 0;
650 else if (ResetType.compare(
"hitCounter") == 0)
658 unsigned int BeginLumiOfFit,
659 unsigned int EndLumiOfFit,
662 stringstream BufferString;
663 BufferString.precision(5);
667 if ((
outputFile.is_open() ==
true) && (vals !=
NULL) && (vals->size() == 8*2))
669 vector<double>::const_iterator it = vals->begin();
672 outputFile <<
"BeginTimeOfFit " <<
formatTime(beginTimeOfFit >> 32) <<
" " << (beginTimeOfFit >> 32) << endl;
673 outputFile <<
"EndTimeOfFit " <<
formatTime(endTimeOfFit >> 32) <<
" " << (endTimeOfFit >> 32) << endl;
674 outputFile <<
"LumiRange " << beginLumiOfFit <<
" - " << endLumiOfFit << endl;
680 BufferString << *(it+0);
681 outputFile <<
"X0 " << BufferString.str().c_str() << endl;
682 BufferString.str(
"");
684 BufferString << *(it+1);
685 outputFile <<
"Y0 " << BufferString.str().c_str() << endl;
686 BufferString.str(
"");
688 BufferString << *(it+2);
689 outputFile <<
"Z0 " << BufferString.str().c_str() << endl;
690 BufferString.str(
"");
692 BufferString << *(it+3);
693 outputFile <<
"sigmaZ0 " << BufferString.str().c_str() << endl;
694 BufferString.str(
"");
696 BufferString << *(it+4);
697 outputFile <<
"dxdz " << BufferString.str().c_str() << endl;
698 BufferString.str(
"");
700 BufferString << *(it+5);
701 outputFile <<
"dydz " << BufferString.str().c_str() << endl;
702 BufferString.str(
"");
704 BufferString << *(it+6);
705 outputFile <<
"BeamWidthX " << BufferString.str().c_str() << endl;
706 BufferString.str(
"");
708 BufferString << *(it+7);
709 outputFile <<
"BeamWidthY " << BufferString.str().c_str() << endl;
710 BufferString.str(
"");
712 outputFile <<
"Cov(0,j) " << *(it+8) <<
" 0.0 0.0 0.0 0.0 0.0 0.0" << endl;
713 outputFile <<
"Cov(1,j) 0.0 " << *(it+9) <<
" 0.0 0.0 0.0 0.0 0.0" << endl;
714 outputFile <<
"Cov(2,j) 0.0 0.0 " << *(it+10) <<
" 0.0 0.0 0.0 0.0" << endl;
715 outputFile <<
"Cov(3,j) 0.0 0.0 0.0 " << *(it+11) <<
" 0.0 0.0 0.0" << endl;
716 outputFile <<
"Cov(4,j) 0.0 0.0 0.0 0.0 " << *(it+12) <<
" 0.0 0.0" << endl;
717 outputFile <<
"Cov(5,j) 0.0 0.0 0.0 0.0 0.0 " << *(it+13) <<
" 0.0" << endl;
718 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;
726 if ((
debugMode ==
true) && (outputDebugFile.is_open() ==
true) && (vals !=
NULL) && (vals->size() == 8*2))
728 vector<double>::const_iterator it = vals->begin();
730 outputDebugFile <<
"Runnumber " <<
runNumber << endl;
731 outputDebugFile <<
"BeginTimeOfFit " <<
formatTime(beginTimeOfFit >> 32) <<
" " << (beginTimeOfFit >> 32) << endl;
732 outputDebugFile <<
"EndTimeOfFit " <<
formatTime(endTimeOfFit >> 32) <<
" " << (endTimeOfFit >> 32) << endl;
733 outputDebugFile <<
"LumiRange " << beginLumiOfFit <<
" - " << endLumiOfFit << endl;
734 outputDebugFile <<
"Type " << dataType << endl;
739 BufferString << *(it+0);
740 outputDebugFile <<
"X0 " << BufferString.str().c_str() << endl;
741 BufferString.str(
"");
743 BufferString << *(it+1);
744 outputDebugFile <<
"Y0 " << BufferString.str().c_str() << endl;
745 BufferString.str(
"");
747 BufferString << *(it+2);
748 outputDebugFile <<
"Z0 " << BufferString.str().c_str() << endl;
749 BufferString.str(
"");
751 BufferString << *(it+3);
752 outputDebugFile <<
"sigmaZ0 " << BufferString.str().c_str() << endl;
753 BufferString.str(
"");
755 BufferString << *(it+4);
756 outputDebugFile <<
"dxdz " << BufferString.str().c_str() << endl;
757 BufferString.str(
"");
759 BufferString << *(it+5);
760 outputDebugFile <<
"dydz " << BufferString.str().c_str() << endl;
761 BufferString.str(
"");
763 BufferString << *(it+6);
764 outputDebugFile <<
"BeamWidthX " << BufferString.str().c_str() << endl;
765 BufferString.str(
"");
767 BufferString << *(it+7);
768 outputDebugFile <<
"BeamWidthY " << BufferString.str().c_str() << endl;
769 BufferString.str(
"");
771 outputDebugFile <<
"Cov(0,j) " << *(it+8) <<
" 0.0 0.0 0.0 0.0 0.0 0.0" << endl;
772 outputDebugFile <<
"Cov(1,j) 0.0 " << *(it+9) <<
" 0.0 0.0 0.0 0.0 0.0" << endl;
773 outputDebugFile <<
"Cov(2,j) 0.0 0.0 " << *(it+10) <<
" 0.0 0.0 0.0 0.0" << endl;
774 outputDebugFile <<
"Cov(3,j) 0.0 0.0 0.0 " << *(it+11) <<
" 0.0 0.0 0.0" << endl;
775 outputDebugFile <<
"Cov(4,j) 0.0 0.0 0.0 0.0 " << *(it+12) <<
" 0.0 0.0" << endl;
776 outputDebugFile <<
"Cov(5,j) 0.0 0.0 0.0 0.0 0.0 " << *(it+13) <<
" 0.0" << endl;
777 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;
779 outputDebugFile <<
"EmittanceX 0.0" << endl;
780 outputDebugFile <<
"EmittanceY 0.0" << endl;
781 outputDebugFile <<
"BetaStar 0.0" << endl;
789 if ((lumiCounter == 0) && (lumiBlock.
luminosityBlock() > lastLumiOfFit))
796 else if ((lumiCounter != 0) && (lumiBlock.
luminosityBlock() >= (beginLumiOfFit+lumiCounter))) { lumiCounter++; lumiCounterHisto++; }
803 stringstream histTitle;
805 unsigned int nParams = 9;
807 if ((lumiCounter%nLumiReset == 0) && (nLumiReset != 0) && (beginTimeOfFit != 0) && (
runNumber != 0))
811 lastLumiOfFit = endLumiOfFit;
814 hitCounter->ShiftFillLast((
double)totalHits,
std::sqrt((
double)totalHits), nLumiReset);
816 if (lastLumiOfFit % prescaleHistory == 0)
818 hitCountHistory->getTH1()->SetBinContent(lastLumiOfFit, (
double)totalHits);
819 hitCountHistory->getTH1()->SetBinError(lastLumiOfFit,
std::sqrt((
double)totalHits));
822 if (dataFromFit ==
true)
824 vector<double> fitResults;
826 fitResults.push_back(Vx_X->getTH1()->GetRMS()*Vx_X->getTH1()->GetRMS());
827 fitResults.push_back(Vx_Y->getTH1()->GetRMS()*Vx_Y->getTH1()->GetRMS());
828 fitResults.push_back(Vx_Z->getTH1()->GetRMS()*Vx_Z->getTH1()->GetRMS());
829 fitResults.push_back(0.0);
830 fitResults.push_back(0.0);
831 fitResults.push_back(0.0);
832 fitResults.push_back(Vx_X->getTH1()->GetMean());
833 fitResults.push_back(Vx_Y->getTH1()->GetMean());
834 fitResults.push_back(Vx_Z->getTH1()->GetMean());
835 for (
unsigned int i = 0;
i < nParams;
i++) fitResults.push_back(0.0);
837 goodData = MyFit(&fitResults);
839 if (internalDebug ==
true)
841 cout <<
"goodData --> " << goodData << endl;
843 cout <<
"var x --> " << fitResults[0] <<
" +/- " << fitResults[0+nParams] << endl;
844 cout <<
"var y --> " << fitResults[1] <<
" +/- " << fitResults[1+nParams] << endl;
845 cout <<
"var z --> " << fitResults[2] <<
" +/- " << fitResults[2+nParams] << endl;
846 cout <<
"cov xy --> " << fitResults[3] <<
" +/- " << fitResults[3+nParams] << endl;
847 cout <<
"dydz --> " << fitResults[4] <<
" +/- " << fitResults[4+nParams] << endl;
848 cout <<
"dxdz --> " << fitResults[5] <<
" +/- " << fitResults[5+nParams] << endl;
849 cout <<
"mean x --> " << fitResults[6] <<
" +/- " << fitResults[6+nParams] << endl;
850 cout <<
"mean y --> " << fitResults[7] <<
" +/- " << fitResults[7+nParams] << endl;
851 cout <<
"mean z --> " << fitResults[8] <<
" +/- " << fitResults[8+nParams] << endl;
856 vals.push_back(fitResults[6]);
857 vals.push_back(fitResults[7]);
858 vals.push_back(fitResults[8]);
859 vals.push_back(
std::sqrt(std::fabs(fitResults[2])));
860 vals.push_back(fitResults[5]);
861 vals.push_back(fitResults[4]);
862 vals.push_back(
std::sqrt(std::fabs(fitResults[0])));
863 vals.push_back(
std::sqrt(std::fabs(fitResults[1])));
865 vals.push_back(powf(fitResults[6+nParams],2.));
866 vals.push_back(powf(fitResults[7+nParams],2.));
867 vals.push_back(powf(fitResults[8+nParams],2.));
868 vals.push_back(powf(std::fabs(fitResults[2+nParams]) / (2.*
std::sqrt(std::fabs(fitResults[2]))),2.));
869 vals.push_back(powf(fitResults[5+nParams],2.));
870 vals.push_back(powf(fitResults[4+nParams],2.));
871 vals.push_back(powf(std::fabs(fitResults[0+nParams]) / (2.*
std::sqrt(std::fabs(fitResults[0]))),2.));
872 vals.push_back(powf(std::fabs(fitResults[1+nParams]) / (2.*
std::sqrt(std::fabs(fitResults[1]))),2.));
874 else for (
unsigned int i = 0;
i < 8*2;
i++) vals.push_back(0.0);
880 counterVx = Vx_X->getTH1F()->GetEntries();
882 if (Vx_X->getTH1F()->GetEntries() >= minNentries)
886 vals.push_back(Vx_X->getTH1F()->GetMean());
887 vals.push_back(Vx_Y->getTH1F()->GetMean());
888 vals.push_back(Vx_Z->getTH1F()->GetMean());
889 vals.push_back(Vx_Z->getTH1F()->GetRMS());
892 vals.push_back(Vx_X->getTH1F()->GetRMS());
893 vals.push_back(Vx_Y->getTH1F()->GetRMS());
895 vals.push_back(powf(Vx_X->getTH1F()->GetMeanError(),2.));
896 vals.push_back(powf(Vx_Y->getTH1F()->GetMeanError(),2.));
897 vals.push_back(powf(Vx_Z->getTH1F()->GetMeanError(),2.));
898 vals.push_back(powf(Vx_Z->getTH1F()->GetRMSError(),2.));
901 vals.push_back(powf(Vx_X->getTH1F()->GetRMSError(),2.));
902 vals.push_back(powf(Vx_Y->getTH1F()->GetRMSError(),2.));
907 for (
unsigned int i = 0;
i < 8*2;
i++) vals.push_back(0.0);
937 writeToFile(&vals, beginTimeOfFit, endTimeOfFit, beginLumiOfFit, endLumiOfFit, 3);
938 if ((internalDebug ==
true) && (outputDebugFile.is_open() ==
true)) outputDebugFile <<
"Used vertices: " <<
counterVx << endl;
942 histTitle <<
"Fitted Beam Spot [cm] (Lumi start: " << beginLumiOfFit <<
" - Lumi end: " << endLumiOfFit <<
")";
943 if (lumiCounterHisto >= maxLumiIntegration)
reset(
"whole");
944 else reset(
"partial");
948 writeToFile(&vals, beginTimeOfFit, endTimeOfFit, beginLumiOfFit, endLumiOfFit, -1);
949 if ((internalDebug ==
true) && (outputDebugFile.is_open() ==
true)) outputDebugFile <<
"Used vertices: " <<
counterVx << endl;
953 histTitle <<
"Fitted Beam Spot [cm] (not enough statistics)";
954 if (lumiCounter >= maxLumiIntegration)
reset(
"whole");
955 else reset(
"hitCounter");
959 histTitle <<
"Fitted Beam Spot [cm] (problems)";
960 if (lumiCounterHisto >= maxLumiIntegration)
reset(
"whole");
961 else reset(
"partial");
967 reportSummary->Fill(numberFits != 0 ? (
double)numberGoodFits/(
double)numberFits : 0.0);
968 reportSummaryMap->Fill(0.5, 0.5, numberFits != 0 ? (
double)numberGoodFits/(
double)numberFits : 0.0);
970 fitResults->setAxisTitle(histTitle.str().c_str(), 1);
972 fitResults->setBinContent(1, 9, vals[0]);
973 fitResults->setBinContent(1, 8, vals[1]);
974 fitResults->setBinContent(1, 7, vals[2]);
975 fitResults->setBinContent(1, 6, vals[3]);
976 fitResults->setBinContent(1, 5, vals[4]);
977 fitResults->setBinContent(1, 4, vals[5]);
978 fitResults->setBinContent(1, 3, vals[6]);
979 fitResults->setBinContent(1, 2, vals[7]);
980 fitResults->setBinContent(1, 1,
counterVx);
982 fitResults->setBinContent(2, 9,
std::sqrt(vals[8]));
983 fitResults->setBinContent(2, 8,
std::sqrt(vals[9]));
984 fitResults->setBinContent(2, 7,
std::sqrt(vals[10]));
985 fitResults->setBinContent(2, 6,
std::sqrt(vals[11]));
986 fitResults->setBinContent(2, 5,
std::sqrt(vals[12]));
987 fitResults->setBinContent(2, 4,
std::sqrt(vals[13]));
988 fitResults->setBinContent(2, 3,
std::sqrt(vals[14]));
989 fitResults->setBinContent(2, 2,
std::sqrt(vals[15]));
993 TF1* myLinFit =
new TF1(
"myLinFit",
"[0] + [1]*x", mXlumi->getTH1()->GetXaxis()->GetXmin(), mXlumi->getTH1()->GetXaxis()->GetXmax());
994 myLinFit->SetLineColor(2);
995 myLinFit->SetLineWidth(2);
996 myLinFit->SetParName(0,
"Intercept");
997 myLinFit->SetParName(1,
"Slope");
999 mXlumi->ShiftFillLast(vals[0],
std::sqrt(vals[8]), nLumiReset);
1000 myLinFit->SetParameter(0, mXlumi->getTH1()->GetMean(2));
1001 myLinFit->SetParameter(1, 0.0);
1002 mXlumi->getTH1()->Fit(
"myLinFit",
"QR");
1004 mYlumi->ShiftFillLast(vals[1],
std::sqrt(vals[9]), nLumiReset);
1005 myLinFit->SetParameter(0, mYlumi->getTH1()->GetMean(2));
1006 myLinFit->SetParameter(1, 0.0);
1007 mYlumi->getTH1()->Fit(
"myLinFit",
"QR");
1009 mZlumi->ShiftFillLast(vals[2],
std::sqrt(vals[10]), nLumiReset);
1010 myLinFit->SetParameter(0, mZlumi->getTH1()->GetMean(2));
1011 myLinFit->SetParameter(1, 0.0);
1012 mZlumi->getTH1()->Fit(
"myLinFit",
"QR");
1014 sXlumi->ShiftFillLast(vals[6],
std::sqrt(vals[14]), nLumiReset);
1015 myLinFit->SetParameter(0, sXlumi->getTH1()->GetMean(2));
1016 myLinFit->SetParameter(1, 0.0);
1017 sXlumi->getTH1()->Fit(
"myLinFit",
"QR");
1019 sYlumi->ShiftFillLast(vals[7],
std::sqrt(vals[15]), nLumiReset);
1020 myLinFit->SetParameter(0, sYlumi->getTH1()->GetMean(2));
1021 myLinFit->SetParameter(1, 0.0);
1022 sYlumi->getTH1()->Fit(
"myLinFit",
"QR");
1024 sZlumi->ShiftFillLast(vals[3],
std::sqrt(vals[11]), nLumiReset);
1025 myLinFit->SetParameter(0, sZlumi->getTH1()->GetMean(2));
1026 myLinFit->SetParameter(1, 0.0);
1027 sZlumi->getTH1()->Fit(
"myLinFit",
"QR");
1029 dxdzlumi->ShiftFillLast(vals[4],
std::sqrt(vals[12]), nLumiReset);
1030 myLinFit->SetParameter(0, dxdzlumi->getTH1()->GetMean(2));
1031 myLinFit->SetParameter(1, 0.0);
1032 dxdzlumi->getTH1()->Fit(
"myLinFit",
"QR");
1034 dydzlumi->ShiftFillLast(vals[5],
std::sqrt(vals[13]), nLumiReset);
1035 myLinFit->SetParameter(0, dydzlumi->getTH1()->GetMean(2));
1036 myLinFit->SetParameter(1, 0.0);
1037 dydzlumi->getTH1()->Fit(
"myLinFit",
"QR");
1039 goodVxCounter->ShiftFillLast((
double)
counterVx,
std::sqrt((
double)counterVx), nLumiReset);
1040 myLinFit->SetParameter(0, goodVxCounter->getTH1()->GetMean(2));
1041 myLinFit->SetParameter(1, 0.0);
1042 goodVxCounter->getTH1()->Fit(
"myLinFit",
"QR");
1044 if (lastLumiOfFit % prescaleHistory == 0)
1046 goodVxCountHistory->getTH1()->SetBinContent(lastLumiOfFit, (
double)counterVx);
1047 goodVxCountHistory->getTH1()->SetBinError(lastLumiOfFit,
std::sqrt((
double)counterVx));
1054 else if (nLumiReset == 0)
1056 histTitle <<
"Fitted Beam Spot [cm] (no ongoing fits)";
1057 fitResults->setAxisTitle(histTitle.str().c_str(), 1);
1058 reportSummaryMap->Fill(0.5, 0.5, 1.0);
1059 hitCounter->ShiftFillLast(totalHits,
std::sqrt(totalHits), 1);
1071 nBinsHistoricalPlot = 80;
1072 nBinsWholeHistory = 3000;
1079 Vx_X = dbe->
book1D(
"vertex x",
"Primary Vertex X Coordinate Distribution",
int(rint(xRange/xStep)), -xRange/2., xRange/2.);
1080 Vx_Y = dbe->
book1D(
"vertex y",
"Primary Vertex Y Coordinate Distribution",
int(rint(yRange/yStep)), -yRange/2., yRange/2.);
1081 Vx_Z = dbe->
book1D(
"vertex z",
"Primary Vertex Z Coordinate Distribution",
int(rint(zRange/
zStep)), -zRange/2., zRange/2.);
1083 Vx_X->setAxisTitle(
"Entries [#]",2);
1084 Vx_Y->setAxisTitle(
"Primary Vertices Y [cm]",1);
1085 Vx_Y->setAxisTitle(
"Entries [#]",2);
1086 Vx_Z->setAxisTitle(
"Primary Vertices Z [cm]",1);
1087 Vx_Z->setAxisTitle(
"Entries [#]",2);
1089 mXlumi = dbe->
book1D(
"muX vs lumi",
"\\mu_{x} vs. Lumisection", nBinsHistoricalPlot, 0.5, (
double)nBinsHistoricalPlot+0.5);
1090 mYlumi = dbe->
book1D(
"muY vs lumi",
"\\mu_{y} vs. Lumisection", nBinsHistoricalPlot, 0.5, (
double)nBinsHistoricalPlot+0.5);
1091 mZlumi = dbe->
book1D(
"muZ vs lumi",
"\\mu_{z} vs. Lumisection", nBinsHistoricalPlot, 0.5, (
double)nBinsHistoricalPlot+0.5);
1093 mXlumi->setAxisTitle(
"\\mu_{x} [cm]",2);
1094 mXlumi->getTH1()->SetOption(
"E1");
1095 mYlumi->setAxisTitle(
"Lumisection [#]",1);
1096 mYlumi->setAxisTitle(
"\\mu_{y} [cm]",2);
1097 mYlumi->getTH1()->SetOption(
"E1");
1098 mZlumi->setAxisTitle(
"Lumisection [#]",1);
1099 mZlumi->setAxisTitle(
"\\mu_{z} [cm]",2);
1100 mZlumi->getTH1()->SetOption(
"E1");
1102 sXlumi = dbe->
book1D(
"sigmaX vs lumi",
"\\sigma_{x} vs. Lumisection", nBinsHistoricalPlot, 0.5, (
double)nBinsHistoricalPlot+0.5);
1103 sYlumi = dbe->
book1D(
"sigmaY vs lumi",
"\\sigma_{y} vs. Lumisection", nBinsHistoricalPlot, 0.5, (
double)nBinsHistoricalPlot+0.5);
1104 sZlumi = dbe->
book1D(
"sigmaZ vs lumi",
"\\sigma_{z} vs. Lumisection", nBinsHistoricalPlot, 0.5, (
double)nBinsHistoricalPlot+0.5);
1106 sXlumi->setAxisTitle(
"\\sigma_{x} [cm]",2);
1107 sXlumi->getTH1()->SetOption(
"E1");
1108 sYlumi->setAxisTitle(
"Lumisection [#]",1);
1109 sYlumi->setAxisTitle(
"\\sigma_{y} [cm]",2);
1110 sYlumi->getTH1()->SetOption(
"E1");
1111 sZlumi->setAxisTitle(
"Lumisection [#]",1);
1112 sZlumi->setAxisTitle(
"\\sigma_{z} [cm]",2);
1113 sZlumi->getTH1()->SetOption(
"E1");
1115 dxdzlumi = dbe->
book1D(
"dxdz vs lumi",
"dX/dZ vs. Lumisection", nBinsHistoricalPlot, 0.5, (
double)nBinsHistoricalPlot+0.5);
1116 dydzlumi = dbe->
book1D(
"dydz vs lumi",
"dY/dZ vs. Lumisection", nBinsHistoricalPlot, 0.5, (
double)nBinsHistoricalPlot+0.5);
1118 dxdzlumi->setAxisTitle(
"dX/dZ [rad]",2);
1119 dxdzlumi->getTH1()->SetOption(
"E1");
1120 dydzlumi->setAxisTitle(
"Lumisection [#]",1);
1121 dydzlumi->setAxisTitle(
"dY/dZ [rad]",2);
1122 dydzlumi->getTH1()->SetOption(
"E1");
1124 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.);
1125 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.);
1126 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.);
1128 Vx_ZX->setAxisTitle(
"Primary Vertices X [cm]",2);
1129 Vx_ZX->setAxisTitle(
"Entries [#]",3);
1130 Vx_ZY->setAxisTitle(
"Primary Vertices Z [cm]",1);
1131 Vx_ZY->setAxisTitle(
"Primary Vertices Y [cm]",2);
1132 Vx_ZY->setAxisTitle(
"Entries [#]",3);
1133 Vx_XY->setAxisTitle(
"Primary Vertices X [cm]",1);
1134 Vx_XY->setAxisTitle(
"Primary Vertices Y [cm]",2);
1135 Vx_XY->setAxisTitle(
"Entries [#]",3);
1137 hitCounter = dbe->
book1D(
"pixelHits vs lumi",
"# Pixel-Hits vs. Lumisection", nBinsHistoricalPlot, 0.5, (
double)nBinsHistoricalPlot+0.5);
1139 hitCounter->setAxisTitle(
"Pixel-Hits [#]",2);
1140 hitCounter->getTH1()->SetOption(
"E1");
1142 hitCountHistory = dbe->
book1D(
"hist pixelHits vs lumi",
"History: # Pixel-Hits vs. Lumi", nBinsWholeHistory, 0.5, (
double)nBinsWholeHistory+0.5);
1144 hitCountHistory->setAxisTitle(
"Pixel-Hits [#]",2);
1145 hitCountHistory->getTH1()->SetOption(
"E1");
1147 goodVxCounter = dbe->
book1D(
"good vertices vs lumi",
"# Good vertices vs. Lumisection", nBinsHistoricalPlot, 0.5, (
double)nBinsHistoricalPlot+0.5);
1149 goodVxCounter->setAxisTitle(
"Good vertices [#]",2);
1150 goodVxCounter->getTH1()->SetOption(
"E1");
1152 goodVxCountHistory = dbe->
book1D(
"hist good vx vs lumi",
"History: # Good vx vs. Lumi", nBinsWholeHistory, 0.5, (
double)nBinsWholeHistory+0.5);
1154 goodVxCountHistory->setAxisTitle(
"Good vertices [#]",2);
1155 goodVxCountHistory->getTH1()->SetOption(
"E1");
1157 fitResults = dbe->
book2D(
"fit results",
"Results of Beam Spot Fit", 2, 0., 2., 9, 0., 9.);
1159 fitResults->setBinLabel(9,
"X", 2);
1160 fitResults->setBinLabel(8,
"Y", 2);
1161 fitResults->setBinLabel(7,
"Z", 2);
1162 fitResults->setBinLabel(6,
"\\sigma_{Z}", 2);
1163 fitResults->setBinLabel(5,
"#frac{dX}{dZ}[rad]", 2);
1164 fitResults->setBinLabel(4,
"#frac{dY}{dZ}[rad]", 2);
1165 fitResults->setBinLabel(3,
"\\sigma_{X}", 2);
1166 fitResults->setBinLabel(2,
"\\sigma_{Y}", 2);
1167 fitResults->setBinLabel(1,
"Vertices", 2);
1168 fitResults->setBinLabel(1,
"Value", 1);
1169 fitResults->setBinLabel(2,
"Stat. Error", 1);
1170 fitResults->getTH1()->SetOption(
"text");
1173 reportSummary = dbe->
bookFloat(
"reportSummary");
1174 reportSummary->
Fill(0.);
1175 reportSummaryMap = dbe->
book2D(
"reportSummaryMap",
"Pixel-Vertices Beam Spot: % Good Fits", 1, 0., 1., 1, 0., 1.);
1176 reportSummaryMap->
Fill(0.5, 0.5, 0.);
1186 prescaleHistory = 1;
1187 maxLumiIntegration = 15;
1189 internalDebug =
false;
1191 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 &)
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
Log< T >::type log(const T &t)
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.
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
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])
void setCurrentFolder(const std::string &fullpath)
const double par[8 *NPar][4]