149 bool checkModuleIds(
const unsigned int,
const std::vector<unsigned int>&)
const;
173 bool inUintInterval(
const std::vector<unsigned int>&,
const unsigned int,
const unsigned int = 999)
const;
245 edm::LogError(
"SectorBuilder") <<
"TrackerTreeFile not found";
248 TTree* tkTree(
nullptr);
249 tkTreeFile->GetObject(
"TrackerTreeGenerator/TrackerTree/TrackerTree", tkTree);
253 edm::LogError(
"SectorBuilder") <<
"TrackerTree not found in file";
256 unsigned int rawId(999), subdetId(999), layer(999), side(999), half(999), rod(999),
ring(999), petal(999), blade(999),
257 panel(999), outerInner(999),
module(999), nStrips(999);
258 bool isDoubleSide(
false), isRPhi(
false), isStereo(
false);
259 int uDirection(999), vDirection(999), wDirection(999);
260 float posR(999.
F), posPhi(999.
F), posEta(999.
F),
posX(999.
F),
posY(999.
F), posZ(999.
F);
262 tkTree->SetBranchAddress(
"RawId", &rawId);
263 tkTree->SetBranchAddress(
"SubdetId", &subdetId);
264 tkTree->SetBranchAddress(
"Layer", &layer);
265 tkTree->SetBranchAddress(
"Side", &side);
266 tkTree->SetBranchAddress(
"Half", &half);
267 tkTree->SetBranchAddress(
"Rod", &rod);
268 tkTree->SetBranchAddress(
"Ring", &
ring);
269 tkTree->SetBranchAddress(
"Petal", &petal);
270 tkTree->SetBranchAddress(
"Blade", &blade);
271 tkTree->SetBranchAddress(
"Panel", &panel);
272 tkTree->SetBranchAddress(
"OuterInner", &outerInner);
273 tkTree->SetBranchAddress(
"Module", &
module);
274 tkTree->SetBranchAddress(
"NStrips", &nStrips);
275 tkTree->SetBranchAddress(
"IsDoubleSide", &isDoubleSide);
276 tkTree->SetBranchAddress(
"IsRPhi", &isRPhi);
277 tkTree->SetBranchAddress(
"IsStereo", &isStereo);
278 tkTree->SetBranchAddress(
"UDirection", &uDirection);
279 tkTree->SetBranchAddress(
"VDirection", &vDirection);
280 tkTree->SetBranchAddress(
"WDirection", &wDirection);
281 tkTree->SetBranchAddress(
"PosR", &posR);
282 tkTree->SetBranchAddress(
"PosPhi", &posPhi);
283 tkTree->SetBranchAddress(
"PosEta", &posEta);
284 tkTree->SetBranchAddress(
"PosX", &
posX);
285 tkTree->SetBranchAddress(
"PosY", &
posY);
286 tkTree->SetBranchAddress(
"PosZ", &posZ);
288 int nModules(tkTree->GetEntries());
292 unsigned int sectorCounter(0);
294 edm::LogInfo(
"SectorBuilder") <<
"There are " << v_sectorDef.size() <<
" Sectors definded";
295 for (
auto const& parSet : v_sectorDef) {
298 std::vector<unsigned int> v_rawId(parSet.getParameter<std::vector<unsigned int> >(
"rawId")),
299 v_subdetId(parSet.getParameter<std::vector<unsigned int> >(
"subdetId")),
300 v_layer(parSet.getParameter<std::vector<unsigned int> >(
"layer")),
301 v_side(parSet.getParameter<std::vector<unsigned int> >(
"side")),
302 v_half(parSet.getParameter<std::vector<unsigned int> >(
"half")),
303 v_rod(parSet.getParameter<std::vector<unsigned int> >(
"rod")),
304 v_ring(parSet.getParameter<std::vector<unsigned int> >(
"ring")),
305 v_petal(parSet.getParameter<std::vector<unsigned int> >(
"petal")),
306 v_blade(parSet.getParameter<std::vector<unsigned int> >(
"blade")),
307 v_panel(parSet.getParameter<std::vector<unsigned int> >(
"panel")),
308 v_outerInner(parSet.getParameter<std::vector<unsigned int> >(
"outerInner")),
309 v_module(parSet.getParameter<std::vector<unsigned int> >(
"module")),
310 v_nStrips(parSet.getParameter<std::vector<unsigned int> >(
"nStrips")),
311 v_isDoubleSide(parSet.getParameter<std::vector<unsigned int> >(
"isDoubleSide")),
312 v_isRPhi(parSet.getParameter<std::vector<unsigned int> >(
"isRPhi")),
313 v_isStereo(parSet.getParameter<std::vector<unsigned int> >(
"isStereo"));
314 std::vector<int> v_uDirection(parSet.getParameter<std::vector<int> >(
"uDirection")),
315 v_vDirection(parSet.getParameter<std::vector<int> >(
"vDirection")),
316 v_wDirection(parSet.getParameter<std::vector<int> >(
"wDirection"));
317 std::vector<double> v_posR(parSet.getParameter<std::vector<double> >(
"posR")),
318 v_posPhi(parSet.getParameter<std::vector<double> >(
"posPhi")),
319 v_posEta(parSet.getParameter<std::vector<double> >(
"posEta")),
320 v_posX(parSet.getParameter<std::vector<double> >(
"posX")),
321 v_posY(parSet.getParameter<std::vector<double> >(
"posY")),
322 v_posZ(parSet.getParameter<std::vector<double> >(
"posZ"));
333 tkSector.
name = sectorName;
341 if (sectorCounter == 1) {
401 tkSector.
v_rawId.push_back(rawId);
402 bool moduleSelected(
false);
403 for (
auto const& i_rawId : allSectors.v_rawId) {
404 if (rawId == i_rawId)
405 moduleSelected =
true;
408 allSectors.v_rawId.push_back(rawId);
413 for (
auto const& i_rawId : tkSector.
v_rawId) {
428 if (isPixel && isStrip) {
430 <<
"Incorrect Sector Definition: there are pixel and strip modules within one sector" 431 <<
"\n... sector selection is not applied, sector " << sectorCounter <<
" is not built";
437 edm::LogInfo(
"SectorBuilder") <<
"There are " << tkSector.
v_rawId.size() <<
" Modules in Sector " << sectorCounter;
448 if (v_id.size() % 2 == 1) {
450 <<
"Incorrect Sector Definition: Position Vectors need even number of arguments (Intervals)" 451 <<
"\n... sector selection is not applied, sector " << sectorCounter <<
" is not built";
455 double intervalBegin(999.);
456 for (
auto const& i_id : v_id) {
459 intervalBegin = i_id;
460 if (entry % 2 == 0 && intervalBegin > i_id) {
461 edm::LogError(
"SectorBuilder") <<
"Incorrect Sector Definition (Position Vector Intervals): \t" << intervalBegin
462 <<
" is bigger than " << i_id <<
" but is expected to be smaller" 463 <<
"\n... sector selection is not applied, sector " << sectorCounter
474 for (
auto const& i_id : v_id) {
484 for (
auto const& i_id : v_id) {
487 if (2 == i_id && !
id)
496 for (
auto const& i_id : v_id) {
507 double intervalBegin(999.);
508 for (
auto const& i_id : v_id) {
511 intervalBegin = i_id;
512 if (entry % 2 == 0 &&
id >= intervalBegin &&
id < i_id)
519 bool commonModules(
false);
520 for (std::map<unsigned int, TrackerSectorStruct>::const_iterator i_sector =
m_tkSector_.begin();
523 std::map<unsigned int, TrackerSectorStruct>::const_iterator i_sector2(i_sector);
524 for (++i_sector2; i_sector2 !=
m_tkSector_.end(); ++i_sector2) {
525 unsigned int nCommonModules(0);
526 for (
auto const& i_module : (*i_sector).second.v_rawId) {
527 for (
auto const& i_module2 : (*i_sector2).second.v_rawId) {
528 if (i_module2 == i_module)
532 if (nCommonModules == 0)
535 edm::LogError(
"SectorBuilder") <<
"Sector " << (*i_sector).first <<
" and Sector " << (*i_sector2).first
536 <<
" have " << nCommonModules <<
" Modules in common";
537 commonModules =
true;
541 if (static_cast<int>(allSectors.
v_rawId.size()) == nModules)
542 edm::LogInfo(
"SectorBuilder") <<
"ALL Tracker Modules are contained in the Sectors";
544 edm::LogWarning(
"SectorBuilder") <<
"There are " << allSectors.
v_rawId.size() <<
" Modules in all Sectors" 545 <<
" out of " << nModules <<
" Tracker Modules";
547 edm::LogInfo(
"SectorBuilder") <<
"There are ZERO modules associated to different sectors, no ambiguities exist";
550 <<
"There are modules associated to different sectors, APE value cannot be assigned reasonably";
557 if (v_residualErrorBinning.size() == 1) {
558 edm::LogError(
"ResidualErrorBinning") <<
"Incorrect selection of Residual Error Bins (used for APE calculation): \t" 559 <<
"Only one argument passed, so no interval is specified" 560 <<
"\n... delete whole bin selection";
564 unsigned int binCounter(-1);
565 for (
auto const& i_binning : v_residualErrorBinning) {
567 if (binCounter == 0) {
574 <<
"Incorrect selection of Residual Error Bins (used for APE calculation): \t" <<
xMin <<
" is bigger than " 575 << xMax <<
" but is expected to be smaller" 576 <<
"\n... delete whole bin selection";
585 <<
m_resErrBins_.size() <<
" Intervals of residual errors used for separate APE calculation sucessfully set";
592 for (std::vector<unsigned int>::iterator i_errHists = v_errHists.begin(); i_errHists != v_errHists.end();
594 for (std::vector<unsigned int>::iterator i_errHists2 = i_errHists; i_errHists2 != v_errHists.end();) {
596 if (*i_errHists == *i_errHists2) {
597 edm::LogError(
"BookSectorHists") <<
"Value of vErrHists in config exists twice: " << *i_errHists
598 <<
"\n... delete one of both";
599 v_errHists.erase(i_errHists2);
607 double widthMax = zoomHists ? 20. : 200.;
608 double chargePixelMax = zoomHists ? 200000. : 2000000.;
609 double chargeStripMax = zoomHists ? 1000. : 10000.;
610 double sOverNMax = zoomHists ? 200. : 2000.;
611 double logClusterProbMin = zoomHists ? -5. : -15.;
613 double resXAbsMax = zoomHists ? 0.5 : 5.;
614 double norResXAbsMax = zoomHists ? 10. : 50.;
615 double probXMin = zoomHists ? -0.01 : -0.1;
616 double probXMax = zoomHists ? 0.11 : 1.1;
617 double sigmaXMin = zoomHists ? 0. : -0.05;
618 double sigmaXMax = zoomHists ? 0.02 : 1.;
619 double sigmaX2Max = sigmaXMax *
sigmaXMax;
620 double sigmaXHitMax = zoomHists ? 0.02 : 1.;
621 double phiSensXMax = zoomHists ? 31. : 93.;
623 double norChi2Max = zoomHists ? 5. : 1000.;
624 double d0Max = zoomHists ? 0.02 : 40.;
625 double dzMax = zoomHists ? 15. : 100.;
626 double pMax = zoomHists ? 200. : 2000.;
627 double invPMax = zoomHists ? 0.05 : 10.;
634 std::stringstream sector;
635 sector <<
"Sector_" << i_sector.first;
639 i_sector.second.Name = secDir.
make<TH1F>(
"z_name", i_sector.second.name.c_str(), 1, 0, 1);
642 if (i_sector.second.v_rawId.empty()) {
646 i_sector.second.setCorrHistParams(&secDir, norResXAbsMax, sigmaXHitMax, sigmaXMax);
649 const bool pixelSector(i_sector.second.isPixel);
652 i_sector.second.m_correlationHistsX[
"WidthX"] = i_sector.second.bookCorrHistsX(
"WidthX",
656 static_cast<int>(widthMax),
657 static_cast<int>(widthMax),
661 i_sector.second.m_correlationHistsX[
"BaryStripX"] = i_sector.second.bookCorrHistsX(
662 "BaryStripX",
"barycenter of cluster charge",
"b_{cl,x}",
"[# channels]", 800, 100, -10., 790.,
"nph");
665 i_sector.second.m_correlationHistsY[
"WidthY"] = i_sector.second.bookCorrHistsY(
"WidthY",
669 static_cast<int>(widthMax),
670 static_cast<int>(widthMax),
674 i_sector.second.m_correlationHistsY[
"BaryStripY"] = i_sector.second.bookCorrHistsY(
675 "BaryStripY",
"barycenter of cluster charge",
"b_{cl,y}",
"[# channels]", 800, 100, -10., 790.,
"nph");
677 i_sector.second.m_correlationHistsX[
"ChargePixel"] = i_sector.second.bookCorrHistsX(
678 "ChargePixel",
"cluster charge",
"c_{cl}",
"[e]", 100, 50, 0., chargePixelMax,
"nph");
679 i_sector.second.m_correlationHistsX[
"ClusterProbXY"] = i_sector.second.bookCorrHistsX(
680 "ClusterProbXY",
"cluster probability xy",
"prob_{cl,xy}",
"", 100, 50, 0., 1.,
"nph");
681 i_sector.second.m_correlationHistsX[
"ClusterProbQ"] = i_sector.second.bookCorrHistsX(
682 "ClusterProbQ",
"cluster probability q",
"prob_{cl,q}",
"", 100, 50, 0., 1.,
"nph");
683 i_sector.second.m_correlationHistsX[
"ClusterProbXYQ"] = i_sector.second.bookCorrHistsX(
684 "ClusterProbXYQ",
"cluster probability xyq",
"prob_{cl,xyq}",
"", 100, 50, 0., 1.,
"nph");
685 i_sector.second.m_correlationHistsX[
"LogClusterProb"] = i_sector.second.bookCorrHistsX(
686 "LogClusterProb",
"cluster probability xy",
"log(prob_{cl,xy})",
"", 60, 30, logClusterProbMin, 0.,
"nph");
687 i_sector.second.m_correlationHistsX[
"IsOnEdge"] =
688 i_sector.second.bookCorrHistsX(
"IsOnEdge",
"IsOnEdge",
"isOnEdge",
"", 2, 2, 0, 2,
"nph");
689 i_sector.second.m_correlationHistsX[
"HasBadPixels"] =
690 i_sector.second.bookCorrHistsX(
"HasBadPixels",
"HasBadPixels",
"hasBadPixels",
"", 2, 2, 0, 2,
"nph");
691 i_sector.second.m_correlationHistsX[
"SpansTwoRoc"] =
692 i_sector.second.bookCorrHistsX(
"SpansTwoRoc",
"SpansTwoRoc",
"spansTwoRoc",
"", 2, 2, 0, 2,
"nph");
693 i_sector.second.m_correlationHistsX[
"QBin"] =
694 i_sector.second.bookCorrHistsX(
"QBin",
"q bin",
"q bin",
"", 8, 8, 0, 8,
"nph");
696 i_sector.second.m_correlationHistsY[
"ChargePixel"] = i_sector.second.bookCorrHistsY(
697 "ChargePixel",
"cluster charge",
"c_{cl}",
"[e]", 100, 50, 0., chargePixelMax,
"nph");
698 i_sector.second.m_correlationHistsY[
"ClusterProbXY"] = i_sector.second.bookCorrHistsY(
699 "ClusterProbXY",
"cluster probability xy",
"prob_{cl,xy}",
"", 100, 50, 0., 1.,
"nph");
700 i_sector.second.m_correlationHistsY[
"ClusterProbQ"] = i_sector.second.bookCorrHistsY(
701 "ClusterProbQ",
"cluster probability q",
"prob_{cl,q}",
"", 100, 50, 0., 1.,
"nph");
702 i_sector.second.m_correlationHistsY[
"ClusterProbXYQ"] = i_sector.second.bookCorrHistsY(
703 "ClusterProbXYQ",
"cluster probability xyq",
"prob_{cl,xyq}",
"", 100, 50, 0., 1.,
"nph");
704 i_sector.second.m_correlationHistsY[
"LogClusterProb"] = i_sector.second.bookCorrHistsY(
705 "LogClusterProb",
"cluster probability xy",
"log(prob_{cl,xy})",
"", 60, 30, logClusterProbMin, 0.,
"nph");
706 i_sector.second.m_correlationHistsY[
"IsOnEdge"] =
707 i_sector.second.bookCorrHistsY(
"IsOnEdge",
"IsOnEdge",
"isOnEdge",
"", 2, 2, 0, 2,
"nph");
708 i_sector.second.m_correlationHistsY[
"HasBadPixels"] =
709 i_sector.second.bookCorrHistsY(
"HasBadPixels",
"HasBadPixels",
"hasBadPixels",
"", 2, 2, 0, 2,
"nph");
710 i_sector.second.m_correlationHistsY[
"SpansTwoRoc"] =
711 i_sector.second.bookCorrHistsY(
"SpansTwoRoc",
"SpansTwoRoc",
"spansTwoRoc",
"", 2, 2, 0, 2,
"nph");
712 i_sector.second.m_correlationHistsY[
"QBin"] =
713 i_sector.second.bookCorrHistsY(
"QBin",
"q bin",
"q bin",
"", 8, 8, 0, 8,
"nph");
717 i_sector.second.m_correlationHistsX[
"ChargeStrip"] = i_sector.second.bookCorrHistsX(
718 "ChargeStrip",
"cluster charge",
"c_{cl}",
"[APV counts]", 100, 50, 0., chargeStripMax,
"nph");
719 i_sector.second.m_correlationHistsX[
"MaxStrip"] = i_sector.second.bookCorrHistsX(
720 "MaxStrip",
"strip with max. charge",
"n_{cl,max}",
"[# strips]", 800, 800, -10., 790.,
"npht");
721 i_sector.second.m_correlationHistsX[
"MaxCharge"] = i_sector.second.bookCorrHistsX(
722 "MaxCharge",
"charge of strip with max. charge",
"c_{cl,max}",
"[APV counts]", 300, 75, -10., 290.,
"nph");
723 i_sector.second.m_correlationHistsX[
"MaxIndex"] = i_sector.second.bookCorrHistsX(
724 "MaxIndex",
"cluster-index of strip with max. charge",
"i_{cl,max}",
"[# strips]", 10, 10, 0., 10.,
"nph");
725 i_sector.second.m_correlationHistsX[
"ChargeOnEdges"] =
726 i_sector.second.bookCorrHistsX(
"ChargeOnEdges",
727 "fraction of charge on edge strips",
728 "(c_{st,L}+c_{st,R})/c_{cl}",
735 i_sector.second.m_correlationHistsX[
"ChargeAsymmetry"] =
736 i_sector.second.bookCorrHistsX(
"ChargeAsymmetry",
737 "asymmetry of charge on edge strips",
738 "(c_{st,L}-c_{st,R})/c_{cl}",
745 i_sector.second.m_correlationHistsX[
"ChargeLRplus"] =
746 i_sector.second.bookCorrHistsX(
"ChargeLRplus",
747 "fraction of charge not on maxStrip",
748 "(c_{cl,L}+c_{cl,R})/c_{cl}",
755 i_sector.second.m_correlationHistsX[
"ChargeLRminus"] =
756 i_sector.second.bookCorrHistsX(
"ChargeLRminus",
757 "asymmetry of charge L and R of maxStrip",
758 "(c_{cl,L}-c_{cl,R})/c_{cl}",
765 i_sector.second.m_correlationHistsX[
"SOverN"] =
766 i_sector.second.bookCorrHistsX(
"SOverN",
"signal over noise",
"s/N",
"", 100, 50, 0, sOverNMax,
"nph");
767 i_sector.second.m_correlationHistsX[
"WidthProj"] = i_sector.second.bookCorrHistsX(
768 "WidthProj",
"projected width",
"w_{p}",
"[# strips]", 200, 20, 0., widthMax,
"nph");
769 i_sector.second.m_correlationHistsX[
"WidthDiff"] = i_sector.second.bookCorrHistsX(
"WidthDiff",
779 i_sector.second.WidthVsWidthProjected = secDir.
make<TH2F>(
"h2_widthVsWidthProj",
780 "w_{cl} vs. w_{p};w_{p} [# strips];w_{cl} [# strips]",
781 static_cast<int>(widthMax),
784 static_cast<int>(widthMax),
787 i_sector.second.PWidthVsWidthProjected =
788 secDir.
make<TProfile>(
"p_widthVsWidthProj",
789 "w_{cl} vs. w_{p};w_{p} [# strips];w_{cl} [# strips]",
790 static_cast<int>(widthMax),
794 i_sector.second.WidthDiffVsMaxStrip =
795 secDir.
make<TH2F>(
"h2_widthDiffVsMaxStrip",
796 "(w_{p} - w_{cl}) vs. n_{cl,max};n_{cl,max};w_{p} - w_{cl} [# strips]",
800 static_cast<int>(widthMax),
803 i_sector.second.PWidthDiffVsMaxStrip =
804 secDir.
make<TProfile>(
"p_widthDiffVsMaxStrip",
805 "(w_{p} - w_{cl}) vs. n_{cl,max};n_{cl,max};w_{p} - w_{cl} [# strips]",
810 i_sector.second.WidthDiffVsSigmaXHit =
811 secDir.
make<TH2F>(
"h2_widthDiffVsSigmaXHit",
812 "(w_{p} - w_{cl}) vs. #sigma_{hit,x};#sigma_{hit,x} [cm];w_{p} - w_{cl} [# strips]",
819 i_sector.second.PWidthDiffVsSigmaXHit =
820 secDir.
make<TProfile>(
"p_widthDiffVsSigmaXHit",
821 "(w_{p} - w_{cl}) vs. #sigma_{hit,x};#sigma_{hit,x} [cm];w_{p} - w_{cl} [# strips]",
826 i_sector.second.WidthVsPhiSensX =
827 secDir.
make<TH2F>(
"h2_widthVsPhiSensX",
828 "w_{cl} vs. #phi_{module,x};#phi_{module,x} [ ^{o}];w_{cl} [# strips]",
832 static_cast<int>(widthMax),
835 i_sector.second.PWidthVsPhiSensX = secDir.
make<TProfile>(
836 "p_widthVsPhiSensX",
"w_{cl} vs. #phi_{module,x};#phi_{module,x} [ ^{o}];w_{cl} [# strips]", 93, -93, 93);
840 i_sector.second.m_correlationHistsX[
"SigmaXHit"] = i_sector.second.bookCorrHistsX(
841 "SigmaXHit",
"hit error",
"#sigma_{hit,x}",
"[#mum]", 105, 20, sigmaXMin * 10000., sigmaXMax * 10000.,
"np");
842 i_sector.second.m_correlationHistsX[
"SigmaXTrk"] = i_sector.second.bookCorrHistsX(
843 "SigmaXTrk",
"track error",
"#sigma_{trk,x}",
"[#mum]", 105, 20, sigmaXMin * 10000., sigmaXMax * 10000.,
"np");
844 i_sector.second.m_correlationHistsX[
"SigmaX"] = i_sector.second.bookCorrHistsX(
845 "SigmaX",
"residual error",
"#sigma_{r,x}",
"[#mum]", 105, 20, sigmaXMin * 10000., sigmaXMax * 10000.,
"np");
846 i_sector.second.m_correlationHistsX[
"PhiSens"] = i_sector.second.bookCorrHistsX(
847 "PhiSens",
"track angle on sensor",
"#phi_{module}",
"[ ^{o}]", 96, 48, -3, 93,
"nphtr");
848 i_sector.second.m_correlationHistsX[
"PhiSensX"] = i_sector.second.bookCorrHistsX(
849 "PhiSensX",
"track angle on sensor",
"#phi_{module,x}",
"[ ^{o}]", 186, 93, -phiSensXMax, phiSensXMax,
"nphtr");
850 i_sector.second.m_correlationHistsX[
"PhiSensY"] = i_sector.second.bookCorrHistsX(
851 "PhiSensY",
"track angle on sensor",
"#phi_{module,y}",
"[ ^{o}]", 186, 93, -93, 93,
"nphtr");
853 i_sector.second.XHit = secDir.
make<TH1F>(
"h_XHit",
" hit measurement x_{hit};x_{hit} [cm];# hits", 100, -20, 20);
854 i_sector.second.XTrk = secDir.
make<TH1F>(
"h_XTrk",
"track prediction x_{trk};x_{trk} [cm];# hits", 100, -20, 20);
855 i_sector.second.SigmaX2 =
856 secDir.
make<TH1F>(
"h_SigmaX2",
857 "squared residual error #sigma_{r,x}^{2};#sigma_{r,x}^{2} [#mum^{2}];# hits",
860 sigmaX2Max * 10000. * 10000.);
861 i_sector.second.ResX = secDir.
make<TH1F>(
862 "h_ResX",
"residual r_{x};x_{trk}-x_{hit} [#mum];# hits", 100, -resXAbsMax * 10000., resXAbsMax * 10000.);
863 i_sector.second.NorResX =
864 secDir.
make<TH1F>(
"h_NorResX",
865 "normalized residual r_{x}/#sigma_{r,x};(x_{trk}-x_{hit})/#sigma_{r,x};# hits",
869 i_sector.second.ProbX = secDir.
make<TH1F>(
870 "h_ProbX",
"residual probability;prob(r_{x}^{2}/#sigma_{r,x}^{2},1);# hits", 60, probXMin, probXMax);
872 i_sector.second.PhiSensXVsBarycentreX =
873 secDir.
make<TH2F>(
"h2_phiSensXVsBarycentreX",
874 "#phi_{module,x} vs. b_{cl,x};b_{cl,x} [# channels];#phi_{module,x} [ ^{o}]",
881 i_sector.second.PPhiSensXVsBarycentreX =
882 secDir.
make<TProfile>(
"p_phiSensXVsBarycentreX",
883 "#phi_{module,x} vs. b_{cl,x};b_{cl,x} [# channels];#phi_{module,x} [ ^{o}]",
889 i_sector.second.m_correlationHistsY[
"SigmaYHit"] = i_sector.second.bookCorrHistsY(
890 "SigmaYHit",
"hit error",
"#sigma_{hit,y}",
"[#mum]", 105, 20, sigmaXMin * 10000., sigmaXMax * 10000.,
"np");
891 i_sector.second.m_correlationHistsY[
"SigmaYTrk"] = i_sector.second.bookCorrHistsY(
892 "SigmaYTrk",
"track error",
"#sigma_{trk,y}",
"[#mum]", 105, 20, sigmaXMin * 10000., sigmaXMax * 10000.,
"np");
893 i_sector.second.m_correlationHistsY[
"SigmaY"] = i_sector.second.bookCorrHistsY(
894 "SigmaY",
"residual error",
"#sigma_{r,y}",
"[#mum]", 105, 20, sigmaXMin * 10000., sigmaXMax * 10000.,
"np");
895 i_sector.second.m_correlationHistsY[
"PhiSens"] = i_sector.second.bookCorrHistsY(
896 "PhiSens",
"track angle on sensor",
"#phi_{module}",
"[ ^{o}]", 96, 48, -3, 93,
"nphtr");
897 i_sector.second.m_correlationHistsY[
"PhiSensX"] = i_sector.second.bookCorrHistsY(
"PhiSensX",
898 "track angle on sensor",
906 i_sector.second.m_correlationHistsY[
"PhiSensY"] = i_sector.second.bookCorrHistsY(
907 "PhiSensY",
"track angle on sensor",
"#phi_{module,y}",
"[ ^{o}]", 186, 93, -93, 93,
"nphtr");
909 i_sector.second.YHit = secDir.
make<TH1F>(
"h_YHit",
" hit measurement y_{hit};y_{hit} [cm];# hits", 100, -20, 20);
910 i_sector.second.YTrk = secDir.
make<TH1F>(
"h_YTrk",
"track prediction y_{trk};y_{trk} [cm];# hits", 100, -20, 20);
911 i_sector.second.SigmaY2 =
912 secDir.
make<TH1F>(
"h_SigmaY2",
913 "squared residual error #sigma_{r,y}^{2};#sigma_{r,y}^{2} [#mum^{2}];# hits",
916 sigmaX2Max * 10000. * 10000.);
917 i_sector.second.ResY = secDir.
make<TH1F>(
918 "h_ResY",
"residual r_{y};y_{trk}-y_{hit} [#mum];# hits", 100, -resXAbsMax * 10000., resXAbsMax * 10000.);
919 i_sector.second.NorResY =
920 secDir.
make<TH1F>(
"h_NorResY",
921 "normalized residual r_{y}/#sigma_{r,y};(y_{trk}-y_{hit})/#sigma_{r,y};# hits",
925 i_sector.second.ProbY = secDir.
make<TH1F>(
926 "h_ProbY",
"residual probability;prob(r_{y}^{2}/#sigma_{r,y}^{2},1);# hits", 60, probXMin, probXMax);
928 i_sector.second.PhiSensYVsBarycentreY =
929 secDir.
make<TH2F>(
"h2_phiSensYVsBarycentreY",
930 "#phi_{module,y} vs. b_{cl,y};b_{cl,y} [# channels];#phi_{module,y} [ ^{o}]",
937 i_sector.second.PPhiSensYVsBarycentreY =
938 secDir.
make<TProfile>(
"p_phiSensYVsBarycentreY",
939 "#phi_{module,y} vs. b_{cl,y};b_{cl,y} [# channels];#phi_{module,y} [ ^{o}]",
946 i_sector.second.m_correlationHistsX[
"HitsValid"] =
947 i_sector.second.bookCorrHistsX(
"HitsValid",
"# hits",
"[valid]", 50, 0, 50,
"npt");
948 i_sector.second.m_correlationHistsX[
"HitsInvalid"] =
949 i_sector.second.bookCorrHistsX(
"HitsInvalid",
"# hits",
"[invalid]", 20, 0, 20,
"npt");
950 i_sector.second.m_correlationHistsX[
"Hits2D"] =
951 i_sector.second.bookCorrHistsX(
"Hits2D",
"# hits",
"[2D]", 20, 0, 20,
"npt");
952 i_sector.second.m_correlationHistsX[
"LayersMissed"] =
953 i_sector.second.bookCorrHistsX(
"LayersMissed",
"# layers",
"[missed]", 10, 0, 10,
"npt");
954 i_sector.second.m_correlationHistsX[
"HitsPixel"] =
955 i_sector.second.bookCorrHistsX(
"HitsPixel",
"# hits",
"[pixel]", 10, 0, 10,
"npt");
956 i_sector.second.m_correlationHistsX[
"HitsStrip"] =
957 i_sector.second.bookCorrHistsX(
"HitsStrip",
"# hits",
"[strip]", 40, 0, 40,
"npt");
958 i_sector.second.m_correlationHistsX[
"HitsGood"] =
959 i_sector.second.bookCorrHistsX(
"HitsGood",
"# hits",
"[good]", 50, 0, 50,
"npt");
960 i_sector.second.m_correlationHistsX[
"NorChi2"] =
961 i_sector.second.bookCorrHistsX(
"NorChi2",
"#chi^{2}/f",
"", 50, 0, norChi2Max,
"npr");
962 i_sector.second.m_correlationHistsX[
"Theta"] =
963 i_sector.second.bookCorrHistsX(
"Theta",
"#theta",
"[ ^{o}]", 40, -10, 190,
"npt");
964 i_sector.second.m_correlationHistsX[
"Phi"] =
965 i_sector.second.bookCorrHistsX(
"Phi",
"#phi",
"[ ^{o}]", 76, -190, 190,
"npt");
966 i_sector.second.m_correlationHistsX[
"D0Beamspot"] =
967 i_sector.second.bookCorrHistsX(
"D0Beamspot",
"d_{0, BS}",
"[cm]", 40, -d0Max, d0Max,
"npt");
968 i_sector.second.m_correlationHistsX[
"Dz"] =
969 i_sector.second.bookCorrHistsX(
"Dz",
"d_{z}",
"[cm]", 40, -dzMax, dzMax,
"npt");
970 i_sector.second.m_correlationHistsX[
"Pt"] =
971 i_sector.second.bookCorrHistsX(
"Pt",
"p_{t}",
"[GeV]", 50, 0, pMax,
"npt");
972 i_sector.second.m_correlationHistsX[
"P"] = i_sector.second.bookCorrHistsX(
"P",
"|p|",
"[GeV]", 50, 0, pMax,
"npt");
973 i_sector.second.m_correlationHistsX[
"InvP"] =
974 i_sector.second.bookCorrHistsX(
"InvP",
"1/|p|",
"[GeV^{-1}]", 25, 0, invPMax,
"t");
975 i_sector.second.m_correlationHistsX[
"MeanAngle"] =
976 i_sector.second.bookCorrHistsX(
"MeanAngle",
"<#phi_{module}>",
"[ ^{o}]", 25, -5, 95,
"npt");
980 i_sector.second.m_correlationHistsY[
"HitsValid"] =
981 i_sector.second.bookCorrHistsY(
"HitsValid",
"# hits",
"[valid]", 50, 0, 50,
"npt");
982 i_sector.second.m_correlationHistsY[
"HitsInvalid"] =
983 i_sector.second.bookCorrHistsY(
"HitsInvalid",
"# hits",
"[invalid]", 20, 0, 20,
"npt");
984 i_sector.second.m_correlationHistsY[
"Hits2D"] =
985 i_sector.second.bookCorrHistsY(
"Hits2D",
"# hits",
"[2D]", 20, 0, 20,
"npt");
986 i_sector.second.m_correlationHistsY[
"LayersMissed"] =
987 i_sector.second.bookCorrHistsY(
"LayersMissed",
"# layers",
"[missed]", 10, 0, 10,
"npt");
988 i_sector.second.m_correlationHistsY[
"HitsPixel"] =
989 i_sector.second.bookCorrHistsY(
"HitsPixel",
"# hits",
"[pixel]", 10, 0, 10,
"npt");
990 i_sector.second.m_correlationHistsY[
"HitsStrip"] =
991 i_sector.second.bookCorrHistsY(
"HitsStrip",
"# hits",
"[strip]", 40, 0, 40,
"npt");
992 i_sector.second.m_correlationHistsY[
"HitsGood"] =
993 i_sector.second.bookCorrHistsY(
"HitsGood",
"# hits",
"[good]", 50, 0, 50,
"npt");
994 i_sector.second.m_correlationHistsY[
"NorChi2"] =
995 i_sector.second.bookCorrHistsY(
"NorChi2",
"#chi^{2}/f",
"", 50, 0, norChi2Max,
"npr");
996 i_sector.second.m_correlationHistsY[
"Theta"] =
997 i_sector.second.bookCorrHistsY(
"Theta",
"#theta",
"[ ^{o}]", 40, -10, 190,
"npt");
998 i_sector.second.m_correlationHistsY[
"Phi"] =
999 i_sector.second.bookCorrHistsY(
"Phi",
"#phi",
"[ ^{o}]", 76, -190, 190,
"npt");
1000 i_sector.second.m_correlationHistsY[
"D0Beamspot"] =
1001 i_sector.second.bookCorrHistsY(
"D0Beamspot",
"d_{0, BS}",
"[cm]", 40, -d0Max, d0Max,
"npt");
1002 i_sector.second.m_correlationHistsY[
"Dz"] =
1003 i_sector.second.bookCorrHistsY(
"Dz",
"d_{z}",
"[cm]", 40, -dzMax, dzMax,
"npt");
1004 i_sector.second.m_correlationHistsY[
"Pt"] =
1005 i_sector.second.bookCorrHistsY(
"Pt",
"p_{t}",
"[GeV]", 50, 0, pMax,
"npt");
1006 i_sector.second.m_correlationHistsY[
"P"] =
1007 i_sector.second.bookCorrHistsY(
"P",
"|p|",
"[GeV]", 50, 0, pMax,
"npt");
1008 i_sector.second.m_correlationHistsY[
"InvP"] =
1009 i_sector.second.bookCorrHistsY(
"InvP",
"1/|p|",
"[GeV^{-1}]", 25, 0, invPMax,
"t");
1010 i_sector.second.m_correlationHistsY[
"MeanAngle"] =
1011 i_sector.second.bookCorrHistsY(
"MeanAngle",
"<#phi_{module}>",
"[ ^{o}]", 25, -5, 95,
"npt");
1015 for (
auto const& i_errHists : v_errHists) {
1016 double xMin(0.01 * (i_errHists - 1)),
xMax(0.01 * (i_errHists));
1017 std::stringstream sigmaXHit, sigmaXTrk,
sigmaX;
1018 sigmaXHit <<
"h_sigmaXHit_" << i_errHists;
1019 sigmaXTrk <<
"h_sigmaXTrk_" << i_errHists;
1020 sigmaX <<
"h_sigmaX_" << i_errHists;
1021 i_sector.second.m_sigmaX[
"sigmaXHit"].push_back(
1022 secDir.
make<TH1F>(sigmaXHit.str().c_str(),
1023 "hit error #sigma_{hit,x};#sigma_{hit,x} [#mum];# hits",
1027 i_sector.second.m_sigmaX[
"sigmaXTrk"].push_back(
1028 secDir.
make<TH1F>(sigmaXTrk.str().c_str(),
1029 "track error #sigma_{trk,x};#sigma_{trk,x} [#mum];# hits",
1033 i_sector.second.m_sigmaX[
"sigmaX"].push_back(
1034 secDir.
make<TH1F>(sigmaX.str().c_str(),
1035 "residual error #sigma_{r,x};#sigma_{r,x} [#mum];# hits",
1040 std::stringstream sigmaYHit, sigmaYTrk,
sigmaY;
1041 sigmaYHit <<
"h_sigmaYHit_" << i_errHists;
1042 sigmaYTrk <<
"h_sigmaYTrk_" << i_errHists;
1043 sigmaY <<
"h_sigmaY_" << i_errHists;
1044 i_sector.second.m_sigmaY[
"sigmaYHit"].push_back(
1045 secDir.
make<TH1F>(sigmaYHit.str().c_str(),
1046 "hit error #sigma_{hit,y};#sigma_{hit,y} [#mum];# hits",
1050 i_sector.second.m_sigmaY[
"sigmaYTrk"].push_back(
1051 secDir.
make<TH1F>(sigmaYTrk.str().c_str(),
1052 "track error #sigma_{trk,y};#sigma_{trk,y} [#mum];# hits",
1056 i_sector.second.m_sigmaY[
"sigmaY"].push_back(
1057 secDir.
make<TH1F>(sigmaY.str().c_str(),
1058 "residual error #sigma_{r,y};#sigma_{r,y} [#mum];# hits",
1069 for (std::vector<unsigned int>::iterator i_errHists = v_errHists.begin(); i_errHists != v_errHists.end();
1071 for (std::vector<unsigned int>::iterator i_errHists2 = i_errHists; i_errHists2 != v_errHists.end();) {
1073 if (*i_errHists == *i_errHists2) {
1074 edm::LogError(
"BookSectorHists") <<
"Value of vErrHists in config exists twice: " << *i_errHists
1075 <<
"\n... delete one of both";
1076 v_errHists.erase(i_errHists2);
1087 std::stringstream sector;
1088 sector <<
"Sector_" << i_sector.first;
1092 i_sector.second.Name = secDir.
make<TH1F>(
"z_name", i_sector.second.name.c_str(), 1, 0, 1);
1095 if (i_sector.second.v_rawId.empty()) {
1106 std::stringstream interval;
1107 interval <<
"Interval_" << i_errBins.first;
1109 i_sector.second.m_binnedHists[i_errBins.first][
"sigmaX"] =
1110 intDir.
make<TH1F>(
"h_sigmaX",
"residual resolution #sigma_{x};#sigma_{x} [cm];# hits", 100, 0., 0.01);
1111 i_sector.second.m_binnedHists[i_errBins.first][
"norResX"] = intDir.
make<TH1F>(
1112 "h_norResX",
"normalized residual r_{x}/#sigma_{r,x};(x_{trk}-x_{hit})/#sigma_{r,x};# hits", 100, -10, 10);
1113 if (i_sector.second.isPixel) {
1114 i_sector.second.m_binnedHists[i_errBins.first][
"sigmaY"] =
1115 intDir.
make<TH1F>(
"h_sigmaY",
"residual resolution #sigma_{y};#sigma_{y} [cm];# hits", 100, 0., 0.01);
1116 i_sector.second.m_binnedHists[i_errBins.first][
"norResY"] = intDir.
make<TH1F>(
1117 "h_norResY",
"normalized residual r_{y}/#sigma_{r,y};(y_{trk}-y_{hit})/#sigma_{r,y};# hits", 100, -10, 10);
1124 unsigned int rawId(0);
1125 i_sector.second.RawId = resDir.make<TTree>(
"rawIdTree",
"Tree containing rawIds of all modules in sector");
1126 i_sector.second.RawId->Branch(
"RawId", &rawId,
"RawId/i");
1127 for (
auto const& i_rawId : i_sector.second.v_rawId) {
1129 i_sector.second.RawId->Fill();
1135 for (
auto& i_binX : v_binX) {
1138 i_sector.second.EntriesX =
1139 resDir.make<TH1F>(
"h_entriesX",
"# hits used;#sigma_{x} [#mum];# hits", v_binX.size() - 1, &(v_binX[0]));
1140 if (i_sector.second.isPixel) {
1141 i_sector.second.EntriesY =
1142 resDir.make<TH1F>(
"h_entriesY",
"# hits used;#sigma_{y} [#mum];# hits", v_binX.size() - 1, &(v_binX[0]));
1147 i_sector.second.ResX = resDir.make<TH1F>(
1148 "h_ResX",
"residual r_{x};x_{trk}-x_{hit} [#mum];# hits", 100, -0.03 * 10000., 0.03 * 10000.);
1149 i_sector.second.NorResX = resDir.make<TH1F>(
1150 "h_NorResX",
"normalized residual r_{x}/#sigma_{r,x};(x_{trk}-x_{hit})/#sigma_{r,x};# hits", 100, -5., 5.);
1151 if (i_sector.second.isPixel) {
1152 i_sector.second.ResY = resDir.make<TH1F>(
1153 "h_ResY",
"residual r_{y};y_{trk}-y_{hit} [#mum];# hits", 100, -0.03 * 10000., 0.03 * 10000.);
1154 i_sector.second.NorResY = resDir.make<TH1F>(
1155 "h_NorResY",
"normalized residual r_{y}/#sigma_{r,y};(y_{trk}-y_{hit})/#sigma_{r,y};# hits", 100, -5., 5.);
1165 int trackSizeBins = zoomHists ? 6 : 201;
1166 double trackSizeMax = trackSizeBins - 1;
1168 double chi2Max = zoomHists ? 100. : 2000.;
1169 double norChi2Max = zoomHists ? 5. : 1000.;
1170 double d0max = zoomHists ? 0.02 : 40.;
1171 double dzmax = zoomHists ? 15. : 100.;
1172 double pMax = zoomHists ? 200. : 2000.;
1177 evtDir.
make<TH1F>(
"h_trackSize",
"# tracks [all];# tracks;# events", trackSizeBins, -1, trackSizeMax);
1179 evtDir.
make<TH1F>(
"h_trackSizeGood",
"# tracks [good];# tracks;# events", trackSizeBins, -1, trackSizeMax);
1181 tkDetector_.
HitsSize = trkDir.make<TH1F>(
"h_hitsSize",
"# hits;# hits;# tracks", 51, -1, 50);
1182 tkDetector_.
HitsValid = trkDir.make<TH1F>(
"h_hitsValid",
"# hits [valid];# hits [valid];# tracks", 51, -1, 50);
1184 trkDir.make<TH1F>(
"h_hitsInvalid",
"# hits [invalid];# hits [invalid];# tracks", 21, -1, 20);
1185 tkDetector_.
Hits2D = trkDir.make<TH1F>(
"h_hits2D",
"# hits [2D];# hits [2D];# tracks", 21, -1, 20);
1187 trkDir.make<TH1F>(
"h_layersMissed",
"# layers [missed];# layers [missed];# tracks", 11, -1, 10);
1188 tkDetector_.
HitsPixel = trkDir.make<TH1F>(
"h_hitsPixel",
"# hits [pixel];# hits [pixel];# tracks", 11, -1, 10);
1189 tkDetector_.
HitsStrip = trkDir.make<TH1F>(
"h_hitsStrip",
"# hits [strip];# hits [strip];# tracks", 41, -1, 40);
1190 tkDetector_.
Charge = trkDir.make<TH1F>(
"h_charge",
"charge q;q [e];# tracks", 5, -2, 3);
1192 tkDetector_.
Ndof = trkDir.make<TH1F>(
"h_ndof",
"# degrees of freedom f;f;# tracks", 101, -1, 100);
1193 tkDetector_.
NorChi2 = trkDir.make<TH1F>(
"h_norChi2",
"normalized #chi^{2};#chi^{2}/f;# tracks", 200, 0, norChi2Max);
1194 tkDetector_.
Prob = trkDir.make<TH1F>(
"h_prob",
" #chi^{2} probability;prob(#chi^{2},f);# tracks", 50, 0, 1);
1195 tkDetector_.
Eta = trkDir.make<TH1F>(
"h_eta",
"pseudorapidity #eta;#eta;# tracks", 100, -5, 5);
1196 tkDetector_.
EtaErr = trkDir.make<TH1F>(
"h_etaErr",
"Error of #eta;#sigma(#eta);# tracks", 100, 0, 0.001);
1198 trkDir.make<TH1F>(
"h_etaSig",
"Significance of #eta;#eta/#sigma(#eta);# tracks", 100, -20000, 20000);
1199 tkDetector_.
Theta = trkDir.make<TH1F>(
"h_theta",
"polar angle #theta;#theta [ ^{o}];# tracks", 100, -10, 190);
1200 tkDetector_.
Phi = trkDir.make<TH1F>(
"h_phi",
"azimuth angle #phi;#phi [ ^{o}];# tracks", 190, -190, 190);
1201 tkDetector_.
PhiErr = trkDir.make<TH1F>(
"h_phiErr",
"Error of #phi;#sigma(#phi) [ ^{o}];# tracks", 100, 0, 0.04);
1203 trkDir.make<TH1F>(
"h_phiSig",
"Significance of #phi;#phi/#sigma(#phi) [ ^{o}];# tracks", 100, -50000, 50000);
1205 "h_d0Beamspot",
"Closest approach d_{0} wrt. beamspot;d_{0, BS} [cm];# tracks", 200, -d0max, d0max);
1207 trkDir.make<TH1F>(
"h_d0BeamspotErr",
"Error of d_{0, BS};#sigma(d_{0, BS}) [cm];# tracks", 200, 0, 0.01);
1209 "h_d0BeamspotSig",
"Significance of d_{0, BS};d_{0, BS}/#sigma(d_{0, BS});# tracks", 100, -5, 5);
1210 tkDetector_.
Dz = trkDir.make<TH1F>(
"h_dz",
"Closest approach d_{z};d_{z} [cm];# tracks", 200, -dzmax, dzmax);
1211 tkDetector_.
DzErr = trkDir.make<TH1F>(
"h_dzErr",
"Error of d_{z};#sigma(d_{z}) [cm];# tracks", 200, 0, 0.01);
1213 trkDir.make<TH1F>(
"h_dzSig",
"Significance of d_{z};d_{z}/#sigma(d_{z});# tracks", 100, -10000, 10000);
1214 tkDetector_.
Pt = trkDir.make<TH1F>(
"h_pt",
"transverse momentum p_{t};p_{t} [GeV];# tracks", 100, 0,
pMax);
1215 tkDetector_.
PtErr = trkDir.make<TH1F>(
"h_ptErr",
"Error of p_{t};#sigma(p_{t}) [GeV];# tracks", 100, 0, 1.6);
1216 tkDetector_.
PtSig = trkDir.make<TH1F>(
"h_ptSig",
"Significance of p_{t};p_{t}/#sigma(p_{t});# tracks", 100, 0, 200);
1217 tkDetector_.
P = trkDir.make<TH1F>(
"h_p",
"momentum magnitude |p|;|p| [GeV];# tracks", 100, 0,
pMax);
1219 "h_meanAngle",
"mean angle on module <#phi_{module}>;<#phi_{module}> [ ^{o}];# tracks", 100, -5, 95);
1220 tkDetector_.
HitsGood = trkDir.make<TH1F>(
"h_hitsGood",
"# hits [good];# hits [good];# tracks", 51, -1, 50);
1223 "h2_meanAngleVsHits",
"<#phi_{module}> vs. # hits;# hits;<#phi_{module}> [ ^{o}]", 51, -1, 50, 50, -5, 95);
1225 trkDir.make<TH2F>(
"h2_hitsGoodVsHitsValid",
1226 "# hits [good] vs. # hits [valid];# hits [valid];# hits [good]",
1234 trkDir.make<TH2F>(
"h2_hitsPixelVsEta",
"# hits [pixel] vs. #eta;#eta;# hits [pixel]", 60, -3, 3, 11, -1, 10);
1236 "h2_hitsPixelVsTheta",
"# hits [pixel] vs. #theta;#theta;# hits [pixel]", 100, -10, 190, 11, -1, 10);
1238 trkDir.make<TH2F>(
"h2_hitsStripVsEta",
"# hits [strip] vs. #eta;#eta;# hits [strip]", 60, -3, 3, 31, -1, 40);
1240 "h2_hitsStripVsTheta",
"# hits [strip] vs. #theta;#theta;# hits [strip]", 100, -10, 190, 31, -1, 40);
1241 tkDetector_.
PtVsEta = trkDir.make<TH2F>(
"h2_ptVsEta",
"p_{t} vs. #eta;#eta;p_{t} [GeV]", 60, -3, 3, 100, 0,
pMax);
1243 trkDir.make<TH2F>(
"h2_ptVsTheta",
"p_{t} vs. #theta;#theta;p_{t} [GeV]", 100, -10, 190, 100, 0,
pMax);
1246 "p_meanAngleVsHits",
"<#phi_{module}> vs. # hits;# hits;<#phi_{module}> [ ^{o}]", 51, -1, 50);
1248 "p_hitsGoodVsHitsValid",
"# hits [good] vs. # hits [valid];# hits [valid];# hits [good]", 51, -1, 50);
1250 trkDir.make<TProfile>(
"p_hitsPixelVsEta",
"# hits [pixel] vs. #eta;#eta;# hits [pixel]", 60, -3, 3);
1252 trkDir.make<TProfile>(
"p_hitsPixelVsTheta",
"# hits [pixel] vs. #theta;#theta;# hits [pixel]", 100, -10, 190);
1254 trkDir.make<TProfile>(
"p_hitsStripVsEta",
"# hits [strip] vs. #eta;#eta;# hits [strip]", 60, -3, 3);
1256 trkDir.make<TProfile>(
"p_hitsStripVsTheta",
"# hits [strip] vs. #theta;#theta;# hits [strip]", 100, -10, 190);
1257 tkDetector_.
PPtVsEta = trkDir.make<TProfile>(
"p_ptVsEta",
"p_{t} vs. #eta;#eta;p_{t} [GeV]", 60, -3, 3);
1258 tkDetector_.
PPtVsTheta = trkDir.make<TProfile>(
"p_ptVsTheta",
"p_{t} vs. #theta;#theta;p_{t} [GeV]", 100, -10, 190);
1267 double d0BeamspotErr =
1278 trkParams.hitsValid = track.
found();
1279 trkParams.hitsInvalid = trkParams.hitsSize - trkParams.hitsValid;
1280 trkParams.layersMissed =
1282 trkParams.hitsPixel = hitPattern.numberOfValidPixelHits();
1283 trkParams.hitsStrip = hitPattern.numberOfValidStripHits();
1284 trkParams.charge = track.
charge();
1285 trkParams.chi2 = track.
chi2();
1286 trkParams.ndof = track.
ndof();
1287 trkParams.norChi2 = trkParams.chi2 / trkParams.ndof;
1288 trkParams.prob = TMath::Prob(trkParams.chi2, trkParams.ndof);
1289 trkParams.eta = track.
eta();
1290 trkParams.etaErr = track.
etaError();
1291 trkParams.theta = track.
theta();
1292 trkParams.phi = track.
phi();
1293 trkParams.phiErr = track.
phiError();
1294 trkParams.d0 = track.
d0();
1295 trkParams.d0Beamspot = -1. * track.
dxy(beamPoint);
1296 trkParams.d0BeamspotErr = d0BeamspotErr;
1297 trkParams.dz = track.
dz();
1298 trkParams.dzErr = track.
dzError();
1299 trkParams.dzBeamspot = track.
dz(beamPoint);
1300 trkParams.p = track.
p();
1301 trkParams.pt = track.
pt();
1302 trkParams.ptErr = track.
ptError();
1304 const std::vector<TrajectoryMeasurement>& v_meas = traj.
measurements();
1307 float meanPhiSensToNorm(0.
F);
1308 for (
auto const& i_meas : v_meas) {
1317 meanPhiSensToNorm += atan(fabs(
sqrt(mom.x() * mom.x() + mom.y() * mom.y()) / mom.z()));
1319 meanPhiSensToNorm *= (1. /
static_cast<float>(trkParams.hitsSize));
1321 trkParams.hits2D = count2D;
1322 trkParams.meanPhiSensToNorm = meanPhiSensToNorm;
1326 if (trkParams.hitsStrip < 11 || trkParams.hits2D < 2 || trkParams.hitsPixel < 2 ||
1327 trkParams.hitsStrip > 35 || trkParams.hitsPixel > 7 || trkParams.norChi2 > 5. || trkParams.pt < 25. ||
1328 trkParams.pt > 150. ||
std::abs(trkParams.d0Beamspot) > 0.02 ||
std::abs(trkParams.dz) > 15.)
1354 const uint32_t rawId(detId.rawId());
1357 for (
auto const& i_rawId : i_sector.second.v_rawId) {
1358 if (rawId == i_rawId) {
1359 hitParams.
v_sector.push_back(i_sector.first);
1366 int xMomentum(0), yMomentum(0), zMomentum(0);
1367 xMomentum = mom.x() > 0. ? 1 : -1;
1368 yMomentum = mom.y() > 0. ? 1 : -1;
1369 zMomentum = mom.z() > 0. ? 1 : -1;
1371 std::atan(std::fabs(mom.x() / mom.z())) *
1374 float phiSensY = std::atan(std::fabs(mom.y() / mom.z())) *
static_cast<float>(
m_tkTreeVar_[rawId].vDirection);
1375 hitParams.
phiSens = std::atan(std::fabs(
std::sqrt(mom.x() * mom.x() + mom.y() * mom.y()) / mom.z()));
1376 hitParams.
phiSensX = (xMomentum == zMomentum ? phiSensX : -phiSensX);
1377 hitParams.
phiSensY = (yMomentum == zMomentum ? phiSensY : -phiSensY);
1406 edm::LogWarning(
"FillHitVariables") <<
"cant identify wether hit is from pixel or strip";
1418 if (!dynamic_cast<const PixelTopology*>(&detUnit.
type().
topology())) {
1425 errorWithoutAPE =
LocalError(errHitApe.
xx() - lape.
xx(), errHitApe.
xy() - lape.
xy(), errHitApe.
yy() - lape.
yy());
1429 if (!dynamic_cast<const StripTopology*>(&detUnit.
type().
topology())) {
1436 errorWithoutAPE =
LocalError(errHitApe.
xx() - lape.
xx(), errHitApe.
xy() - lape.
xy(), errHitApe.
yy() - lape.
yy());
1440 const LocalError& errHitWoApe = errorWithoutAPE;
1445 edm::LogInfo(
"CalculateAPE") <<
"errHitWoApe " << errHitWoApe <<
"errHitApe " << errHitApe;
1472 const float xHit = positionAndError2Hit.second.posX;
1473 const float xTrk = positionAndError2Trk.second.posX;
1474 const float yHit = positionAndError2Hit.second.posY;
1475 const float yTrk = positionAndError2Trk.second.posY;
1477 const float errXHit2(positionAndError2Hit.second.errX2);
1478 const float errXHitWoApe2(positionAndError2HitWoApe.second.errX2);
1479 const float errXTrk2(positionAndError2Trk.second.errX2);
1480 const float errYHit2(positionAndError2Hit.second.errY2);
1481 const float errYHitWoApe2(positionAndError2HitWoApe.second.errY2);
1482 const float errYTrk2(positionAndError2Trk.second.errY2);
1484 const float errXHit =
std::sqrt(positionAndError2Hit.second.errX2);
1485 const float errXHitWoApe =
std::sqrt(positionAndError2HitWoApe.second.errX2);
1486 const float errXTrk =
std::sqrt(positionAndError2Trk.second.errX2);
1487 const float errYHit =
std::sqrt(positionAndError2Hit.second.errY2);
1488 const float errYHitWoApe =
std::sqrt(positionAndError2HitWoApe.second.errY2);
1489 const float errYTrk =
std::sqrt(positionAndError2Trk.second.errY2);
1491 const float resX = xTrk - xHit;
1492 const float resY = yTrk - yHit;
1495 const float errXWoApe2 = errXHitWoApe2 + errXTrk2;
1496 const float errXWoApe =
std::sqrt(errXWoApe2);
1498 const float errYWoApe2 = errYHitWoApe2 + errYTrk2;
1499 const float errYWoApe =
std::sqrt(errYWoApe2);
1501 const float norResX = resX /
errX;
1502 const float norResY = resY /
errY;
1506 float resXprime(999.
F), resYprime(999.
F), norResXprime(999.
F), norResYprime(999.
F);
1509 norResXprime = norResX;
1512 norResXprime = -norResX;
1514 edm::LogError(
"FillHitVariables") <<
"Incorrect value of uDirection, which gives global module orientation";
1520 norResYprime = norResY;
1523 norResYprime = -norResY;
1525 edm::LogError(
"FillHitVariables") <<
"Incorrect value of vDirection, which gives global module orientation";
1530 hitParams.
xHit = xHit;
1531 hitParams.
xTrk = xTrk;
1541 hitParams.
resX = resXprime;
1542 hitParams.
norResX = norResXprime;
1544 const float norResX2(norResXprime * norResXprime);
1545 hitParams.
probX = TMath::Prob(norResX2, 1);
1547 hitParams.
yHit = yHit;
1548 hitParams.
yTrk = yTrk;
1558 hitParams.
resY = resYprime;
1559 hitParams.
norResY = norResYprime;
1561 const float norResY2(norResYprime * norResYprime);
1562 hitParams.
probY = TMath::Prob(norResY2, 1);
1592 if (!(dynamic_cast<const SiStripRecHit2D*>(&recHit) || dynamic_cast<const SiStripRecHit1D*>(&recHit))) {
1594 <<
"RecHit in Strip is 'Matched' or 'Projected', but here all should be monohits per module";
1601 if (dynamic_cast<const SiStripRecHit1D*>(&recHit)) {
1603 clusterPtr = &(*stripHit.
cluster());
1604 }
else if (dynamic_cast<const SiStripRecHit2D*>(&recHit)) {
1605 edm::LogWarning(
"FillHitVariables") <<
"Data has TIB/TOB hits as SiStripRecHit2D and not 1D. Probably data is " 1606 "processed with CMSSW<34X. Nevertheless everything should work fine";
1608 clusterPtr = &(*stripHit.
cluster());
1613 clusterPtr = &(*stripHit.
cluster());
1616 edm::LogError(
"FillHitVariables") <<
"Pointer to cluster not valid!!! This should never happen...";
1624 const std::vector<uint8_t>::const_iterator stripChargeL(clusterInfo.
stripCharges().begin());
1625 const std::vector<uint8_t>::const_iterator stripChargeR(--(clusterInfo.
stripCharges().end()));
1626 const std::pair<uint16_t, uint16_t> stripChargeLR = std::make_pair(*stripChargeL, *stripChargeR);
1637 static_cast<float>(stripChargeLR.first + stripChargeLR.second) / static_cast<float>(hitParams.
chargeStrip);
1638 hitParams.
chargeAsymmetry =
static_cast<float>(stripChargeLR.first - stripChargeLR.second) /
1639 static_cast<float>(stripChargeLR.first + stripChargeLR.second);
1652 if (!dynamic_cast<const StripTopology*>(&detUnit.
type().
topology())) {
1669 float dirX = -tanLorentzAnglePerTesla * bField.y();
1670 float dirY = tanLorentzAnglePerTesla * bField.x();
1682 if (momentumDir.z() > 0.)
1683 scaledMomentumDir *= std::fabs(thickness / momentumDir.z());
1684 else if (momentumDir.z() < 0.)
1685 scaledMomentumDir *= -std::fabs(thickness / momentumDir.z());
1687 scaledMomentumDir *= maxLength / momentumDir.mag();
1700 float coveredStrips = std::fabs(projEdge2 - projEdge1);
1705 edm::LogError(
"FillHitVariables") <<
"Incorrect subdetector ID, hit not associated to tracker";
1730 const uint32_t& rawId(detId.rawId());
1731 const unsigned int& subdetId(
m_tkTreeVar_[rawId].subdetId);
1733 if (localError.
xx() < 0. || localError.
yy() < 0.) {
1753 if (!dynamic_cast<const RadialStripTopology*>(&detUnit.
type().
topology()))
1758 if (measError.
uu() < 0. || measError.
vv() < 0.) {
1773 edm::LogError(
"FillHitVariables") <<
"Incorrect subdetector ID, hit not associated to tracker";
1780 const float x(lP.
x());
1781 const float y(lP.
y());
1782 const float errX2(lE.
xx());
1783 const float errY2(lE.
yy());
1800 float errX2(-999.
F);
1801 float errY2(-999.
F);
1805 const float l_0 = r_0 - topol.
detHeight() / 2;
1807 y = measPos.
y() * stripLength - 0.5 * stripLength + l_0 * (1. / cosPhi - 1.);
1810 const float errPhi2(measErr.
uu() * angularWidth2);
1812 errX2 = errPhi2 * r_0 * r_0;
1815 const float helpSummand = l_0 * l_0 * (sinPhi2 / cosPhi4 * errPhi2);
1816 errY2 = measErr.
vv() * stripLength * stripLength + helpSummand;
1871 edm::LogInfo(
"HitSelector") <<
"applying hit cuts ...";
1872 bool emptyMap(
true);
1874 if (!i_hitSelection.second.empty()) {
1876 double intervalBegin(999.);
1877 for (std::vector<double>::iterator i_hitInterval = i_hitSelection.second.begin();
1878 i_hitInterval != i_hitSelection.second.end();
1880 if (entry % 2 == 1) {
1881 intervalBegin = *i_hitInterval;
1884 if (intervalBegin > *i_hitInterval) {
1885 edm::LogError(
"HitSelector") <<
"INVALID Interval selected for " << i_hitSelection.first <<
":\t" 1886 << intervalBegin <<
" > " << (*i_hitInterval) <<
"\n ... delete Selection for " 1887 << i_hitSelection.first;
1888 i_hitSelection.second.clear();
1889 i_hitInterval = i_hitSelection.second.begin();
1891 edm::LogInfo(
"HitSelector") <<
"Interval selected for " << i_hitSelection.first <<
":\t" << intervalBegin
1892 <<
", " << (*i_hitInterval);
1897 if (!i_hitSelection.second.empty())
1902 bool emptyMapUInt(
true);
1904 if (!i_hitSelection.second.empty()) {
1906 unsigned int intervalBegin(999);
1907 for (std::vector<unsigned int>::iterator i_hitInterval = i_hitSelection.second.begin();
1908 i_hitInterval != i_hitSelection.second.end();
1910 if (entry % 2 == 1) {
1911 intervalBegin = *i_hitInterval;
1914 if (intervalBegin > *i_hitInterval) {
1915 edm::LogError(
"HitSelector") <<
"INVALID Interval selected for " << i_hitSelection.first <<
":\t" 1916 << intervalBegin <<
" > " << (*i_hitInterval) <<
"\n ... delete Selection for " 1917 << i_hitSelection.first;
1918 i_hitSelection.second.clear();
1919 i_hitInterval = i_hitSelection.second.begin();
1921 edm::LogInfo(
"HitSelector") <<
"Interval selected for " << i_hitSelection.first <<
":\t" << intervalBegin
1922 <<
", " << (*i_hitInterval);
1927 if (!i_hitSelection.second.empty())
1928 emptyMapUInt =
false;
1932 if (emptyMap && emptyMapUInt) {
1933 m_hitSelection_.clear();
1934 m_hitSelectionUInt_.clear();
1942 std::vector<double> v_cutVariable(parSet.
getParameter<std::vector<double> >(cutVariable));
1943 if (v_cutVariable.size() % 2 == 1) {
1944 edm::LogError(
"HitSelector") <<
"Invalid Hit Selection for " << cutVariable
1945 <<
": need even number of arguments (intervals)" 1946 <<
"\n ... delete Selection for " << cutVariable;
1947 v_cutVariable.clear();
1957 std::vector<unsigned int> v_cutVariable(parSet.
getParameter<std::vector<unsigned int> >(cutVariable));
1958 if (v_cutVariable.size() % 2 == 1) {
1959 edm::LogError(
"HitSelector") <<
"Invalid Hit Selection for " << cutVariable
1960 <<
": need even number of arguments (intervals)" 1961 <<
"\n ... delete Selection for " << cutVariable;
1962 v_cutVariable.clear();
1978 bool isGoodHit(
true);
1979 bool isGoodHitX(
true);
1980 bool isGoodHitY(
true);
1984 const std::vector<double>& v_hitSelection(i_hitSelection.second);
1985 if (v_hitSelection.empty())
1989 if (hitSelection ==
"phiSens") {
1992 }
else if (hitSelection ==
"phiSensX") {
1995 }
else if (hitSelection ==
"phiSensY") {
2000 else if (hitSelection ==
"resX") {
2003 }
else if (hitSelection ==
"norResX") {
2006 }
else if (hitSelection ==
"probX") {
2009 }
else if (hitSelection ==
"errXHit") {
2012 }
else if (hitSelection ==
"errXTrk") {
2015 }
else if (hitSelection ==
"errX") {
2018 }
else if (hitSelection ==
"errX2") {
2025 if (hitSelection ==
"chargePixel") {
2028 }
else if (hitSelection ==
"clusterProbabilityXY") {
2031 }
else if (hitSelection ==
"clusterProbabilityQ") {
2034 }
else if (hitSelection ==
"clusterProbabilityXYQ") {
2037 }
else if (hitSelection ==
"logClusterProbability") {
2042 else if (hitSelection ==
"baryStripX") {
2045 }
else if (hitSelection ==
"baryStripY") {
2050 else if (hitSelection ==
"resY") {
2053 }
else if (hitSelection ==
"norResY") {
2056 }
else if (hitSelection ==
"probY") {
2059 }
else if (hitSelection ==
"errYHit") {
2062 }
else if (hitSelection ==
"errYTrk") {
2065 }
else if (hitSelection ==
"errY") {
2068 }
else if (hitSelection ==
"errY2") {
2073 if (hitSelection ==
"widthProj") {
2076 }
else if (hitSelection ==
"widthDiff") {
2079 }
else if (hitSelection ==
"charge") {
2082 }
else if (hitSelection ==
"maxCharge") {
2085 }
else if (hitSelection ==
"chargeOnEdges") {
2088 }
else if (hitSelection ==
"chargeAsymmetry") {
2091 }
else if (hitSelection ==
"chargeLRplus") {
2094 }
else if (hitSelection ==
"chargeLRminus") {
2097 }
else if (hitSelection ==
"sOverN") {
2106 const std::vector<unsigned int>& v_hitSelection(i_hitSelection.second);
2107 if (v_hitSelection.empty())
2114 if (hitSelection ==
"isOnEdge") {
2117 }
else if (hitSelection ==
"hasBadPixels") {
2120 }
else if (hitSelection ==
"spansTwoRoc") {
2123 }
else if (hitSelection ==
"qBin") {
2128 else if (hitSelection ==
"widthX") {
2131 }
else if (hitSelection ==
"widthY") {
2136 if (hitSelection ==
"width") {
2139 }
else if (hitSelection ==
"edgeStrips") {
2142 }
else if (hitSelection ==
"maxIndex") {
2165 double intervalBegin(999.);
2166 bool isSelected(
false);
2167 for (
auto const& i_hitInterval : v_hitSelection) {
2170 intervalBegin = i_hitInterval;
2171 else if (variable >= intervalBegin && variable < i_hitInterval)
2179 const unsigned int variable2)
const {
2181 unsigned int intervalBegin(999);
2182 bool isSelected(
false);
2183 for (
auto i_hitInterval : v_hitSelection) {
2186 intervalBegin = i_hitInterval;
2187 else if (variable >= intervalBegin && variable <= i_hitInterval) {
2188 if (variable2 == 999 || (variable2 >= intervalBegin && variable2 <= i_hitInterval))
2198 unsigned int goodHitsPerTrack(trackStruct.
v_hitParams.size());
2265 bool moduleInSector(
false);
2266 for (
auto const& i_hitSector : hit.
v_sector) {
2267 if (i_sector.first == i_hitSector) {
2268 moduleInSector =
true;
2272 if (!moduleInSector)
2277 std::map<std::string, TrackerSectorStruct::CorrelationHists>& m_corrHists(sector.
m_correlationHistsX);
2284 m_corrHists[
"HitsGood"].fillCorrHistsX(hit, goodHitsPerTrack);
2286 m_corrHists[
"Hits2D"].fillCorrHistsX(hit, trackStruct.
trkParams.
hits2D);
2292 m_corrHists[
"Phi"].fillCorrHistsX(hit, trackStruct.
trkParams.
phi * 180. /
M_PI);
2294 m_corrHists[
"Dz"].fillCorrHistsX(hit, trackStruct.
trkParams.
dz);
2295 m_corrHists[
"Pt"].fillCorrHistsX(hit, trackStruct.
trkParams.
pt);
2296 m_corrHists[
"P"].fillCorrHistsX(hit, trackStruct.
trkParams.
p);
2297 m_corrHists[
"InvP"].fillCorrHistsX(hit, 1. / trackStruct.
trkParams.
p);
2302 std::map<std::string, TrackerSectorStruct::CorrelationHists>& m_corrHists(sector.
m_correlationHistsY);
2309 m_corrHists[
"HitsGood"].fillCorrHistsY(hit, goodHitsPerTrack);
2311 m_corrHists[
"Hits2D"].fillCorrHistsY(hit, trackStruct.
trkParams.
hits2D);
2317 m_corrHists[
"Phi"].fillCorrHistsY(hit, trackStruct.
trkParams.
phi * 180. /
M_PI);
2319 m_corrHists[
"Dz"].fillCorrHistsY(hit, trackStruct.
trkParams.
dz);
2320 m_corrHists[
"Pt"].fillCorrHistsY(hit, trackStruct.
trkParams.
pt);
2321 m_corrHists[
"P"].fillCorrHistsY(hit, trackStruct.
trkParams.
p);
2322 m_corrHists[
"InvP"].fillCorrHistsY(hit, 1. / trackStruct.
trkParams.
p);
2327 for (
auto& i_sigmaX : sector.
m_sigmaX) {
2328 for (
auto& iHist : i_sigmaX.second) {
2329 if (i_sigmaX.first ==
"sigmaXHit")
2330 iHist->Fill(hit.
errXHit * 10000.);
2331 else if (i_sigmaX.first ==
"sigmaXTrk")
2332 iHist->Fill(hit.
errXTrk * 10000.);
2333 else if (i_sigmaX.first ==
"sigmaX")
2334 iHist->Fill(hit.
errX * 10000.);
2337 for (
auto& i_sigmaY : sector.
m_sigmaY) {
2338 for (
auto& iHist : i_sigmaY.second) {
2339 if (i_sigmaY.first ==
"sigmaYHit")
2340 iHist->Fill(hit.
errYHit * 10000.);
2341 else if (i_sigmaY.first ==
"sigmaYTrk")
2342 iHist->Fill(hit.
errYTrk * 10000.);
2343 else if (i_sigmaY.first ==
"sigmaY")
2344 iHist->Fill(hit.
errY * 10000.);
2353 std::map<std::string, TrackerSectorStruct::CorrelationHists>& m_corrHists(sector.
m_correlationHistsX);
2356 m_corrHists[
"WidthX"].fillCorrHistsX(hit, hit.
widthX);
2357 m_corrHists[
"BaryStripX"].fillCorrHistsX(hit, hit.
baryStripX);
2360 m_corrHists[
"ChargePixel"].fillCorrHistsX(hit, hit.
chargePixel);
2365 m_corrHists[
"IsOnEdge"].fillCorrHistsX(hit, hit.
isOnEdge);
2366 m_corrHists[
"HasBadPixels"].fillCorrHistsX(hit, hit.
hasBadPixels);
2367 m_corrHists[
"SpansTwoRoc"].fillCorrHistsX(hit, hit.
spansTwoRoc);
2368 m_corrHists[
"QBin"].fillCorrHistsX(hit, hit.
qBin);
2371 m_corrHists[
"ChargeStrip"].fillCorrHistsX(hit, hit.
chargeStrip);
2372 m_corrHists[
"MaxStrip"].fillCorrHistsX(hit, hit.
maxStrip);
2373 m_corrHists[
"MaxCharge"].fillCorrHistsX(hit, hit.
maxCharge);
2374 m_corrHists[
"MaxIndex"].fillCorrHistsX(hit, hit.
maxIndex);
2375 m_corrHists[
"ChargeOnEdges"].fillCorrHistsX(hit, hit.
chargeOnEdges);
2376 m_corrHists[
"ChargeAsymmetry"].fillCorrHistsX(hit, hit.
chargeAsymmetry);
2377 m_corrHists[
"ChargeLRplus"].fillCorrHistsX(hit, hit.
chargeLRplus);
2378 m_corrHists[
"ChargeLRminus"].fillCorrHistsX(hit, hit.
chargeLRminus);
2379 m_corrHists[
"SOverN"].fillCorrHistsX(hit, hit.
sOverN);
2380 m_corrHists[
"WidthProj"].fillCorrHistsX(hit, hit.
projWidth);
2381 m_corrHists[
"WidthDiff"].fillCorrHistsX(hit, hit.
projWidth - static_cast<float>(hit.
widthX));
2397 m_corrHists[
"SigmaXHit"].fillCorrHistsX(hit, hit.
errXHit * 10000.);
2398 m_corrHists[
"SigmaXTrk"].fillCorrHistsX(hit, hit.
errXTrk * 10000.);
2399 m_corrHists[
"SigmaX"].fillCorrHistsX(hit, hit.
errX * 10000.);
2401 m_corrHists[
"PhiSens"].fillCorrHistsX(hit, hit.
phiSens * 180. /
M_PI);
2402 m_corrHists[
"PhiSensX"].fillCorrHistsX(hit, hit.
phiSensX * 180. /
M_PI);
2403 m_corrHists[
"PhiSensY"].fillCorrHistsX(hit, hit.
phiSensY * 180. /
M_PI);
2409 sector.
ResX->Fill(hit.
resX * 10000.);
2420 std::map<std::string, TrackerSectorStruct::CorrelationHists>& m_corrHists(sector.
m_correlationHistsY);
2426 m_corrHists[
"WidthY"].fillCorrHistsY(hit, hit.
widthY);
2427 m_corrHists[
"BaryStripY"].fillCorrHistsY(hit, hit.
baryStripY);
2429 m_corrHists[
"ChargePixel"].fillCorrHistsY(hit, hit.
chargePixel);
2434 m_corrHists[
"IsOnEdge"].fillCorrHistsY(hit, hit.
isOnEdge);
2435 m_corrHists[
"HasBadPixels"].fillCorrHistsY(hit, hit.
hasBadPixels);
2436 m_corrHists[
"SpansTwoRoc"].fillCorrHistsY(hit, hit.
spansTwoRoc);
2437 m_corrHists[
"QBin"].fillCorrHistsY(hit, hit.
qBin);
2440 m_corrHists[
"SigmaYHit"].fillCorrHistsY(hit, hit.
errYHit * 10000.);
2441 m_corrHists[
"SigmaYTrk"].fillCorrHistsY(hit, hit.
errYTrk * 10000.);
2442 m_corrHists[
"SigmaY"].fillCorrHistsY(hit, hit.
errY * 10000.);
2444 m_corrHists[
"PhiSens"].fillCorrHistsY(hit, hit.
phiSens * 180. /
M_PI);
2445 m_corrHists[
"PhiSensX"].fillCorrHistsY(hit, hit.
phiSensX * 180. /
M_PI);
2446 m_corrHists[
"PhiSensY"].fillCorrHistsY(hit, hit.
phiSensY * 180. /
M_PI);
2452 sector.
ResY->Fill(hit.
resY * 10000.);
2462 unsigned int goodHitsPerTrack(trackStruct.
v_hitParams.size());
2470 for (
auto const& i_hit : trackStruct.
v_hitParams) {
2476 bool moduleInSector(
false);
2477 for (
auto const& i_hitSector : i_hit.v_sector) {
2478 if (i_sector.first == i_hitSector) {
2479 moduleInSector =
true;
2483 if (!moduleInSector)
2489 if (i_hit.goodXMeasurement) {
2494 if (i_hit.errXWoApe < i_errBins.second.first || i_hit.errXWoApe >= i_errBins.second.second) {
2497 i_sector.second.m_binnedHists[i_errBins.first][
"sigmaX"]->Fill(i_hit.errXWoApe);
2498 i_sector.second.m_binnedHists[i_errBins.first][
"norResX"]->Fill(i_hit.norResX);
2501 i_sector.second.ResX->Fill(i_hit.resX * 10000.);
2502 i_sector.second.NorResX->Fill(i_hit.norResX);
2505 if (i_hit.goodYMeasurement) {
2510 if (i_hit.errYWoApe < i_errBins.second.first || i_hit.errYWoApe >= i_errBins.second.second) {
2513 i_sector.second.m_binnedHists[i_errBins.first][
"sigmaY"]->Fill(i_hit.errYWoApe);
2514 i_sector.second.m_binnedHists[i_errBins.first][
"norResY"]->Fill(i_hit.norResY);
2517 i_sector.second.ResY->Fill(i_hit.resY * 10000.);
2518 i_sector.second.NorResY->Fill(i_hit.norResY);
2530 for (
auto const& i_errBins : i_sector.second.m_binnedHists) {
2531 std::map<std::string, TH1*> m_Hists = i_errBins.second;
2534 double integralX = m_Hists[
"norResX"]->Integral();
2535 i_sector.second.EntriesX->SetBinContent(i_errBins.first, integralX);
2537 if (i_sector.second.isPixel) {
2538 double integralY = m_Hists[
"norResY"]->Integral();
2539 i_sector.second.EntriesY->SetBinContent(i_errBins.first, integralY);
2562 else if (dynamic_cast<const SiStripRecHit1D*>(&hit) ||
dynamic_cast<const SiStripRecHit2D*
>(&hit))
2565 else if (dynamic_cast<const SiStripMatchedRecHit2D*>(&hit))
2567 else if (dynamic_cast<const ProjectedSiStripRecHit2D*>(&hit)) {
2571 edm::LogError(
"UnkownType") <<
"@SUB=AlignmentTrackSelector::isHit2D" 2572 <<
"Tracker hit not in pixel, neither SiStripRecHit[12]D nor " 2573 <<
"SiStripMatchedRecHit2D nor ProjectedSiStripRecHit2D.";
2578 edm::LogWarning(
"DetectorMismatch") <<
"@SUB=AlignmentTrackSelector::isHit2D" 2579 <<
"Hit not in tracker with 'official' dimension >=2.";
2594 if (beamSpotHandle.
isValid()) {
2595 beamSpot = *beamSpotHandle;
2597 edm::LogError(
"ApeEstimator") <<
"No beam spot available from EventSetup" 2598 <<
"\n...skip event";
2613 typedef std::vector<ConstTrajTrackPair> ConstTrajTrackPairCollection;
2614 ConstTrajTrackPairCollection trajTracks;
2617 for (i_trajTrack = m_TrajTracksMap->
begin(); i_trajTrack != m_TrajTracksMap->
end(); ++i_trajTrack) {
2618 trajTracks.push_back(
ConstTrajTrackPair(&(*(*i_trajTrack).key), &(*(*i_trajTrack).val)));
2622 unsigned int trackSizeGood(0);
2623 ConstTrajTrackPairCollection::const_iterator iTrack;
2624 for (iTrack = trajTracks.begin(); iTrack != trajTracks.end(); ++iTrack) {
2634 const std::vector<TrajectoryMeasurement> v_meas = (*traj).measurements();
2637 for (std::vector<TrajectoryMeasurement>::const_iterator i_meas = v_meas.begin(); i_meas != v_meas.end(); ++i_meas) {
ClusterRef cluster() const
virtual const Topology & topology() const =0
uint8_t maxCharge() const
double p() const
momentum vector magnitude
bool inDoubleInterval(const std::vector< double > &, const float) const
T getParameter(std::string const &) const
double z0() const
z coordinate
std::vector< unsigned int > v_sector
virtual float angularWidth() const =0
const edm::ParameterSet parameterSet_
double d0Error() const
error on d0
TProfile * PHitsPixelVsTheta
virtual float length() const =0
std::map< std::string, std::vector< TH1 * > > m_sigmaX
unsigned short lost() const
Number of lost (=invalid) hits on track.
float clusterProbability(unsigned int flags=0) const
float logClusterProbability
ConstRecHitPointer const & recHit() const
void bookSectorHistsForAnalyzerMode()
float clusterProbabilityXYQ
double d0() const
dxy parameter in perigee convention (d0 = -dxy)
virtual const GeomDetType & type() const
TProfile * PHitsStripVsEta
friend struct const_iterator
const_iterator end() const
last iterator over the map (read only)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::pair< uint16_t, uint16_t > chargeLR() const
virtual float originToIntersection() const =0
double theta() const
polar angle
std::map< std::string, std::vector< TH1 * > > m_sigmaY
size_t recHitsSize() const
Get number of RecHits. (Warning, this includes invalid hits, which are not physical hits)...
LocalVector localDirection() const
LocalPoint localPosition() const
ApeEstimator(const edm::ParameterSet &)
TH2 * WidthDiffVsMaxStrip
Sin< T >::type sin(const T &t)
TProfile * PMeanAngleVsHits
constexpr uint32_t rawId() const
get the raw id
double etaError() const
error on eta
TH2 * WidthDiffVsSigmaXHit
double phi() const
azimuthal angle of momentum vector
const Bounds & bounds() const
PositionAndError2 radialPositionAndError2(const LocalPoint &, const LocalError &, const RadialStripTopology &)
void fillHitHistsYForAnalyzerMode(const TrackStruct::HitParameterStruct &, TrackerSectorStruct &)
LocalVector toLocal(const reco::Track::Vector &v, const Surface &s)
uint16_t maxIndex() const
auto stripCharges() const -> decltype(cluster() ->amplitudes())
PositionAndError2 rectangularPositionAndError2(const LocalPoint &, const LocalError &)
TrackerDetectorStruct tkDetector_
const Plane & surface() const
The nominal surface of the GeomDet.
LocalError positionError() const
const unsigned int maxTracksPerEvent_
bool hasBadPixels() const
TrackStruct::HitParameterStruct fillHitVariables(const TrajectoryMeasurement &, const edm::EventSetup &)
TProfile * PPhiSensYVsBarycentreY
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
void residualErrorBinning()
virtual float width() const =0
float localStripLength(const LocalPoint &) const override=0
DataContainer const & measurements() const
TProfile * PWidthDiffVsMaxStrip
float signalOverNoise() const
float getLorentzAngle(const uint32_t &) const
TProfile * PPhiSensXVsBarycentreX
#define DEFINE_FWK_MODULE(type)
double eta() const
pseudorapidity of momentum vector
std::vector< HitParameterStruct > v_hitParams
double chi2() const
chi-squared of the fit
float stripAngle(float strip) const override=0
double ndof() const
number of degrees of freedom of the fit
virtual int dimension() const =0
bool isHit2D(const TrackingRecHit &) const
float clusterProbabilityXY
TrackStruct::TrackParameterStruct fillTrackVariables(const reco::Track &, const Trajectory &, const reco::BeamSpot &)
double pt() const
track transverse momentum
TProfile * PHitsStripVsTheta
TrackParameterStruct trkParams
Cos< T >::type cos(const T &t)
double ptError() const
error on Pt (set to 1000 TeV if charge==0 for safety)
edm::EDGetTokenT< reco::BeamSpot > offlinebeamSpot_
virtual MeasurementPoint measurementPosition(const LocalPoint &) const =0
double phiError() const
error on phi
Abs< T >::type abs(const T &t)
TProfile * PHitsGoodVsHitsValid
DetId geographicalId() const
The label of this GeomDet.
double BeamWidthX() const
beam width X
bool hitSelected(TrackStruct::HitParameterStruct &) const
ClusterRef cluster() const
bool checkModulePositions(const float, const std::vector< double > &) const
void analyze(const edm::Event &, const edm::EventSetup &) override
T * make(const Args &...args) const
make new ROOT object
const LocalTrajectoryError & localError() const
TH2 * HitsGoodVsHitsValid
bool checkModuleBools(const bool, const std::vector< unsigned int > &) const
bool checkModuleIds(const unsigned int, const std::vector< unsigned int > &) const
virtual LocalPoint localPosition() const =0
std::map< unsigned int, TrackerSectorStruct > m_tkSector_
MeasurementError measurementError(const LocalPoint &, const LocalError &) const override=0
TProfile * PWidthVsWidthProjected
std::map< unsigned int, std::pair< double, double > > m_resErrBins_
bool checkIntervalsForSectors(const unsigned int sectorCounter, const std::vector< double > &) const
TrajectoryStateOnSurface const & forwardPredictedState() const
Access to forward predicted state (from fitter or builder)
double dz() const
dz parameter (= dsz/cos(lambda)). This is the track z0 w.r.t (0,0,0) only if the refPoint is close to...
double dzError() const
error on dz
SiStripRecHit2D originalHit() const
Detector identifier class for the strip tracker.
virtual TrackingRecHit const * hit() const
virtual float detHeight() const =0
MeasurementPoint measurementPosition(const LocalPoint &) const override=0
TFileDirectory mkdir(const std::string &dir, const std::string &descr="")
create a new subdirectory
TH2 * PhiSensXVsBarycentreX
uint16_t maxStrip() const
size_type size() const
map size
virtual float thickness() const =0
edm::Service< TFileService > fileService
TFileDirectory mkdir(const std::string &dir, const std::string &descr="")
create a new subdirectory
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
XYZPointD XYZPoint
point in space with cartesian internal representation
bool checkModuleDirections(const int, const std::vector< int > &) const
float clusterProbabilityQ
ClusterRef cluster() const
double BeamWidthY() const
beam width Y
bool inUintInterval(const std::vector< unsigned int > &, const unsigned int, const unsigned int=999) const
std::map< std::string, CorrelationHists > m_correlationHistsY
bool IsModuleUsable() const
std::map< unsigned int, ReducedTrackerTreeVariables > m_tkTreeVar_
Pixel cluster – collection of neighboring pixels above threshold.
virtual const GeomDetUnit * detUnit() const
void fillHistsForApeCalculation(const TrackStruct &)
unsigned short found() const
Number of valid hits on track.
bool isPixel(HitType hitType)
bool spansTwoROCs() const
double y0() const
y coordinate
const unsigned int minGoodHitsPerTrack_
void setHitSelectionMap(const std::string &)
edm::EDGetTokenT< TrajTrackAssociationCollection > tjTagToken_
int charge() const
track electric charge
void fillHitHistsXForAnalyzerMode(const TrackStruct::HitParameterStruct &, TrackerSectorStruct &)
std::pair< const Trajectory *, const reco::Track * > ConstTrajTrackPair
const_iterator begin() const
first iterator over the map (read only)
DetId geographicalId() const
void fillHistsForAnalyzerMode(const TrackStruct &)
void bookSectorHistsForApeCalculation()
virtual LocalError localPositionError() const =0
std::map< std::string, std::vector< double > > m_hitSelection_
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
TH2 * WidthVsWidthProjected
TProfile * PHitsPixelVsEta
std::map< std::string, std::vector< unsigned int > > m_hitSelectionUInt_
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
TProfile * PWidthDiffVsSigmaXHit
std::pair< TrackStruct::HitState, PositionAndError2 > StatePositionAndError2
TH2 * PhiSensYVsBarycentreY
const PositionType & position() const
TProfile * PWidthVsPhiSensX
void setHitSelectionMapUInt(const std::string &)
T const * product() const
LocalError const & localAlignmentError() const
Return local alligment error.
std::map< std::string, CorrelationHists > m_correlationHistsX
void statistics(const TrackerSectorStruct &, const int) const
Power< A, B >::type pow(const A &a, const B &b)
std::vector< unsigned int > v_rawId
const Plane & specificSurface() const
Same as surface(), kept for backward compatibility.
TrajectoryStateOnSurface const & backwardPredictedState() const
Access to backward predicted state (from smoother)
double x0() const
x coordinate
StatePositionAndError2 positionAndError2(const LocalPoint &, const LocalError &, const TransientTrackingRecHit &)