21 #include <Math/Minimizer.h>
22 #include <Math/Factory.h>
23 #include <Math/Functor.h>
76 internalDebug =
false;
78 pi = 3.141592653589793238;
105 stringstream debugFile;
108 if (outputDebugFile.is_open() ==
true) outputDebugFile.close();
109 tmp.erase(strlen(
fileName.c_str())-4,4);
110 debugFile << tmp.c_str() <<
"_Run" << iEvent.
id().
run() <<
".txt";
111 outputDebugFile.open(debugFile.str().c_str(),
ios::out);
112 outputDebugFile.close();
113 outputDebugFile.open(debugFile.str().c_str(), ios::app);
118 else if (beginTimeOfFit != 0)
120 totalHits += HitCounter(iEvent);
122 if (internalDebug ==
true)
124 cout <<
"[Vx3DHLTAnalyzer]::\tI found " << totalHits <<
" pixel hits until now" << endl;
125 cout <<
"[Vx3DHLTAnalyzer]::\tIn this event there are " << Vx3DCollection->size() <<
" vertex cadidates" << endl;
128 for (vector<Vertex>::const_iterator it3DVx = Vx3DCollection->begin(); it3DVx != Vx3DCollection->end(); it3DVx++)
130 if (internalDebug ==
true)
132 cout <<
"[Vx3DHLTAnalyzer]::\tVertex selections:" << endl;
133 cout <<
"[Vx3DHLTAnalyzer]::\tisValid = " << it3DVx->isValid() << endl;
134 cout <<
"[Vx3DHLTAnalyzer]::\tisFake = " << it3DVx->isFake() << endl;
135 cout <<
"[Vx3DHLTAnalyzer]::\tnodof = " << it3DVx->ndof() << endl;
136 cout <<
"[Vx3DHLTAnalyzer]::\ttracksSize = " << it3DVx->tracksSize() << endl;
139 if ((it3DVx->isValid() ==
true) &&
140 (it3DVx->isFake() ==
false) &&
142 (it3DVx->tracksSize() > 0) &&
143 ((it3DVx->ndof()+3.) / ((double)it3DVx->tracksSize()) >= 2.*
minVxWgt))
145 for (i = 0; i <
DIM; i++)
147 for (j = 0; j <
DIM; j++)
161 if ((i == DIM) && (det > 0.))
163 if (internalDebug ==
true)
cout <<
"[Vx3DHLTAnalyzer]::\tVertex accepted !" << endl;
165 MyVertex.
x = it3DVx->x();
166 MyVertex.
y = it3DVx->y();
167 MyVertex.
z = it3DVx->z();
170 Vx_X->Fill(it3DVx->x());
171 Vx_Y->Fill(it3DVx->y());
172 Vx_Z->Fill(it3DVx->z());
174 Vx_ZX->Fill(it3DVx->z(), it3DVx->x());
175 Vx_ZY->Fill(it3DVx->z(), it3DVx->y());
176 Vx_XY->Fill(it3DVx->x(), it3DVx->y());
178 else if (internalDebug ==
true)
180 cout <<
"[Vx3DHLTAnalyzer]::\tVertex discarded !" << endl;
182 for (i = 0; i <
DIM; i++)
183 for (j = 0; j <
DIM; j++)
184 cout <<
"(i,j) --> " << i <<
"," << j <<
" --> " << MyVertex.
Covariance[i][j] << endl;
187 else if (internalDebug ==
true)
cout <<
"[Vx3DHLTAnalyzer]::\tVertex discarded !" << endl;
210 strftime(ts,
sizeof(ts),
"%Y.%m.%d %H:%M:%S %Z", gmtime(&t));
212 string ts_string(ts);
247 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];
248 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];
252 K[0][0] = std::fabs(par[0]);
253 K[1][1] = std::fabs(par[1]);
254 K[2][2] = std::fabs(par[2]);
255 K[0][1] = K[1][0] = par[3];
256 K[1][2] = K[2][1] = par[4]*(std::fabs(par[2])-std::fabs(par[1])) - par[5]*par[3];
257 K[0][2] = K[2][0] = par[5]*(std::fabs(par[2])-std::fabs(par[0])) - par[4]*par[3];
260 det = K[0][0]*(K[1][1]*K[2][2] - K[1][2]*K[1][2]) -
261 K[0][1]*(K[0][1]*K[2][2] - K[0][2]*K[1][2]) +
262 K[0][2]*(K[0][1]*K[1][2] - K[0][2]*K[1][1]);
264 M[0][0] = (K[1][1]*K[2][2] - K[1][2]*K[1][2]) / det;
265 M[1][1] = (K[0][0]*K[2][2] - K[0][2]*K[0][2]) / det;
266 M[2][2] = (K[0][0]*K[1][1] - K[0][1]*K[0][1]) / det;
267 M[0][1] = M[1][0] = (K[0][2]*K[1][2] - K[0][1]*K[2][2]) / det;
268 M[1][2] = M[2][1] = (K[0][2]*K[0][1] - K[1][2]*K[0][0]) / det;
269 M[0][2] = M[2][0] = (K[0][1]*K[1][2] - K[0][2]*K[1][1]) / det;
300 if ((vals !=
NULL) && (vals->size() == nParams*2))
302 double nSigmaXY = 10.;
304 double parDistanceXY = 1
e-3;
305 double parDistanceZ = 1
e-2;
306 double parDistanceddZ = 1
e-3;
307 double parDistanceCxy = 1
e-5;
310 const unsigned int trials = 4;
311 double largerDist[trials] = {0.1, 5., 10., 100.};
313 double covxz,covyz,det;
315 int bestMovementX = 1;
316 int bestMovementY = 1;
317 int bestMovementZ = 1;
322 vector<double>::const_iterator it = vals->begin();
324 ROOT::Math::Minimizer* Gauss3D = ROOT::Math::Factory::CreateMinimizer(
"Minuit2",
"Migrad");
325 Gauss3D->SetErrorDef(1.0);
326 if (internalDebug ==
true) Gauss3D->SetPrintLevel(3);
327 else Gauss3D->SetPrintLevel(0);
329 ROOT::Math::Functor _Gauss3DFunc(&
Gauss3DFunc,nParams);
330 Gauss3D->SetFunction(_Gauss3DFunc);
332 if (internalDebug ==
true)
cout <<
"[Vx3DHLTAnalyzer]::\t@@@ START FITTING @@@" << endl;
336 for (
int i = 0;
i < 3;
i++)
338 deltaMean = (double(
i)-1.)*
std::sqrt(*(it+0));
339 if (internalDebug ==
true)
cout <<
"[Vx3DHLTAnalyzer]::\tdeltaMean --> " << deltaMean << endl;
343 Gauss3D->SetVariable(0,
"var x ", *(it+0), parDistanceXY * parDistanceXY);
344 Gauss3D->SetVariable(1,
"var y ", *(it+1), parDistanceXY * parDistanceXY);
345 Gauss3D->SetVariable(2,
"var z ", *(it+2), parDistanceZ * parDistanceZ);
346 Gauss3D->SetVariable(3,
"cov xy", *(it+3), parDistanceCxy);
347 Gauss3D->SetVariable(4,
"dydz ", *(it+4), parDistanceddZ);
348 Gauss3D->SetVariable(5,
"dxdz ", *(it+5), parDistanceddZ);
349 Gauss3D->SetVariable(6,
"mean x", *(it+6)+deltaMean, parDistanceXY);
350 Gauss3D->SetVariable(7,
"mean y", *(it+7), parDistanceXY);
351 Gauss3D->SetVariable(8,
"mean z", *(it+8), parDistanceZ);
354 xPos = Gauss3D->X()[6];
355 yPos = Gauss3D->X()[7];
356 zPos = Gauss3D->X()[8];
363 goodData = Gauss3D->Status();
364 edm = Gauss3D->Edm();
367 else if (
isNotFinite(edm) ==
true) { goodData = -1;
if (internalDebug ==
true)
cout <<
"[Vx3DHLTAnalyzer]::\tNot finite edm !" << endl; }
368 else for (
unsigned int j = 0;
j < nParams;
j++)
372 if (internalDebug ==
true)
cout <<
"[Vx3DHLTAnalyzer]::\tNot finite errors !" << endl;
377 covyz = Gauss3D->X()[4]*(std::fabs(Gauss3D->X()[2])-std::fabs(Gauss3D->X()[1])) - Gauss3D->X()[5]*Gauss3D->X()[3];
378 covxz = Gauss3D->X()[5]*(std::fabs(Gauss3D->X()[2])-std::fabs(Gauss3D->X()[0])) - Gauss3D->X()[4]*Gauss3D->X()[3];
380 det = std::fabs(Gauss3D->X()[0]) * (std::fabs(Gauss3D->X()[1])*std::fabs(Gauss3D->X()[2]) - covyz*covyz) -
381 Gauss3D->X()[3] * (Gauss3D->X()[3]*std::fabs(Gauss3D->X()[2]) - covxz*covyz) +
382 covxz * (Gauss3D->X()[3]*covyz - covxz*std::fabs(Gauss3D->X()[1]));
383 if (det < 0.) { goodData = -4;
if (internalDebug ==
true)
cout <<
"[Vx3DHLTAnalyzer]::\tNegative determinant !" << endl; }
386 if ((goodData == 0) && (std::fabs(edm) < bestEdm)) { bestEdm = edm; bestMovementX =
i; }
388 if (internalDebug ==
true)
cout <<
"[Vx3DHLTAnalyzer]::\tFound bestMovementX --> " << bestMovementX << endl;
392 for (
int i = 0;
i < 3;
i++)
394 deltaMean = (double(
i)-1.)*
std::sqrt(*(it+1));
395 if (internalDebug ==
true)
397 cout <<
"[Vx3DHLTAnalyzer]::\tdeltaMean --> " << deltaMean << endl;
398 cout <<
"[Vx3DHLTAnalyzer]::\tdeltaMean X --> " << (double(bestMovementX)-1.)*
std::sqrt(*(it+0)) << endl;
403 Gauss3D->SetVariable(0,
"var x ", *(it+0), parDistanceXY * parDistanceXY);
404 Gauss3D->SetVariable(1,
"var y ", *(it+1), parDistanceXY * parDistanceXY);
405 Gauss3D->SetVariable(2,
"var z ", *(it+2), parDistanceZ * parDistanceZ);
406 Gauss3D->SetVariable(3,
"cov xy", *(it+3), parDistanceCxy);
407 Gauss3D->SetVariable(4,
"dydz ", *(it+4), parDistanceddZ);
408 Gauss3D->SetVariable(5,
"dxdz ", *(it+5), parDistanceddZ);
409 Gauss3D->SetVariable(6,
"mean x", *(it+6)+(
double(bestMovementX)-1.)*
std::sqrt(*(it+0)), parDistanceXY);
410 Gauss3D->SetVariable(7,
"mean y", *(it+7)+deltaMean, parDistanceXY);
411 Gauss3D->SetVariable(8,
"mean z", *(it+8), parDistanceZ);
414 xPos = Gauss3D->X()[6];
415 yPos = Gauss3D->X()[7];
416 zPos = Gauss3D->X()[8];
423 goodData = Gauss3D->Status();
424 edm = Gauss3D->Edm();
427 else if (
isNotFinite(edm) ==
true) { goodData = -1;
if (internalDebug ==
true)
cout <<
"[Vx3DHLTAnalyzer]::\tNot finite edm !" << endl; }
428 else for (
unsigned int j = 0;
j < nParams;
j++)
432 if (internalDebug ==
true)
cout <<
"[Vx3DHLTAnalyzer]::\tNot finite errors !" << endl;
437 covyz = Gauss3D->X()[4]*(std::fabs(Gauss3D->X()[2])-std::fabs(Gauss3D->X()[1])) - Gauss3D->X()[5]*Gauss3D->X()[3];
438 covxz = Gauss3D->X()[5]*(std::fabs(Gauss3D->X()[2])-std::fabs(Gauss3D->X()[0])) - Gauss3D->X()[4]*Gauss3D->X()[3];
440 det = std::fabs(Gauss3D->X()[0]) * (std::fabs(Gauss3D->X()[1])*std::fabs(Gauss3D->X()[2]) - covyz*covyz) -
441 Gauss3D->X()[3] * (Gauss3D->X()[3]*std::fabs(Gauss3D->X()[2]) - covxz*covyz) +
442 covxz * (Gauss3D->X()[3]*covyz - covxz*std::fabs(Gauss3D->X()[1]));
443 if (det < 0.) { goodData = -4;
if (internalDebug ==
true)
cout <<
"[Vx3DHLTAnalyzer]::\tNegative determinant !" << endl; }
446 if ((goodData == 0) && (std::fabs(edm) < bestEdm)) { bestEdm = edm; bestMovementY =
i; }
448 if (internalDebug ==
true)
cout <<
"[Vx3DHLTAnalyzer]::\tFound bestMovementY --> " << bestMovementY << endl;
452 for (
int i = 0;
i < 3;
i++)
454 deltaMean = (double(
i)-1.)*
std::sqrt(*(it+2));
455 if (internalDebug ==
true)
457 cout <<
"[Vx3DHLTAnalyzer]::\tdeltaMean --> " << deltaMean << endl;
458 cout <<
"[Vx3DHLTAnalyzer]::\tdeltaMean X --> " << (double(bestMovementX)-1.)*
std::sqrt(*(it+0)) << endl;
459 cout <<
"[Vx3DHLTAnalyzer]::\tdeltaMean Y --> " << (double(bestMovementY)-1.)*
std::sqrt(*(it+1)) << endl;
464 Gauss3D->SetVariable(0,
"var x ", *(it+0), parDistanceXY * parDistanceXY);
465 Gauss3D->SetVariable(1,
"var y ", *(it+1), parDistanceXY * parDistanceXY);
466 Gauss3D->SetVariable(2,
"var z ", *(it+2), parDistanceZ * parDistanceZ);
467 Gauss3D->SetVariable(3,
"cov xy", *(it+3), parDistanceCxy);
468 Gauss3D->SetVariable(4,
"dydz ", *(it+4), parDistanceddZ);
469 Gauss3D->SetVariable(5,
"dxdz ", *(it+5), parDistanceddZ);
470 Gauss3D->SetVariable(6,
"mean x", *(it+6)+(
double(bestMovementX)-1.)*
std::sqrt(*(it+0)), parDistanceXY);
471 Gauss3D->SetVariable(7,
"mean y", *(it+7)+(
double(bestMovementY)-1.)*
std::sqrt(*(it+1)), parDistanceXY);
472 Gauss3D->SetVariable(8,
"mean z", *(it+8)+deltaMean, parDistanceZ);
475 xPos = Gauss3D->X()[6];
476 yPos = Gauss3D->X()[7];
477 zPos = Gauss3D->X()[8];
484 goodData = Gauss3D->Status();
485 edm = Gauss3D->Edm();
488 else if (
isNotFinite(edm) ==
true) { goodData = -1;
if (internalDebug ==
true)
cout <<
"[Vx3DHLTAnalyzer]::\tNot finite edm !" << endl; }
489 else for (
unsigned int j = 0;
j < nParams;
j++)
493 if (internalDebug ==
true)
cout <<
"[Vx3DHLTAnalyzer]::\tNot finite errors !" << endl;
498 covyz = Gauss3D->X()[4]*(std::fabs(Gauss3D->X()[2])-std::fabs(Gauss3D->X()[1])) - Gauss3D->X()[5]*Gauss3D->X()[3];
499 covxz = Gauss3D->X()[5]*(std::fabs(Gauss3D->X()[2])-std::fabs(Gauss3D->X()[0])) - Gauss3D->X()[4]*Gauss3D->X()[3];
501 det = std::fabs(Gauss3D->X()[0]) * (std::fabs(Gauss3D->X()[1])*std::fabs(Gauss3D->X()[2]) - covyz*covyz) -
502 Gauss3D->X()[3] * (Gauss3D->X()[3]*std::fabs(Gauss3D->X()[2]) - covxz*covyz) +
503 covxz * (Gauss3D->X()[3]*covyz - covxz*std::fabs(Gauss3D->X()[1]));
504 if (det < 0.) { goodData = -4;
if (internalDebug ==
true)
cout <<
"[Vx3DHLTAnalyzer]::\tNegative determinant !" << endl; }
507 if ((goodData == 0) && (std::fabs(edm) < bestEdm)) { bestEdm = edm; bestMovementZ =
i; }
509 if (internalDebug ==
true)
cout <<
"[Vx3DHLTAnalyzer]::\tFound bestMovementZ --> " << bestMovementZ << endl;
514 Gauss3D->SetVariable(0,
"var x ", *(it+0), parDistanceXY * parDistanceXY);
515 Gauss3D->SetVariable(1,
"var y ", *(it+1), parDistanceXY * parDistanceXY);
516 Gauss3D->SetVariable(2,
"var z ", *(it+2), parDistanceZ * parDistanceZ);
517 Gauss3D->SetVariable(3,
"cov xy", *(it+3), parDistanceCxy);
518 Gauss3D->SetVariable(4,
"dydz ", *(it+4), parDistanceddZ);
519 Gauss3D->SetVariable(5,
"dxdz ", *(it+5), parDistanceddZ);
520 Gauss3D->SetVariable(6,
"mean x", *(it+6)+(
double(bestMovementX)-1.)*
std::sqrt(*(it+0)), parDistanceXY);
521 Gauss3D->SetVariable(7,
"mean y", *(it+7)+(
double(bestMovementY)-1.)*
std::sqrt(*(it+1)), parDistanceXY);
522 Gauss3D->SetVariable(8,
"mean z", *(it+8)+(
double(bestMovementZ)-1.)*
std::sqrt(*(it+2)), parDistanceZ);
525 xPos = Gauss3D->X()[6];
526 yPos = Gauss3D->X()[7];
527 zPos = Gauss3D->X()[8];
534 goodData = Gauss3D->Status();
535 edm = Gauss3D->Edm();
538 else if (
isNotFinite(edm) ==
true) { goodData = -1;
if (internalDebug ==
true)
cout <<
"[Vx3DHLTAnalyzer]::\tNot finite edm !" << endl; }
539 else for (
unsigned int j = 0;
j < nParams;
j++)
543 if (internalDebug ==
true)
cout <<
"[Vx3DHLTAnalyzer]::\tNot finite errors !" << endl;
548 covyz = Gauss3D->X()[4]*(std::fabs(Gauss3D->X()[2])-std::fabs(Gauss3D->X()[1])) - Gauss3D->X()[5]*Gauss3D->X()[3];
549 covxz = Gauss3D->X()[5]*(std::fabs(Gauss3D->X()[2])-std::fabs(Gauss3D->X()[0])) - Gauss3D->X()[4]*Gauss3D->X()[3];
551 det = std::fabs(Gauss3D->X()[0]) * (std::fabs(Gauss3D->X()[1])*std::fabs(Gauss3D->X()[2]) - covyz*covyz) -
552 Gauss3D->X()[3] * (Gauss3D->X()[3]*std::fabs(Gauss3D->X()[2]) - covxz*covyz) +
553 covxz * (Gauss3D->X()[3]*covyz - covxz*std::fabs(Gauss3D->X()[1]));
554 if (det < 0.) { goodData = -4;
if (internalDebug ==
true)
cout <<
"[Vx3DHLTAnalyzer]::\tNegative determinant !" << endl; }
558 for (
unsigned int i = 0;
i < trials;
i++)
560 if ((goodData != 0) && (goodData != -2))
564 if (internalDebug ==
true)
cout <<
"[Vx3DHLTAnalyzer]::\tFIT WITH DIFFERENT PARAMETER DISTANCES - STEP " <<
i+1 << endl;
566 Gauss3D->SetVariable(0,
"var x ", *(it+0), parDistanceXY * parDistanceXY * largerDist[
i]);
567 Gauss3D->SetVariable(1,
"var y ", *(it+1), parDistanceXY * parDistanceXY * largerDist[i]);
568 Gauss3D->SetVariable(2,
"var z ", *(it+2), parDistanceZ * parDistanceZ * largerDist[i]);
569 Gauss3D->SetVariable(3,
"cov xy", *(it+3), parDistanceCxy * largerDist[i]);
570 Gauss3D->SetVariable(4,
"dydz ", *(it+4), parDistanceddZ * largerDist[i]);
571 Gauss3D->SetVariable(5,
"dxdz ", *(it+5), parDistanceddZ * largerDist[i]);
572 Gauss3D->SetVariable(6,
"mean x", *(it+6)+(
double(bestMovementX)-1.)*std::sqrt(*(it+0)), parDistanceXY * largerDist[i]);
573 Gauss3D->SetVariable(7,
"mean y", *(it+7)+(
double(bestMovementY)-1.)*std::sqrt(*(it+1)), parDistanceXY * largerDist[i]);
574 Gauss3D->SetVariable(8,
"mean z", *(it+8)+(
double(bestMovementZ)-1.)*std::sqrt(*(it+2)), parDistanceZ * largerDist[i]);
577 xPos = Gauss3D->X()[6];
578 yPos = Gauss3D->X()[7];
579 zPos = Gauss3D->X()[8];
586 goodData = Gauss3D->Status();
587 edm = Gauss3D->Edm();
590 else if (
isNotFinite(edm) ==
true) { goodData = -1;
if (internalDebug ==
true)
cout <<
"[Vx3DHLTAnalyzer]::\tNot finite edm !" << endl; }
591 else for (
unsigned int j = 0;
j < nParams;
j++)
595 if (internalDebug ==
true)
cout <<
"[Vx3DHLTAnalyzer]::\tNot finite errors !" << endl;
600 covyz = Gauss3D->X()[4]*(std::fabs(Gauss3D->X()[2])-std::fabs(Gauss3D->X()[1])) - Gauss3D->X()[5]*Gauss3D->X()[3];
601 covxz = Gauss3D->X()[5]*(std::fabs(Gauss3D->X()[2])-std::fabs(Gauss3D->X()[0])) - Gauss3D->X()[4]*Gauss3D->X()[3];
603 det = std::fabs(Gauss3D->X()[0]) * (std::fabs(Gauss3D->X()[1])*std::fabs(Gauss3D->X()[2]) - covyz*covyz) -
604 Gauss3D->X()[3] * (Gauss3D->X()[3]*std::fabs(Gauss3D->X()[2]) - covxz*covyz) +
605 covxz * (Gauss3D->X()[3]*covyz - covxz*std::fabs(Gauss3D->X()[1]));
606 if (det < 0.) { goodData = -4;
if (internalDebug ==
true)
cout <<
"[Vx3DHLTAnalyzer]::\tNegative determinant !" << endl; }
612 for (
unsigned int i = 0;
i < nParams;
i++)
614 vals->operator[](
i) = Gauss3D->X()[
i];
615 vals->operator[](
i+nParams) = Gauss3D->Errors()[
i];
628 if ((
debugMode ==
true) && (outputDebugFile.is_open() ==
true))
630 outputDebugFile <<
"Runnumber " <<
runNumber << endl;
631 outputDebugFile <<
"BeginTimeOfFit " <<
formatTime(beginTimeOfFit >> 32) <<
" " << (beginTimeOfFit >> 32) << endl;
632 outputDebugFile <<
"BeginLumiRange " << beginLumiOfFit << endl;
633 outputDebugFile <<
"EndTimeOfFit " <<
formatTime(endTimeOfFit >> 32) <<
" " << (endTimeOfFit >> 32) << endl;
634 outputDebugFile <<
"EndLumiRange " << endLumiOfFit << endl;
635 outputDebugFile <<
"LumiCounter " << lumiCounter << endl;
636 outputDebugFile <<
"LastLumiOfFit " << lastLumiOfFit << endl;
640 if (ResetType.compare(
"scratch") == 0)
667 goodVxCounter->Reset();
668 statusCounter->Reset();
671 reportSummary->Fill(-1);
672 reportSummaryMap->getTH1()->SetBinContent(1, 1, -1);
683 if (internalDebug ==
true)
cout <<
"[Vx3DHLTAnalyzer]::\tReset issued: scratch" << endl;
684 if ((
debugMode ==
true) && (outputDebugFile.is_open() ==
true)) outputDebugFile <<
"Reset -scratch- issued\n" << endl;
686 else if (ResetType.compare(
"whole") == 0)
705 if (internalDebug ==
true)
cout <<
"[Vx3DHLTAnalyzer]::\tReset issued: whole" << endl;
706 if ((
debugMode ==
true) && (outputDebugFile.is_open() ==
true)) outputDebugFile <<
"Reset -whole- issued\n" << endl;
708 else if (ResetType.compare(
"hitCounter") == 0)
712 if (internalDebug ==
true)
cout <<
"[Vx3DHLTAnalyzer]::\tReset issued: hitCounter" << endl;
713 if ((
debugMode ==
true) && (outputDebugFile.is_open() ==
true)) outputDebugFile <<
"Reset -hitCounter- issued\n" << endl;
721 unsigned int BeginLumiOfFit,
722 unsigned int EndLumiOfFit,
725 stringstream BufferString;
726 BufferString.precision(5);
730 if ((
outputFile.is_open() ==
true) && (vals !=
NULL) && (vals->size() == (nParams-1)*2))
732 vector<double>::const_iterator it = vals->begin();
735 outputFile <<
"BeginTimeOfFit " <<
formatTime(beginTimeOfFit >> 32) <<
" " << (beginTimeOfFit >> 32) << endl;
736 outputFile <<
"EndTimeOfFit " <<
formatTime(endTimeOfFit >> 32) <<
" " << (endTimeOfFit >> 32) << endl;
737 outputFile <<
"LumiRange " << beginLumiOfFit <<
" - " << endLumiOfFit << endl;
743 BufferString << *(it+0);
744 outputFile <<
"X0 " << BufferString.str().c_str() << endl;
745 BufferString.str(
"");
747 BufferString << *(it+1);
748 outputFile <<
"Y0 " << BufferString.str().c_str() << endl;
749 BufferString.str(
"");
751 BufferString << *(it+2);
752 outputFile <<
"Z0 " << BufferString.str().c_str() << endl;
753 BufferString.str(
"");
755 BufferString << *(it+3);
756 outputFile <<
"sigmaZ0 " << BufferString.str().c_str() << endl;
757 BufferString.str(
"");
759 BufferString << *(it+4);
760 outputFile <<
"dxdz " << BufferString.str().c_str() << endl;
761 BufferString.str(
"");
763 BufferString << *(it+5);
764 outputFile <<
"dydz " << BufferString.str().c_str() << endl;
765 BufferString.str(
"");
767 BufferString << *(it+6);
768 outputFile <<
"BeamWidthX " << BufferString.str().c_str() << endl;
769 BufferString.str(
"");
771 BufferString << *(it+7);
772 outputFile <<
"BeamWidthY " << BufferString.str().c_str() << endl;
773 BufferString.str(
"");
775 outputFile <<
"Cov(0,j) " << *(it+8) <<
" 0.0 0.0 0.0 0.0 0.0 0.0" << endl;
776 outputFile <<
"Cov(1,j) 0.0 " << *(it+9) <<
" 0.0 0.0 0.0 0.0 0.0" << endl;
777 outputFile <<
"Cov(2,j) 0.0 0.0 " << *(it+10) <<
" 0.0 0.0 0.0 0.0" << endl;
778 outputFile <<
"Cov(3,j) 0.0 0.0 0.0 " << *(it+11) <<
" 0.0 0.0 0.0" << endl;
779 outputFile <<
"Cov(4,j) 0.0 0.0 0.0 0.0 " << *(it+12) <<
" 0.0 0.0" << endl;
780 outputFile <<
"Cov(5,j) 0.0 0.0 0.0 0.0 0.0 " << *(it+13) <<
" 0.0" << endl;
781 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;
789 if ((
debugMode ==
true) && (outputDebugFile.is_open() ==
true) && (vals !=
NULL) && (vals->size() == (nParams-1)*2))
791 vector<double>::const_iterator it = vals->begin();
793 outputDebugFile <<
"Runnumber " <<
runNumber << endl;
794 outputDebugFile <<
"BeginTimeOfFit " <<
formatTime(beginTimeOfFit >> 32) <<
" " << (beginTimeOfFit >> 32) << endl;
795 outputDebugFile <<
"EndTimeOfFit " <<
formatTime(endTimeOfFit >> 32) <<
" " << (endTimeOfFit >> 32) << endl;
796 outputDebugFile <<
"LumiRange " << beginLumiOfFit <<
" - " << endLumiOfFit << endl;
797 outputDebugFile <<
"Type " << dataType << endl;
802 BufferString << *(it+0);
803 outputDebugFile <<
"X0 " << BufferString.str().c_str() << endl;
804 BufferString.str(
"");
806 BufferString << *(it+1);
807 outputDebugFile <<
"Y0 " << BufferString.str().c_str() << endl;
808 BufferString.str(
"");
810 BufferString << *(it+2);
811 outputDebugFile <<
"Z0 " << BufferString.str().c_str() << endl;
812 BufferString.str(
"");
814 BufferString << *(it+3);
815 outputDebugFile <<
"sigmaZ0 " << BufferString.str().c_str() << endl;
816 BufferString.str(
"");
818 BufferString << *(it+4);
819 outputDebugFile <<
"dxdz " << BufferString.str().c_str() << endl;
820 BufferString.str(
"");
822 BufferString << *(it+5);
823 outputDebugFile <<
"dydz " << BufferString.str().c_str() << endl;
824 BufferString.str(
"");
826 BufferString << *(it+6);
827 outputDebugFile <<
"BeamWidthX " << BufferString.str().c_str() << endl;
828 BufferString.str(
"");
830 BufferString << *(it+7);
831 outputDebugFile <<
"BeamWidthY " << BufferString.str().c_str() << endl;
832 BufferString.str(
"");
834 outputDebugFile <<
"Cov(0,j) " << *(it+8) <<
" 0.0 0.0 0.0 0.0 0.0 0.0" << endl;
835 outputDebugFile <<
"Cov(1,j) 0.0 " << *(it+9) <<
" 0.0 0.0 0.0 0.0 0.0" << endl;
836 outputDebugFile <<
"Cov(2,j) 0.0 0.0 " << *(it+10) <<
" 0.0 0.0 0.0 0.0" << endl;
837 outputDebugFile <<
"Cov(3,j) 0.0 0.0 0.0 " << *(it+11) <<
" 0.0 0.0 0.0" << endl;
838 outputDebugFile <<
"Cov(4,j) 0.0 0.0 0.0 0.0 " << *(it+12) <<
" 0.0 0.0" << endl;
839 outputDebugFile <<
"Cov(5,j) 0.0 0.0 0.0 0.0 0.0 " << *(it+13) <<
" 0.0" << endl;
840 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;
842 outputDebugFile <<
"EmittanceX 0.0" << endl;
843 outputDebugFile <<
"EmittanceY 0.0" << endl;
844 outputDebugFile <<
"BetaStar 0.0" << endl;
846 outputDebugFile <<
"Used vertices: " <<
counterVx <<
"\n" << endl;
853 cout <<
"var x --> " << fitResults[0] <<
" +/- " << fitResults[0+nParams] << endl;
854 cout <<
"var y --> " << fitResults[1] <<
" +/- " << fitResults[1+nParams] << endl;
855 cout <<
"var z --> " << fitResults[2] <<
" +/- " << fitResults[2+nParams] << endl;
856 cout <<
"cov xy --> " << fitResults[3] <<
" +/- " << fitResults[3+nParams] << endl;
857 cout <<
"dydz --> " << fitResults[4] <<
" +/- " << fitResults[4+nParams] << endl;
858 cout <<
"dxdz --> " << fitResults[5] <<
" +/- " << fitResults[5+nParams] << endl;
859 cout <<
"mean x --> " << fitResults[6] <<
" +/- " << fitResults[6+nParams] << endl;
860 cout <<
"mean y --> " << fitResults[7] <<
" +/- " << fitResults[7+nParams] << endl;
861 cout <<
"mean z --> " << fitResults[8] <<
" +/- " << fitResults[8+nParams] << endl;
868 if ((lumiCounter == 0) && (lumiBlock.
luminosityBlock() > lastLumiOfFit))
874 else if ((lumiCounter != 0) && (lumiBlock.
luminosityBlock() >= (beginLumiOfFit+lumiCounter))) lumiCounter++;
875 else reset(
"scratch");
881 stringstream histTitle;
888 lastLumiOfFit = endLumiOfFit;
891 hitCounter->getTH1()->SetBinContent(lastLumiOfFit, (
double)totalHits);
892 hitCounter->getTH1()->SetBinError(lastLumiOfFit,
std::sqrt((
double)totalHits));
896 vector<double> fitResults;
898 fitResults.push_back(Vx_X->getTH1()->GetRMS()*Vx_X->getTH1()->GetRMS());
899 fitResults.push_back(Vx_Y->getTH1()->GetRMS()*Vx_Y->getTH1()->GetRMS());
900 fitResults.push_back(Vx_Z->getTH1()->GetRMS()*Vx_Z->getTH1()->GetRMS());
901 fitResults.push_back(0.0);
902 fitResults.push_back(0.0);
903 fitResults.push_back(0.0);
904 fitResults.push_back(Vx_X->getTH1()->GetMean());
905 fitResults.push_back(Vx_Y->getTH1()->GetMean());
906 fitResults.push_back(Vx_Z->getTH1()->GetMean());
907 for (
unsigned int i = 0;
i < nParams;
i++) fitResults.push_back(0.0);
909 if (internalDebug ==
true)
911 cout <<
"[Vx3DHLTAnalyzer]::\t@@@ Beam Spot parameters - prefit @@@" << endl;
913 printFitParams(fitResults);
916 cout <<
"BeginTimeOfFit " <<
formatTime(beginTimeOfFit >> 32) <<
" " << (beginTimeOfFit >> 32) << endl;
917 cout <<
"EndTimeOfFit " <<
formatTime(endTimeOfFit >> 32) <<
" " << (endTimeOfFit >> 32) << endl;
918 cout <<
"LumiRange " << beginLumiOfFit <<
" - " << endLumiOfFit << endl;
921 goodData = MyFit(&fitResults);
923 if (internalDebug ==
true)
925 cout <<
"[Vx3DHLTAnalyzer]::\t@@@ Beam Spot parameters - postfit @@@" << endl;
927 printFitParams(fitResults);
929 cout <<
"goodData --> " << goodData << endl;
935 vals.push_back(fitResults[6]);
936 vals.push_back(fitResults[7]);
937 vals.push_back(fitResults[8]);
938 vals.push_back(
std::sqrt(std::fabs(fitResults[2])));
939 vals.push_back(fitResults[5]);
940 vals.push_back(fitResults[4]);
941 vals.push_back(
std::sqrt(std::fabs(fitResults[0])));
942 vals.push_back(
std::sqrt(std::fabs(fitResults[1])));
944 vals.push_back(
std::pow(fitResults[6+nParams],2.));
945 vals.push_back(
std::pow(fitResults[7+nParams],2.));
946 vals.push_back(
std::pow(fitResults[8+nParams],2.));
947 vals.push_back(
std::pow(std::fabs(fitResults[2+nParams]) / (2.*
std::sqrt(std::fabs(fitResults[2]))),2.));
948 vals.push_back(
std::pow(fitResults[5+nParams],2.));
949 vals.push_back(
std::pow(fitResults[4+nParams],2.));
950 vals.push_back(
std::pow(std::fabs(fitResults[0+nParams]) / (2.*
std::sqrt(std::fabs(fitResults[0]))),2.));
951 vals.push_back(
std::pow(std::fabs(fitResults[1+nParams]) / (2.*
std::sqrt(std::fabs(fitResults[1]))),2.));
953 else for (
unsigned int i = 0;
i < (nParams-1)*2;
i++) vals.push_back(0.0);
959 counterVx = Vx_X->getTH1F()->GetEntries();
965 vals.push_back(Vx_X->getTH1F()->GetMean());
966 vals.push_back(Vx_Y->getTH1F()->GetMean());
967 vals.push_back(Vx_Z->getTH1F()->GetMean());
968 vals.push_back(Vx_Z->getTH1F()->GetRMS());
971 vals.push_back(Vx_X->getTH1F()->GetRMS());
972 vals.push_back(Vx_Y->getTH1F()->GetRMS());
974 vals.push_back(
std::pow(Vx_X->getTH1F()->GetMeanError(),2.));
975 vals.push_back(
std::pow(Vx_Y->getTH1F()->GetMeanError(),2.));
976 vals.push_back(
std::pow(Vx_Z->getTH1F()->GetMeanError(),2.));
977 vals.push_back(
std::pow(Vx_Z->getTH1F()->GetRMSError(),2.));
980 vals.push_back(
std::pow(Vx_X->getTH1F()->GetRMSError(),2.));
981 vals.push_back(
std::pow(Vx_Y->getTH1F()->GetRMSError(),2.));
986 for (
unsigned int i = 0;
i < (nParams-1)*2;
i++) vals.push_back(0.0);
1009 writeToFile(&vals, beginTimeOfFit, endTimeOfFit, beginLumiOfFit, endLumiOfFit, 3);
1010 if (internalDebug ==
true)
cout <<
"[Vx3DHLTAnalyzer]::\tUsed vertices: " <<
counterVx << endl;
1012 statusCounter->getTH1()->SetBinContent(lastLumiOfFit, (
double)goodData);
1013 statusCounter->getTH1()->SetBinError(lastLumiOfFit, 1
e-3);
1019 histTitle <<
"Ongoing: fitted lumis " << beginLumiOfFit <<
" - " << endLumiOfFit;
1024 if (goodData == -2) histTitle <<
"Ongoing: not enough evts (" << lumiCounter <<
" - " <<
maxLumiIntegration <<
" lumis)";
1025 else histTitle <<
"Ongoing: temporary problems (" << lumiCounter <<
" - " << maxLumiIntegration <<
" lumis)";
1027 if (lumiCounter > maxLumiIntegration)
1029 statusCounter->getTH1()->SetBinContent(lastLumiOfFit, -5);
1030 statusCounter->getTH1()->SetBinError(lastLumiOfFit, 1
e-3);
1033 else reset(
"hitCounter");
1036 reportSummary->Fill((numberFits != 0 ? ((
double)numberGoodFits) / ((
double)numberFits) : -1));
1037 reportSummaryMap->getTH1()->SetBinContent(1, 1, (numberFits != 0 ? ((
double)numberGoodFits) / ((
double)numberFits) : -1));
1039 fitResults->setAxisTitle(histTitle.str().c_str(), 1);
1041 fitResults->setBinContent(1, 9, vals[0]);
1042 fitResults->setBinContent(1, 8, vals[1]);
1043 fitResults->setBinContent(1, 7, vals[2]);
1044 fitResults->setBinContent(1, 6, vals[3]);
1045 fitResults->setBinContent(1, 5, vals[4]);
1046 fitResults->setBinContent(1, 4, vals[5]);
1047 fitResults->setBinContent(1, 3, vals[6]);
1048 fitResults->setBinContent(1, 2, vals[7]);
1049 fitResults->setBinContent(1, 1,
counterVx);
1051 fitResults->setBinContent(2, 9,
std::sqrt(vals[8]));
1052 fitResults->setBinContent(2, 8,
std::sqrt(vals[9]));
1053 fitResults->setBinContent(2, 7,
std::sqrt(vals[10]));
1054 fitResults->setBinContent(2, 6,
std::sqrt(vals[11]));
1055 fitResults->setBinContent(2, 5,
std::sqrt(vals[12]));
1056 fitResults->setBinContent(2, 4,
std::sqrt(vals[13]));
1057 fitResults->setBinContent(2, 3,
std::sqrt(vals[14]));
1058 fitResults->setBinContent(2, 2,
std::sqrt(vals[15]));
1062 TF1* myLinFit =
new TF1(
"myLinFit",
"[0] + [1]*x", mXlumi->getTH1()->GetXaxis()->GetXmin(), mXlumi->getTH1()->GetXaxis()->GetXmax());
1063 myLinFit->SetLineColor(2);
1064 myLinFit->SetLineWidth(2);
1065 myLinFit->SetParName(0,
"Inter.");
1066 myLinFit->SetParName(1,
"Slope");
1068 mXlumi->getTH1()->SetBinContent(lastLumiOfFit, vals[0]);
1069 mXlumi->getTH1()->SetBinError(lastLumiOfFit,
std::sqrt(vals[8]));
1070 myLinFit->SetParameter(0, mXlumi->getTH1()->GetMean(2));
1071 myLinFit->SetParameter(1, 0.0);
1072 mXlumi->getTH1()->Fit(myLinFit,
"QR");
1074 mYlumi->getTH1()->SetBinContent(lastLumiOfFit, vals[1]);
1075 mYlumi->getTH1()->SetBinError(lastLumiOfFit,
std::sqrt(vals[9]));
1076 myLinFit->SetParameter(0, mYlumi->getTH1()->GetMean(2));
1077 myLinFit->SetParameter(1, 0.0);
1078 mYlumi->getTH1()->Fit(myLinFit,
"QR");
1080 mZlumi->getTH1()->SetBinContent(lastLumiOfFit, vals[2]);
1081 mZlumi->getTH1()->SetBinError(lastLumiOfFit,
std::sqrt(vals[10]));
1082 myLinFit->SetParameter(0, mZlumi->getTH1()->GetMean(2));
1083 myLinFit->SetParameter(1, 0.0);
1084 mZlumi->getTH1()->Fit(myLinFit,
"QR");
1086 sXlumi->getTH1()->SetBinContent(lastLumiOfFit, vals[6]);
1087 sXlumi->getTH1()->SetBinError(lastLumiOfFit,
std::sqrt(vals[14]));
1088 myLinFit->SetParameter(0, sXlumi->getTH1()->GetMean(2));
1089 myLinFit->SetParameter(1, 0.0);
1090 sXlumi->getTH1()->Fit(myLinFit,
"QR");
1092 sYlumi->getTH1()->SetBinContent(lastLumiOfFit, vals[7]);
1093 sYlumi->getTH1()->SetBinError(lastLumiOfFit,
std::sqrt(vals[15]));
1094 myLinFit->SetParameter(0, sYlumi->getTH1()->GetMean(2));
1095 myLinFit->SetParameter(1, 0.0);
1096 sYlumi->getTH1()->Fit(myLinFit,
"QR");
1098 sZlumi->getTH1()->SetBinContent(lastLumiOfFit, vals[3]);
1099 sZlumi->getTH1()->SetBinError(lastLumiOfFit,
std::sqrt(vals[11]));
1100 myLinFit->SetParameter(0, sZlumi->getTH1()->GetMean(2));
1101 myLinFit->SetParameter(1, 0.0);
1102 sZlumi->getTH1()->Fit(myLinFit,
"QR");
1104 dxdzlumi->getTH1()->SetBinContent(lastLumiOfFit, vals[4]);
1105 dxdzlumi->getTH1()->SetBinError(lastLumiOfFit,
std::sqrt(vals[12]));
1106 myLinFit->SetParameter(0, dxdzlumi->getTH1()->GetMean(2));
1107 myLinFit->SetParameter(1, 0.0);
1108 dxdzlumi->getTH1()->Fit(myLinFit,
"QR");
1110 dydzlumi->getTH1()->SetBinContent(lastLumiOfFit, vals[5]);
1111 dydzlumi->getTH1()->SetBinError(lastLumiOfFit,
std::sqrt(vals[13]));
1112 myLinFit->SetParameter(0, dydzlumi->getTH1()->GetMean(2));
1113 myLinFit->SetParameter(1, 0.0);
1114 dydzlumi->getTH1()->Fit(myLinFit,
"QR");
1119 TF1* myExpFit =
new TF1(
"myExpFit",
"[0]*exp(-x/[1])", hitCounter->getTH1()->GetXaxis()->GetXmin(), hitCounter->getTH1()->GetXaxis()->GetXmax());
1120 myExpFit->SetLineColor(2);
1121 myExpFit->SetLineWidth(2);
1122 myExpFit->SetParName(0,
"Ampli.");
1123 myExpFit->SetParName(1,
"#tau");
1125 myExpFit->SetParameter(0, hitCounter->getTH1()->GetMaximum());
1127 hitCounter->getTH1()->Fit(myExpFit,
"QR");
1129 goodVxCounter->getTH1()->SetBinContent(lastLumiOfFit, (
double)
counterVx);
1130 goodVxCounter->getTH1()->SetBinError(lastLumiOfFit,
std::sqrt((
double)counterVx));
1132 myExpFit->SetParameter(0, goodVxCounter->getTH1()->GetMaximum());
1134 goodVxCounter->getTH1()->Fit(myExpFit,
"QR");
1142 fitResults->setAxisTitle(histTitle.str().c_str(), 1);
1143 if ((
debugMode ==
true) && (outputDebugFile.is_open() ==
true))
1145 outputDebugFile <<
"Runnumber " <<
runNumber << endl;
1146 outputDebugFile <<
"BeginTimeOfFit " <<
formatTime(beginTimeOfFit >> 32) <<
" " << (beginTimeOfFit >> 32) << endl;
1147 outputDebugFile <<
"BeginLumiRange " << beginLumiOfFit << endl;
1148 outputDebugFile << histTitle.str().c_str() <<
"\n" << endl;
1153 histTitle <<
"Ongoing: no ongoing fits";
1154 fitResults->setAxisTitle(histTitle.str().c_str(), 1);
1155 if ((
debugMode ==
true) && (outputDebugFile.is_open() ==
true)) outputDebugFile << histTitle.str().c_str() <<
"\n" << endl;
1159 hitCounter->getTH1()->SetBinContent(endLumiOfFit, (
double)totalHits);
1160 hitCounter->getTH1()->SetBinError(endLumiOfFit,
std::sqrt((
double)totalHits));
1165 if (internalDebug ==
true)
cout <<
"[Vx3DHLTAnalyzer]::\tHistogram title: " << histTitle.str() << endl;
1177 Vx_X->setAxisTitle(
"Entries [#]",2);
1178 Vx_Y->setAxisTitle(
"Primary Vertices Y [cm]",1);
1179 Vx_Y->setAxisTitle(
"Entries [#]",2);
1180 Vx_Z->setAxisTitle(
"Primary Vertices Z [cm]",1);
1181 Vx_Z->setAxisTitle(
"Entries [#]",2);
1184 mYlumi = ibooker.
book1D(
"B - muY vs lumi",
"#mu_{y} vs. Lumisection", nLumiXaxisRange, 0.5, ((
double)nLumiXaxisRange)+0.5);
1185 mZlumi = ibooker.
book1D(
"B - muZ vs lumi",
"#mu_{z} vs. Lumisection", nLumiXaxisRange, 0.5, ((
double)nLumiXaxisRange)+0.5);
1187 mXlumi->setAxisTitle(
"#mu_{x} [cm]",2);
1188 mXlumi->getTH1()->SetOption(
"E1");
1189 mYlumi->setAxisTitle(
"Lumisection [#]",1);
1190 mYlumi->setAxisTitle(
"#mu_{y} [cm]",2);
1191 mYlumi->getTH1()->SetOption(
"E1");
1192 mZlumi->setAxisTitle(
"Lumisection [#]",1);
1193 mZlumi->setAxisTitle(
"#mu_{z} [cm]",2);
1194 mZlumi->getTH1()->SetOption(
"E1");
1196 sXlumi = ibooker.
book1D(
"C - sigmaX vs lumi",
"#sigma_{x} vs. Lumisection", nLumiXaxisRange, 0.5, ((
double)nLumiXaxisRange)+0.5);
1197 sYlumi = ibooker.
book1D(
"C - sigmaY vs lumi",
"#sigma_{y} vs. Lumisection", nLumiXaxisRange, 0.5, ((
double)nLumiXaxisRange)+0.5);
1198 sZlumi = ibooker.
book1D(
"C - sigmaZ vs lumi",
"#sigma_{z} vs. Lumisection", nLumiXaxisRange, 0.5, ((
double)nLumiXaxisRange)+0.5);
1200 sXlumi->setAxisTitle(
"#sigma_{x} [cm]",2);
1201 sXlumi->getTH1()->SetOption(
"E1");
1202 sYlumi->setAxisTitle(
"Lumisection [#]",1);
1203 sYlumi->setAxisTitle(
"#sigma_{y} [cm]",2);
1204 sYlumi->getTH1()->SetOption(
"E1");
1205 sZlumi->setAxisTitle(
"Lumisection [#]",1);
1206 sZlumi->setAxisTitle(
"#sigma_{z} [cm]",2);
1207 sZlumi->getTH1()->SetOption(
"E1");
1209 dxdzlumi = ibooker.
book1D(
"D - dxdz vs lumi",
"dX/dZ vs. Lumisection", nLumiXaxisRange, 0.5, ((
double)nLumiXaxisRange)+0.5);
1210 dydzlumi = ibooker.
book1D(
"D - dydz vs lumi",
"dY/dZ vs. Lumisection", nLumiXaxisRange, 0.5, ((
double)nLumiXaxisRange)+0.5);
1212 dxdzlumi->setAxisTitle(
"dX/dZ [rad]",2);
1213 dxdzlumi->getTH1()->SetOption(
"E1");
1214 dydzlumi->setAxisTitle(
"Lumisection [#]",1);
1215 dydzlumi->setAxisTitle(
"dY/dZ [rad]",2);
1216 dydzlumi->getTH1()->SetOption(
"E1");
1222 Vx_ZX->setAxisTitle(
"Primary Vertices X [cm]",2);
1223 Vx_ZX->setAxisTitle(
"Entries [#]",3);
1224 Vx_ZY->setAxisTitle(
"Primary Vertices Z [cm]",1);
1225 Vx_ZY->setAxisTitle(
"Primary Vertices Y [cm]",2);
1226 Vx_ZY->setAxisTitle(
"Entries [#]",3);
1227 Vx_XY->setAxisTitle(
"Primary Vertices X [cm]",1);
1228 Vx_XY->setAxisTitle(
"Primary Vertices Y [cm]",2);
1229 Vx_XY->setAxisTitle(
"Entries [#]",3);
1231 hitCounter = ibooker.
book1D(
"H - pixelHits vs lumi",
"# Pixel-Hits vs. Lumisection", nLumiXaxisRange, 0.5, ((
double)nLumiXaxisRange)+0.5);
1233 hitCounter->setAxisTitle(
"Pixel-Hits [#]",2);
1234 hitCounter->getTH1()->SetOption(
"E1");
1236 goodVxCounter = ibooker.
book1D(
"G - good vertices vs lumi",
"# Good vertices vs. Lumisection", nLumiXaxisRange, 0.5, ((
double)nLumiXaxisRange)+0.5);
1238 goodVxCounter->setAxisTitle(
"Good vertices [#]",2);
1239 goodVxCounter->getTH1()->SetOption(
"E1");
1241 statusCounter = ibooker.
book1D(
"I - app status vs lumi",
"Status vs. Lumisection", nLumiXaxisRange, 0.5, ((
double)nLumiXaxisRange)+0.5);
1243 statusCounter->setAxisTitle(
"App. status [0 = OK]",2);
1244 statusCounter->getTH1()->SetOption(
"E1");
1246 fitResults = ibooker.
book2D(
"A - fit results",
"Results of Beam Spot Fit", 2, 0., 2., 9, 0., 9.);
1248 fitResults->setBinLabel(9,
"X[cm]", 2);
1249 fitResults->setBinLabel(8,
"Y[cm]", 2);
1250 fitResults->setBinLabel(7,
"Z[cm]", 2);
1251 fitResults->setBinLabel(6,
"#sigma_{Z}[cm]", 2);
1252 fitResults->setBinLabel(5,
"#frac{dX}{dZ}[rad]", 2);
1253 fitResults->setBinLabel(4,
"#frac{dY}{dZ}[rad]", 2);
1254 fitResults->setBinLabel(3,
"#sigma_{X}[cm]", 2);
1255 fitResults->setBinLabel(2,
"#sigma_{Y}[cm]", 2);
1256 fitResults->setBinLabel(1,
"Vtx[#]", 2);
1257 fitResults->setBinLabel(1,
"Value", 1);
1258 fitResults->setBinLabel(2,
"Error (stat)", 1);
1259 fitResults->getTH1()->SetOption(
"text");
1264 reportSummary = ibooker.
bookFloat(
"reportSummary");
1265 reportSummary->
Fill(-1);
1266 reportSummaryMap = ibooker.
book2D(
"reportSummaryMap",
"Pixel-Vertices Beam Spot: % Good Fits", 1, 0., 1., 1, 0., 1.);
1267 reportSummaryMap->
getTH1()->SetBinContent(1, 1, -1);
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
int MyFit(std::vector< double > *vals)
data_type const * const_iterator
Timestamp const & beginTime() const
unsigned int HitCounter(const edm::Event &iEvent)
void writeToFile(std::vector< double > *vals, edm::TimeValue_t BeginTimeOfFit, edm::TimeValue_t EndTimeOfFit, unsigned int BeginLumiOfFit, unsigned int EndLumiOfFit, int dataType)
LuminosityBlockNumber_t luminosityBlock() const
double Gauss3DFunc(const double *par)
bool considerVxCovariance
T x() const
Cartesian x coordinate.
void endLuminosityBlock(const edm::LuminosityBlock &lumiBlock, const edm::EventSetup &iSetup)
static ELstring formatTime(const time_t t)
Vx3DHLTAnalyzer(const edm::ParameterSet &)
std::string formatTime(const time_t &t)
Timestamp const & endTime() const
MonitorElement * book1D(Args &&...args)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
LuminosityBlock const & getLuminosityBlock() const
void reset(std::string ResetType)
unsigned long long TimeValue_t
void beginLuminosityBlock(const edm::LuminosityBlock &lumiBlock, const edm::EventSetup &iSetup)
void analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup)
void setCurrentFolder(const std::string &fullpath)
MonitorElement * book2D(Args &&...args)
std::vector< std::vector< double > > tmp
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
void printFitParams(const std::vector< double > &fitResults)
static std::atomic< unsigned int > counter
std::vector< VertexType > Vertices
MonitorElement * bookFloat(Args &&...args)
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])
TimeValue_t value() const
Power< A, B >::type pow(const A &a, const B &b)