150 bool checkModuleIds(
const unsigned int,
const std::vector<unsigned int>&)
const;
174 bool inUintInterval(
const std::vector<unsigned int>&,
const unsigned int,
const unsigned int = 999)
const;
246 edm::LogError(
"SectorBuilder") <<
"TrackerTreeFile not found";
249 TTree* tkTree(
nullptr);
250 tkTreeFile->GetObject(
"TrackerTreeGenerator/TrackerTree/TrackerTree", tkTree);
254 edm::LogError(
"SectorBuilder") <<
"TrackerTree not found in file";
257 unsigned int rawId(999), subdetId(999), layer(999), side(999), half(999), rod(999),
ring(999), petal(999), blade(999),
258 panel(999), outerInner(999),
module(999), nStrips(999);
259 bool isDoubleSide(
false), isRPhi(
false), isStereo(
false);
260 int uDirection(999), vDirection(999), wDirection(999);
261 float posR(999.
F), posPhi(999.
F), posEta(999.
F),
posX(999.
F),
posY(999.
F), posZ(999.
F);
263 tkTree->SetBranchAddress(
"RawId", &rawId);
264 tkTree->SetBranchAddress(
"SubdetId", &subdetId);
265 tkTree->SetBranchAddress(
"Layer", &layer);
266 tkTree->SetBranchAddress(
"Side", &side);
267 tkTree->SetBranchAddress(
"Half", &half);
268 tkTree->SetBranchAddress(
"Rod", &rod);
269 tkTree->SetBranchAddress(
"Ring", &
ring);
270 tkTree->SetBranchAddress(
"Petal", &petal);
271 tkTree->SetBranchAddress(
"Blade", &blade);
272 tkTree->SetBranchAddress(
"Panel", &panel);
273 tkTree->SetBranchAddress(
"OuterInner", &outerInner);
274 tkTree->SetBranchAddress(
"Module", &
module);
275 tkTree->SetBranchAddress(
"NStrips", &nStrips);
276 tkTree->SetBranchAddress(
"IsDoubleSide", &isDoubleSide);
277 tkTree->SetBranchAddress(
"IsRPhi", &isRPhi);
278 tkTree->SetBranchAddress(
"IsStereo", &isStereo);
279 tkTree->SetBranchAddress(
"UDirection", &uDirection);
280 tkTree->SetBranchAddress(
"VDirection", &vDirection);
281 tkTree->SetBranchAddress(
"WDirection", &wDirection);
282 tkTree->SetBranchAddress(
"PosR", &posR);
283 tkTree->SetBranchAddress(
"PosPhi", &posPhi);
284 tkTree->SetBranchAddress(
"PosEta", &posEta);
285 tkTree->SetBranchAddress(
"PosX", &
posX);
286 tkTree->SetBranchAddress(
"PosY", &
posY);
287 tkTree->SetBranchAddress(
"PosZ", &posZ);
289 int nModules(tkTree->GetEntries());
293 unsigned int sectorCounter(0);
295 edm::LogInfo(
"SectorBuilder") <<
"There are " << v_sectorDef.size() <<
" Sectors definded";
296 for (
auto const& parSet : v_sectorDef) {
299 std::vector<unsigned int> v_rawId(parSet.getParameter<std::vector<unsigned int> >(
"rawId")),
300 v_subdetId(parSet.getParameter<std::vector<unsigned int> >(
"subdetId")),
301 v_layer(parSet.getParameter<std::vector<unsigned int> >(
"layer")),
302 v_side(parSet.getParameter<std::vector<unsigned int> >(
"side")),
303 v_half(parSet.getParameter<std::vector<unsigned int> >(
"half")),
304 v_rod(parSet.getParameter<std::vector<unsigned int> >(
"rod")),
305 v_ring(parSet.getParameter<std::vector<unsigned int> >(
"ring")),
306 v_petal(parSet.getParameter<std::vector<unsigned int> >(
"petal")),
307 v_blade(parSet.getParameter<std::vector<unsigned int> >(
"blade")),
308 v_panel(parSet.getParameter<std::vector<unsigned int> >(
"panel")),
309 v_outerInner(parSet.getParameter<std::vector<unsigned int> >(
"outerInner")),
310 v_module(parSet.getParameter<std::vector<unsigned int> >(
"module")),
311 v_nStrips(parSet.getParameter<std::vector<unsigned int> >(
"nStrips")),
312 v_isDoubleSide(parSet.getParameter<std::vector<unsigned int> >(
"isDoubleSide")),
313 v_isRPhi(parSet.getParameter<std::vector<unsigned int> >(
"isRPhi")),
314 v_isStereo(parSet.getParameter<std::vector<unsigned int> >(
"isStereo"));
315 std::vector<int> v_uDirection(parSet.getParameter<std::vector<int> >(
"uDirection")),
316 v_vDirection(parSet.getParameter<std::vector<int> >(
"vDirection")),
317 v_wDirection(parSet.getParameter<std::vector<int> >(
"wDirection"));
318 std::vector<double> v_posR(parSet.getParameter<std::vector<double> >(
"posR")),
319 v_posPhi(parSet.getParameter<std::vector<double> >(
"posPhi")),
320 v_posEta(parSet.getParameter<std::vector<double> >(
"posEta")),
321 v_posX(parSet.getParameter<std::vector<double> >(
"posX")),
322 v_posY(parSet.getParameter<std::vector<double> >(
"posY")),
323 v_posZ(parSet.getParameter<std::vector<double> >(
"posZ"));
334 tkSector.
name = sectorName;
342 if (sectorCounter == 1) {
402 tkSector.
v_rawId.push_back(rawId);
403 bool moduleSelected(
false);
404 for (
auto const& i_rawId : allSectors.v_rawId) {
405 if (rawId == i_rawId)
406 moduleSelected =
true;
409 allSectors.v_rawId.push_back(rawId);
414 for (
auto const& i_rawId : tkSector.
v_rawId) {
429 if (isPixel && isStrip) {
431 <<
"Incorrect Sector Definition: there are pixel and strip modules within one sector" 432 <<
"\n... sector selection is not applied, sector " << sectorCounter <<
" is not built";
438 edm::LogInfo(
"SectorBuilder") <<
"There are " << tkSector.
v_rawId.size() <<
" Modules in Sector " << sectorCounter;
449 if (v_id.size() % 2 == 1) {
451 <<
"Incorrect Sector Definition: Position Vectors need even number of arguments (Intervals)" 452 <<
"\n... sector selection is not applied, sector " << sectorCounter <<
" is not built";
456 double intervalBegin(999.);
457 for (
auto const& i_id : v_id) {
460 intervalBegin = i_id;
461 if (entry % 2 == 0 && intervalBegin > i_id) {
462 edm::LogError(
"SectorBuilder") <<
"Incorrect Sector Definition (Position Vector Intervals): \t" << intervalBegin
463 <<
" is bigger than " << i_id <<
" but is expected to be smaller" 464 <<
"\n... sector selection is not applied, sector " << sectorCounter
475 for (
auto const& i_id : v_id) {
485 for (
auto const& i_id : v_id) {
488 if (2 == i_id && !
id)
497 for (
auto const& i_id : v_id) {
508 double intervalBegin(999.);
509 for (
auto const& i_id : v_id) {
512 intervalBegin = i_id;
513 if (entry % 2 == 0 &&
id >= intervalBegin &&
id < i_id)
520 bool commonModules(
false);
521 for (std::map<unsigned int, TrackerSectorStruct>::const_iterator i_sector =
m_tkSector_.begin();
524 std::map<unsigned int, TrackerSectorStruct>::const_iterator i_sector2(i_sector);
525 for (++i_sector2; i_sector2 !=
m_tkSector_.end(); ++i_sector2) {
526 unsigned int nCommonModules(0);
527 for (
auto const& i_module : (*i_sector).second.v_rawId) {
528 for (
auto const& i_module2 : (*i_sector2).second.v_rawId) {
529 if (i_module2 == i_module)
533 if (nCommonModules == 0)
536 edm::LogError(
"SectorBuilder") <<
"Sector " << (*i_sector).first <<
" and Sector " << (*i_sector2).first
537 <<
" have " << nCommonModules <<
" Modules in common";
538 commonModules =
true;
542 if (static_cast<int>(allSectors.
v_rawId.size()) == nModules)
543 edm::LogInfo(
"SectorBuilder") <<
"ALL Tracker Modules are contained in the Sectors";
545 edm::LogWarning(
"SectorBuilder") <<
"There are " << allSectors.
v_rawId.size() <<
" Modules in all Sectors" 546 <<
" out of " << nModules <<
" Tracker Modules";
548 edm::LogInfo(
"SectorBuilder") <<
"There are ZERO modules associated to different sectors, no ambiguities exist";
551 <<
"There are modules associated to different sectors, APE value cannot be assigned reasonably";
558 if (v_residualErrorBinning.size() == 1) {
559 edm::LogError(
"ResidualErrorBinning") <<
"Incorrect selection of Residual Error Bins (used for APE calculation): \t" 560 <<
"Only one argument passed, so no interval is specified" 561 <<
"\n... delete whole bin selection";
565 unsigned int binCounter(-1);
566 for (
auto const& i_binning : v_residualErrorBinning) {
568 if (binCounter == 0) {
575 <<
"Incorrect selection of Residual Error Bins (used for APE calculation): \t" <<
xMin <<
" is bigger than " 576 << xMax <<
" but is expected to be smaller" 577 <<
"\n... delete whole bin selection";
586 <<
m_resErrBins_.size() <<
" Intervals of residual errors used for separate APE calculation sucessfully set";
593 for (std::vector<unsigned int>::iterator i_errHists = v_errHists.begin(); i_errHists != v_errHists.end();
595 for (std::vector<unsigned int>::iterator i_errHists2 = i_errHists; i_errHists2 != v_errHists.end();) {
597 if (*i_errHists == *i_errHists2) {
598 edm::LogError(
"BookSectorHists") <<
"Value of vErrHists in config exists twice: " << *i_errHists
599 <<
"\n... delete one of both";
600 v_errHists.erase(i_errHists2);
608 double widthMax = zoomHists ? 20. : 200.;
609 double chargePixelMax = zoomHists ? 200000. : 2000000.;
610 double chargeStripMax = zoomHists ? 1000. : 10000.;
611 double sOverNMax = zoomHists ? 200. : 2000.;
612 double logClusterProbMin = zoomHists ? -5. : -15.;
614 double resXAbsMax = zoomHists ? 0.5 : 5.;
615 double norResXAbsMax = zoomHists ? 10. : 50.;
616 double probXMin = zoomHists ? -0.01 : -0.1;
617 double probXMax = zoomHists ? 0.11 : 1.1;
618 double sigmaXMin = zoomHists ? 0. : -0.05;
619 double sigmaXMax = zoomHists ? 0.02 : 1.;
620 double sigmaX2Max = sigmaXMax *
sigmaXMax;
621 double sigmaXHitMax = zoomHists ? 0.02 : 1.;
622 double phiSensXMax = zoomHists ? 31. : 93.;
624 double norChi2Max = zoomHists ? 5. : 1000.;
625 double d0Max = zoomHists ? 0.02 : 40.;
626 double dzMax = zoomHists ? 15. : 100.;
627 double pMax = zoomHists ? 200. : 2000.;
628 double invPMax = zoomHists ? 0.05 : 10.;
635 std::stringstream sector;
636 sector <<
"Sector_" << i_sector.first;
640 i_sector.second.Name = secDir.
make<TH1F>(
"z_name", i_sector.second.name.c_str(), 1, 0, 1);
643 if (i_sector.second.v_rawId.empty()) {
647 i_sector.second.setCorrHistParams(&secDir, norResXAbsMax, sigmaXHitMax, sigmaXMax);
650 const bool pixelSector(i_sector.second.isPixel);
653 i_sector.second.m_correlationHistsX[
"WidthX"] = i_sector.second.bookCorrHistsX(
"WidthX",
657 static_cast<int>(widthMax),
658 static_cast<int>(widthMax),
662 i_sector.second.m_correlationHistsX[
"BaryStripX"] = i_sector.second.bookCorrHistsX(
663 "BaryStripX",
"barycenter of cluster charge",
"b_{cl,x}",
"[# channels]", 800, 100, -10., 790.,
"nph");
666 i_sector.second.m_correlationHistsY[
"WidthY"] = i_sector.second.bookCorrHistsY(
"WidthY",
670 static_cast<int>(widthMax),
671 static_cast<int>(widthMax),
675 i_sector.second.m_correlationHistsY[
"BaryStripY"] = i_sector.second.bookCorrHistsY(
676 "BaryStripY",
"barycenter of cluster charge",
"b_{cl,y}",
"[# channels]", 800, 100, -10., 790.,
"nph");
678 i_sector.second.m_correlationHistsX[
"ChargePixel"] = i_sector.second.bookCorrHistsX(
679 "ChargePixel",
"cluster charge",
"c_{cl}",
"[e]", 100, 50, 0., chargePixelMax,
"nph");
680 i_sector.second.m_correlationHistsX[
"ClusterProbXY"] = i_sector.second.bookCorrHistsX(
681 "ClusterProbXY",
"cluster probability xy",
"prob_{cl,xy}",
"", 100, 50, 0., 1.,
"nph");
682 i_sector.second.m_correlationHistsX[
"ClusterProbQ"] = i_sector.second.bookCorrHistsX(
683 "ClusterProbQ",
"cluster probability q",
"prob_{cl,q}",
"", 100, 50, 0., 1.,
"nph");
684 i_sector.second.m_correlationHistsX[
"ClusterProbXYQ"] = i_sector.second.bookCorrHistsX(
685 "ClusterProbXYQ",
"cluster probability xyq",
"prob_{cl,xyq}",
"", 100, 50, 0., 1.,
"nph");
686 i_sector.second.m_correlationHistsX[
"LogClusterProb"] = i_sector.second.bookCorrHistsX(
687 "LogClusterProb",
"cluster probability xy",
"log(prob_{cl,xy})",
"", 60, 30, logClusterProbMin, 0.,
"nph");
688 i_sector.second.m_correlationHistsX[
"IsOnEdge"] =
689 i_sector.second.bookCorrHistsX(
"IsOnEdge",
"IsOnEdge",
"isOnEdge",
"", 2, 2, 0, 2,
"nph");
690 i_sector.second.m_correlationHistsX[
"HasBadPixels"] =
691 i_sector.second.bookCorrHistsX(
"HasBadPixels",
"HasBadPixels",
"hasBadPixels",
"", 2, 2, 0, 2,
"nph");
692 i_sector.second.m_correlationHistsX[
"SpansTwoRoc"] =
693 i_sector.second.bookCorrHistsX(
"SpansTwoRoc",
"SpansTwoRoc",
"spansTwoRoc",
"", 2, 2, 0, 2,
"nph");
694 i_sector.second.m_correlationHistsX[
"QBin"] =
695 i_sector.second.bookCorrHistsX(
"QBin",
"q bin",
"q bin",
"", 8, 8, 0, 8,
"nph");
697 i_sector.second.m_correlationHistsY[
"ChargePixel"] = i_sector.second.bookCorrHistsY(
698 "ChargePixel",
"cluster charge",
"c_{cl}",
"[e]", 100, 50, 0., chargePixelMax,
"nph");
699 i_sector.second.m_correlationHistsY[
"ClusterProbXY"] = i_sector.second.bookCorrHistsY(
700 "ClusterProbXY",
"cluster probability xy",
"prob_{cl,xy}",
"", 100, 50, 0., 1.,
"nph");
701 i_sector.second.m_correlationHistsY[
"ClusterProbQ"] = i_sector.second.bookCorrHistsY(
702 "ClusterProbQ",
"cluster probability q",
"prob_{cl,q}",
"", 100, 50, 0., 1.,
"nph");
703 i_sector.second.m_correlationHistsY[
"ClusterProbXYQ"] = i_sector.second.bookCorrHistsY(
704 "ClusterProbXYQ",
"cluster probability xyq",
"prob_{cl,xyq}",
"", 100, 50, 0., 1.,
"nph");
705 i_sector.second.m_correlationHistsY[
"LogClusterProb"] = i_sector.second.bookCorrHistsY(
706 "LogClusterProb",
"cluster probability xy",
"log(prob_{cl,xy})",
"", 60, 30, logClusterProbMin, 0.,
"nph");
707 i_sector.second.m_correlationHistsY[
"IsOnEdge"] =
708 i_sector.second.bookCorrHistsY(
"IsOnEdge",
"IsOnEdge",
"isOnEdge",
"", 2, 2, 0, 2,
"nph");
709 i_sector.second.m_correlationHistsY[
"HasBadPixels"] =
710 i_sector.second.bookCorrHistsY(
"HasBadPixels",
"HasBadPixels",
"hasBadPixels",
"", 2, 2, 0, 2,
"nph");
711 i_sector.second.m_correlationHistsY[
"SpansTwoRoc"] =
712 i_sector.second.bookCorrHistsY(
"SpansTwoRoc",
"SpansTwoRoc",
"spansTwoRoc",
"", 2, 2, 0, 2,
"nph");
713 i_sector.second.m_correlationHistsY[
"QBin"] =
714 i_sector.second.bookCorrHistsY(
"QBin",
"q bin",
"q bin",
"", 8, 8, 0, 8,
"nph");
718 i_sector.second.m_correlationHistsX[
"ChargeStrip"] = i_sector.second.bookCorrHistsX(
719 "ChargeStrip",
"cluster charge",
"c_{cl}",
"[APV counts]", 100, 50, 0., chargeStripMax,
"nph");
720 i_sector.second.m_correlationHistsX[
"MaxStrip"] = i_sector.second.bookCorrHistsX(
721 "MaxStrip",
"strip with max. charge",
"n_{cl,max}",
"[# strips]", 800, 800, -10., 790.,
"npht");
722 i_sector.second.m_correlationHistsX[
"MaxCharge"] = i_sector.second.bookCorrHistsX(
723 "MaxCharge",
"charge of strip with max. charge",
"c_{cl,max}",
"[APV counts]", 300, 75, -10., 290.,
"nph");
724 i_sector.second.m_correlationHistsX[
"MaxIndex"] = i_sector.second.bookCorrHistsX(
725 "MaxIndex",
"cluster-index of strip with max. charge",
"i_{cl,max}",
"[# strips]", 10, 10, 0., 10.,
"nph");
726 i_sector.second.m_correlationHistsX[
"ChargeOnEdges"] =
727 i_sector.second.bookCorrHistsX(
"ChargeOnEdges",
728 "fraction of charge on edge strips",
729 "(c_{st,L}+c_{st,R})/c_{cl}",
736 i_sector.second.m_correlationHistsX[
"ChargeAsymmetry"] =
737 i_sector.second.bookCorrHistsX(
"ChargeAsymmetry",
738 "asymmetry of charge on edge strips",
739 "(c_{st,L}-c_{st,R})/c_{cl}",
746 i_sector.second.m_correlationHistsX[
"ChargeLRplus"] =
747 i_sector.second.bookCorrHistsX(
"ChargeLRplus",
748 "fraction of charge not on maxStrip",
749 "(c_{cl,L}+c_{cl,R})/c_{cl}",
756 i_sector.second.m_correlationHistsX[
"ChargeLRminus"] =
757 i_sector.second.bookCorrHistsX(
"ChargeLRminus",
758 "asymmetry of charge L and R of maxStrip",
759 "(c_{cl,L}-c_{cl,R})/c_{cl}",
766 i_sector.second.m_correlationHistsX[
"SOverN"] =
767 i_sector.second.bookCorrHistsX(
"SOverN",
"signal over noise",
"s/N",
"", 100, 50, 0, sOverNMax,
"nph");
768 i_sector.second.m_correlationHistsX[
"WidthProj"] = i_sector.second.bookCorrHistsX(
769 "WidthProj",
"projected width",
"w_{p}",
"[# strips]", 200, 20, 0., widthMax,
"nph");
770 i_sector.second.m_correlationHistsX[
"WidthDiff"] = i_sector.second.bookCorrHistsX(
"WidthDiff",
780 i_sector.second.WidthVsWidthProjected = secDir.
make<TH2F>(
"h2_widthVsWidthProj",
781 "w_{cl} vs. w_{p};w_{p} [# strips];w_{cl} [# strips]",
782 static_cast<int>(widthMax),
785 static_cast<int>(widthMax),
788 i_sector.second.PWidthVsWidthProjected =
789 secDir.
make<TProfile>(
"p_widthVsWidthProj",
790 "w_{cl} vs. w_{p};w_{p} [# strips];w_{cl} [# strips]",
791 static_cast<int>(widthMax),
795 i_sector.second.WidthDiffVsMaxStrip =
796 secDir.
make<TH2F>(
"h2_widthDiffVsMaxStrip",
797 "(w_{p} - w_{cl}) vs. n_{cl,max};n_{cl,max};w_{p} - w_{cl} [# strips]",
801 static_cast<int>(widthMax),
804 i_sector.second.PWidthDiffVsMaxStrip =
805 secDir.
make<TProfile>(
"p_widthDiffVsMaxStrip",
806 "(w_{p} - w_{cl}) vs. n_{cl,max};n_{cl,max};w_{p} - w_{cl} [# strips]",
811 i_sector.second.WidthDiffVsSigmaXHit =
812 secDir.
make<TH2F>(
"h2_widthDiffVsSigmaXHit",
813 "(w_{p} - w_{cl}) vs. #sigma_{hit,x};#sigma_{hit,x} [cm];w_{p} - w_{cl} [# strips]",
820 i_sector.second.PWidthDiffVsSigmaXHit =
821 secDir.
make<TProfile>(
"p_widthDiffVsSigmaXHit",
822 "(w_{p} - w_{cl}) vs. #sigma_{hit,x};#sigma_{hit,x} [cm];w_{p} - w_{cl} [# strips]",
827 i_sector.second.WidthVsPhiSensX =
828 secDir.
make<TH2F>(
"h2_widthVsPhiSensX",
829 "w_{cl} vs. #phi_{module,x};#phi_{module,x} [ ^{o}];w_{cl} [# strips]",
833 static_cast<int>(widthMax),
836 i_sector.second.PWidthVsPhiSensX = secDir.
make<TProfile>(
837 "p_widthVsPhiSensX",
"w_{cl} vs. #phi_{module,x};#phi_{module,x} [ ^{o}];w_{cl} [# strips]", 93, -93, 93);
841 i_sector.second.m_correlationHistsX[
"SigmaXHit"] = i_sector.second.bookCorrHistsX(
842 "SigmaXHit",
"hit error",
"#sigma_{hit,x}",
"[#mum]", 105, 20, sigmaXMin * 10000., sigmaXMax * 10000.,
"np");
843 i_sector.second.m_correlationHistsX[
"SigmaXTrk"] = i_sector.second.bookCorrHistsX(
844 "SigmaXTrk",
"track error",
"#sigma_{trk,x}",
"[#mum]", 105, 20, sigmaXMin * 10000., sigmaXMax * 10000.,
"np");
845 i_sector.second.m_correlationHistsX[
"SigmaX"] = i_sector.second.bookCorrHistsX(
846 "SigmaX",
"residual error",
"#sigma_{r,x}",
"[#mum]", 105, 20, sigmaXMin * 10000., sigmaXMax * 10000.,
"np");
847 i_sector.second.m_correlationHistsX[
"PhiSens"] = i_sector.second.bookCorrHistsX(
848 "PhiSens",
"track angle on sensor",
"#phi_{module}",
"[ ^{o}]", 96, 48, -3, 93,
"nphtr");
849 i_sector.second.m_correlationHistsX[
"PhiSensX"] = i_sector.second.bookCorrHistsX(
850 "PhiSensX",
"track angle on sensor",
"#phi_{module,x}",
"[ ^{o}]", 186, 93, -phiSensXMax, phiSensXMax,
"nphtr");
851 i_sector.second.m_correlationHistsX[
"PhiSensY"] = i_sector.second.bookCorrHistsX(
852 "PhiSensY",
"track angle on sensor",
"#phi_{module,y}",
"[ ^{o}]", 186, 93, -93, 93,
"nphtr");
854 i_sector.second.XHit = secDir.
make<TH1F>(
"h_XHit",
" hit measurement x_{hit};x_{hit} [cm];# hits", 100, -20, 20);
855 i_sector.second.XTrk = secDir.
make<TH1F>(
"h_XTrk",
"track prediction x_{trk};x_{trk} [cm];# hits", 100, -20, 20);
856 i_sector.second.SigmaX2 =
857 secDir.
make<TH1F>(
"h_SigmaX2",
858 "squared residual error #sigma_{r,x}^{2};#sigma_{r,x}^{2} [#mum^{2}];# hits",
861 sigmaX2Max * 10000. * 10000.);
862 i_sector.second.ResX = secDir.
make<TH1F>(
863 "h_ResX",
"residual r_{x};x_{trk}-x_{hit} [#mum];# hits", 100, -resXAbsMax * 10000., resXAbsMax * 10000.);
864 i_sector.second.NorResX =
865 secDir.
make<TH1F>(
"h_NorResX",
866 "normalized residual r_{x}/#sigma_{r,x};(x_{trk}-x_{hit})/#sigma_{r,x};# hits",
870 i_sector.second.ProbX = secDir.
make<TH1F>(
871 "h_ProbX",
"residual probability;prob(r_{x}^{2}/#sigma_{r,x}^{2},1);# hits", 60, probXMin, probXMax);
873 i_sector.second.PhiSensXVsBarycentreX =
874 secDir.
make<TH2F>(
"h2_phiSensXVsBarycentreX",
875 "#phi_{module,x} vs. b_{cl,x};b_{cl,x} [# channels];#phi_{module,x} [ ^{o}]",
882 i_sector.second.PPhiSensXVsBarycentreX =
883 secDir.
make<TProfile>(
"p_phiSensXVsBarycentreX",
884 "#phi_{module,x} vs. b_{cl,x};b_{cl,x} [# channels];#phi_{module,x} [ ^{o}]",
890 i_sector.second.m_correlationHistsY[
"SigmaYHit"] = i_sector.second.bookCorrHistsY(
891 "SigmaYHit",
"hit error",
"#sigma_{hit,y}",
"[#mum]", 105, 20, sigmaXMin * 10000., sigmaXMax * 10000.,
"np");
892 i_sector.second.m_correlationHistsY[
"SigmaYTrk"] = i_sector.second.bookCorrHistsY(
893 "SigmaYTrk",
"track error",
"#sigma_{trk,y}",
"[#mum]", 105, 20, sigmaXMin * 10000., sigmaXMax * 10000.,
"np");
894 i_sector.second.m_correlationHistsY[
"SigmaY"] = i_sector.second.bookCorrHistsY(
895 "SigmaY",
"residual error",
"#sigma_{r,y}",
"[#mum]", 105, 20, sigmaXMin * 10000., sigmaXMax * 10000.,
"np");
896 i_sector.second.m_correlationHistsY[
"PhiSens"] = i_sector.second.bookCorrHistsY(
897 "PhiSens",
"track angle on sensor",
"#phi_{module}",
"[ ^{o}]", 96, 48, -3, 93,
"nphtr");
898 i_sector.second.m_correlationHistsY[
"PhiSensX"] = i_sector.second.bookCorrHistsY(
"PhiSensX",
899 "track angle on sensor",
907 i_sector.second.m_correlationHistsY[
"PhiSensY"] = i_sector.second.bookCorrHistsY(
908 "PhiSensY",
"track angle on sensor",
"#phi_{module,y}",
"[ ^{o}]", 186, 93, -93, 93,
"nphtr");
910 i_sector.second.YHit = secDir.
make<TH1F>(
"h_YHit",
" hit measurement y_{hit};y_{hit} [cm];# hits", 100, -20, 20);
911 i_sector.second.YTrk = secDir.
make<TH1F>(
"h_YTrk",
"track prediction y_{trk};y_{trk} [cm];# hits", 100, -20, 20);
912 i_sector.second.SigmaY2 =
913 secDir.
make<TH1F>(
"h_SigmaY2",
914 "squared residual error #sigma_{r,y}^{2};#sigma_{r,y}^{2} [#mum^{2}];# hits",
917 sigmaX2Max * 10000. * 10000.);
918 i_sector.second.ResY = secDir.
make<TH1F>(
919 "h_ResY",
"residual r_{y};y_{trk}-y_{hit} [#mum];# hits", 100, -resXAbsMax * 10000., resXAbsMax * 10000.);
920 i_sector.second.NorResY =
921 secDir.
make<TH1F>(
"h_NorResY",
922 "normalized residual r_{y}/#sigma_{r,y};(y_{trk}-y_{hit})/#sigma_{r,y};# hits",
926 i_sector.second.ProbY = secDir.
make<TH1F>(
927 "h_ProbY",
"residual probability;prob(r_{y}^{2}/#sigma_{r,y}^{2},1);# hits", 60, probXMin, probXMax);
929 i_sector.second.PhiSensYVsBarycentreY =
930 secDir.
make<TH2F>(
"h2_phiSensYVsBarycentreY",
931 "#phi_{module,y} vs. b_{cl,y};b_{cl,y} [# channels];#phi_{module,y} [ ^{o}]",
938 i_sector.second.PPhiSensYVsBarycentreY =
939 secDir.
make<TProfile>(
"p_phiSensYVsBarycentreY",
940 "#phi_{module,y} vs. b_{cl,y};b_{cl,y} [# channels];#phi_{module,y} [ ^{o}]",
947 i_sector.second.m_correlationHistsX[
"HitsValid"] =
948 i_sector.second.bookCorrHistsX(
"HitsValid",
"# hits",
"[valid]", 50, 0, 50,
"npt");
949 i_sector.second.m_correlationHistsX[
"HitsInvalid"] =
950 i_sector.second.bookCorrHistsX(
"HitsInvalid",
"# hits",
"[invalid]", 20, 0, 20,
"npt");
951 i_sector.second.m_correlationHistsX[
"Hits2D"] =
952 i_sector.second.bookCorrHistsX(
"Hits2D",
"# hits",
"[2D]", 20, 0, 20,
"npt");
953 i_sector.second.m_correlationHistsX[
"LayersMissed"] =
954 i_sector.second.bookCorrHistsX(
"LayersMissed",
"# layers",
"[missed]", 10, 0, 10,
"npt");
955 i_sector.second.m_correlationHistsX[
"HitsPixel"] =
956 i_sector.second.bookCorrHistsX(
"HitsPixel",
"# hits",
"[pixel]", 10, 0, 10,
"npt");
957 i_sector.second.m_correlationHistsX[
"HitsStrip"] =
958 i_sector.second.bookCorrHistsX(
"HitsStrip",
"# hits",
"[strip]", 40, 0, 40,
"npt");
959 i_sector.second.m_correlationHistsX[
"HitsGood"] =
960 i_sector.second.bookCorrHistsX(
"HitsGood",
"# hits",
"[good]", 50, 0, 50,
"npt");
961 i_sector.second.m_correlationHistsX[
"NorChi2"] =
962 i_sector.second.bookCorrHistsX(
"NorChi2",
"#chi^{2}/f",
"", 50, 0, norChi2Max,
"npr");
963 i_sector.second.m_correlationHistsX[
"Theta"] =
964 i_sector.second.bookCorrHistsX(
"Theta",
"#theta",
"[ ^{o}]", 40, -10, 190,
"npt");
965 i_sector.second.m_correlationHistsX[
"Phi"] =
966 i_sector.second.bookCorrHistsX(
"Phi",
"#phi",
"[ ^{o}]", 76, -190, 190,
"npt");
967 i_sector.second.m_correlationHistsX[
"D0Beamspot"] =
968 i_sector.second.bookCorrHistsX(
"D0Beamspot",
"d_{0, BS}",
"[cm]", 40, -d0Max, d0Max,
"npt");
969 i_sector.second.m_correlationHistsX[
"Dz"] =
970 i_sector.second.bookCorrHistsX(
"Dz",
"d_{z}",
"[cm]", 40, -dzMax, dzMax,
"npt");
971 i_sector.second.m_correlationHistsX[
"Pt"] =
972 i_sector.second.bookCorrHistsX(
"Pt",
"p_{t}",
"[GeV]", 50, 0, pMax,
"npt");
973 i_sector.second.m_correlationHistsX[
"P"] = i_sector.second.bookCorrHistsX(
"P",
"|p|",
"[GeV]", 50, 0, pMax,
"npt");
974 i_sector.second.m_correlationHistsX[
"InvP"] =
975 i_sector.second.bookCorrHistsX(
"InvP",
"1/|p|",
"[GeV^{-1}]", 25, 0, invPMax,
"t");
976 i_sector.second.m_correlationHistsX[
"MeanAngle"] =
977 i_sector.second.bookCorrHistsX(
"MeanAngle",
"<#phi_{module}>",
"[ ^{o}]", 25, -5, 95,
"npt");
981 i_sector.second.m_correlationHistsY[
"HitsValid"] =
982 i_sector.second.bookCorrHistsY(
"HitsValid",
"# hits",
"[valid]", 50, 0, 50,
"npt");
983 i_sector.second.m_correlationHistsY[
"HitsInvalid"] =
984 i_sector.second.bookCorrHistsY(
"HitsInvalid",
"# hits",
"[invalid]", 20, 0, 20,
"npt");
985 i_sector.second.m_correlationHistsY[
"Hits2D"] =
986 i_sector.second.bookCorrHistsY(
"Hits2D",
"# hits",
"[2D]", 20, 0, 20,
"npt");
987 i_sector.second.m_correlationHistsY[
"LayersMissed"] =
988 i_sector.second.bookCorrHistsY(
"LayersMissed",
"# layers",
"[missed]", 10, 0, 10,
"npt");
989 i_sector.second.m_correlationHistsY[
"HitsPixel"] =
990 i_sector.second.bookCorrHistsY(
"HitsPixel",
"# hits",
"[pixel]", 10, 0, 10,
"npt");
991 i_sector.second.m_correlationHistsY[
"HitsStrip"] =
992 i_sector.second.bookCorrHistsY(
"HitsStrip",
"# hits",
"[strip]", 40, 0, 40,
"npt");
993 i_sector.second.m_correlationHistsY[
"HitsGood"] =
994 i_sector.second.bookCorrHistsY(
"HitsGood",
"# hits",
"[good]", 50, 0, 50,
"npt");
995 i_sector.second.m_correlationHistsY[
"NorChi2"] =
996 i_sector.second.bookCorrHistsY(
"NorChi2",
"#chi^{2}/f",
"", 50, 0, norChi2Max,
"npr");
997 i_sector.second.m_correlationHistsY[
"Theta"] =
998 i_sector.second.bookCorrHistsY(
"Theta",
"#theta",
"[ ^{o}]", 40, -10, 190,
"npt");
999 i_sector.second.m_correlationHistsY[
"Phi"] =
1000 i_sector.second.bookCorrHistsY(
"Phi",
"#phi",
"[ ^{o}]", 76, -190, 190,
"npt");
1001 i_sector.second.m_correlationHistsY[
"D0Beamspot"] =
1002 i_sector.second.bookCorrHistsY(
"D0Beamspot",
"d_{0, BS}",
"[cm]", 40, -d0Max, d0Max,
"npt");
1003 i_sector.second.m_correlationHistsY[
"Dz"] =
1004 i_sector.second.bookCorrHistsY(
"Dz",
"d_{z}",
"[cm]", 40, -dzMax, dzMax,
"npt");
1005 i_sector.second.m_correlationHistsY[
"Pt"] =
1006 i_sector.second.bookCorrHistsY(
"Pt",
"p_{t}",
"[GeV]", 50, 0, pMax,
"npt");
1007 i_sector.second.m_correlationHistsY[
"P"] =
1008 i_sector.second.bookCorrHistsY(
"P",
"|p|",
"[GeV]", 50, 0, pMax,
"npt");
1009 i_sector.second.m_correlationHistsY[
"InvP"] =
1010 i_sector.second.bookCorrHistsY(
"InvP",
"1/|p|",
"[GeV^{-1}]", 25, 0, invPMax,
"t");
1011 i_sector.second.m_correlationHistsY[
"MeanAngle"] =
1012 i_sector.second.bookCorrHistsY(
"MeanAngle",
"<#phi_{module}>",
"[ ^{o}]", 25, -5, 95,
"npt");
1016 for (
auto const& i_errHists : v_errHists) {
1017 double xMin(0.01 * (i_errHists - 1)),
xMax(0.01 * (i_errHists));
1018 std::stringstream sigmaXHit, sigmaXTrk,
sigmaX;
1019 sigmaXHit <<
"h_sigmaXHit_" << i_errHists;
1020 sigmaXTrk <<
"h_sigmaXTrk_" << i_errHists;
1021 sigmaX <<
"h_sigmaX_" << i_errHists;
1022 i_sector.second.m_sigmaX[
"sigmaXHit"].push_back(
1023 secDir.
make<TH1F>(sigmaXHit.str().c_str(),
1024 "hit error #sigma_{hit,x};#sigma_{hit,x} [#mum];# hits",
1028 i_sector.second.m_sigmaX[
"sigmaXTrk"].push_back(
1029 secDir.
make<TH1F>(sigmaXTrk.str().c_str(),
1030 "track error #sigma_{trk,x};#sigma_{trk,x} [#mum];# hits",
1034 i_sector.second.m_sigmaX[
"sigmaX"].push_back(
1035 secDir.
make<TH1F>(sigmaX.str().c_str(),
1036 "residual error #sigma_{r,x};#sigma_{r,x} [#mum];# hits",
1041 std::stringstream sigmaYHit, sigmaYTrk,
sigmaY;
1042 sigmaYHit <<
"h_sigmaYHit_" << i_errHists;
1043 sigmaYTrk <<
"h_sigmaYTrk_" << i_errHists;
1044 sigmaY <<
"h_sigmaY_" << i_errHists;
1045 i_sector.second.m_sigmaY[
"sigmaYHit"].push_back(
1046 secDir.
make<TH1F>(sigmaYHit.str().c_str(),
1047 "hit error #sigma_{hit,y};#sigma_{hit,y} [#mum];# hits",
1051 i_sector.second.m_sigmaY[
"sigmaYTrk"].push_back(
1052 secDir.
make<TH1F>(sigmaYTrk.str().c_str(),
1053 "track error #sigma_{trk,y};#sigma_{trk,y} [#mum];# hits",
1057 i_sector.second.m_sigmaY[
"sigmaY"].push_back(
1058 secDir.
make<TH1F>(sigmaY.str().c_str(),
1059 "residual error #sigma_{r,y};#sigma_{r,y} [#mum];# hits",
1070 for (std::vector<unsigned int>::iterator i_errHists = v_errHists.begin(); i_errHists != v_errHists.end();
1072 for (std::vector<unsigned int>::iterator i_errHists2 = i_errHists; i_errHists2 != v_errHists.end();) {
1074 if (*i_errHists == *i_errHists2) {
1075 edm::LogError(
"BookSectorHists") <<
"Value of vErrHists in config exists twice: " << *i_errHists
1076 <<
"\n... delete one of both";
1077 v_errHists.erase(i_errHists2);
1088 std::stringstream sector;
1089 sector <<
"Sector_" << i_sector.first;
1093 i_sector.second.Name = secDir.
make<TH1F>(
"z_name", i_sector.second.name.c_str(), 1, 0, 1);
1096 if (i_sector.second.v_rawId.empty()) {
1107 std::stringstream interval;
1108 interval <<
"Interval_" << i_errBins.first;
1110 i_sector.second.m_binnedHists[i_errBins.first][
"sigmaX"] =
1111 intDir.
make<TH1F>(
"h_sigmaX",
"residual resolution #sigma_{x};#sigma_{x} [cm];# hits", 100, 0., 0.01);
1112 i_sector.second.m_binnedHists[i_errBins.first][
"norResX"] = intDir.
make<TH1F>(
1113 "h_norResX",
"normalized residual r_{x}/#sigma_{r,x};(x_{trk}-x_{hit})/#sigma_{r,x};# hits", 100, -10, 10);
1114 if (i_sector.second.isPixel) {
1115 i_sector.second.m_binnedHists[i_errBins.first][
"sigmaY"] =
1116 intDir.
make<TH1F>(
"h_sigmaY",
"residual resolution #sigma_{y};#sigma_{y} [cm];# hits", 100, 0., 0.01);
1117 i_sector.second.m_binnedHists[i_errBins.first][
"norResY"] = intDir.
make<TH1F>(
1118 "h_norResY",
"normalized residual r_{y}/#sigma_{r,y};(y_{trk}-y_{hit})/#sigma_{r,y};# hits", 100, -10, 10);
1125 unsigned int rawId(0);
1126 i_sector.second.RawId = resDir.make<TTree>(
"rawIdTree",
"Tree containing rawIds of all modules in sector");
1127 i_sector.second.RawId->Branch(
"RawId", &rawId,
"RawId/i");
1128 for (
auto const& i_rawId : i_sector.second.v_rawId) {
1130 i_sector.second.RawId->Fill();
1136 for (
auto& i_binX : v_binX) {
1139 i_sector.second.EntriesX =
1140 resDir.make<TH1F>(
"h_entriesX",
"# hits used;#sigma_{x} [#mum];# hits", v_binX.size() - 1, &(v_binX[0]));
1141 if (i_sector.second.isPixel) {
1142 i_sector.second.EntriesY =
1143 resDir.make<TH1F>(
"h_entriesY",
"# hits used;#sigma_{y} [#mum];# hits", v_binX.size() - 1, &(v_binX[0]));
1148 i_sector.second.ResX = resDir.make<TH1F>(
1149 "h_ResX",
"residual r_{x};x_{trk}-x_{hit} [#mum];# hits", 100, -0.03 * 10000., 0.03 * 10000.);
1150 i_sector.second.NorResX = resDir.make<TH1F>(
1151 "h_NorResX",
"normalized residual r_{x}/#sigma_{r,x};(x_{trk}-x_{hit})/#sigma_{r,x};# hits", 100, -5., 5.);
1152 if (i_sector.second.isPixel) {
1153 i_sector.second.ResY = resDir.make<TH1F>(
1154 "h_ResY",
"residual r_{y};y_{trk}-y_{hit} [#mum];# hits", 100, -0.03 * 10000., 0.03 * 10000.);
1155 i_sector.second.NorResY = resDir.make<TH1F>(
1156 "h_NorResY",
"normalized residual r_{y}/#sigma_{r,y};(y_{trk}-y_{hit})/#sigma_{r,y};# hits", 100, -5., 5.);
1166 int trackSizeBins = zoomHists ? 6 : 201;
1167 double trackSizeMax = trackSizeBins - 1;
1169 double chi2Max = zoomHists ? 100. : 2000.;
1170 double norChi2Max = zoomHists ? 5. : 1000.;
1171 double d0max = zoomHists ? 0.02 : 40.;
1172 double dzmax = zoomHists ? 15. : 100.;
1173 double pMax = zoomHists ? 200. : 2000.;
1178 evtDir.
make<TH1F>(
"h_trackSize",
"# tracks [all];# tracks;# events", trackSizeBins, -1, trackSizeMax);
1180 evtDir.
make<TH1F>(
"h_trackSizeGood",
"# tracks [good];# tracks;# events", trackSizeBins, -1, trackSizeMax);
1182 tkDetector_.
HitsSize = trkDir.make<TH1F>(
"h_hitsSize",
"# hits;# hits;# tracks", 51, -1, 50);
1183 tkDetector_.
HitsValid = trkDir.make<TH1F>(
"h_hitsValid",
"# hits [valid];# hits [valid];# tracks", 51, -1, 50);
1185 trkDir.make<TH1F>(
"h_hitsInvalid",
"# hits [invalid];# hits [invalid];# tracks", 21, -1, 20);
1186 tkDetector_.
Hits2D = trkDir.make<TH1F>(
"h_hits2D",
"# hits [2D];# hits [2D];# tracks", 21, -1, 20);
1188 trkDir.make<TH1F>(
"h_layersMissed",
"# layers [missed];# layers [missed];# tracks", 11, -1, 10);
1189 tkDetector_.
HitsPixel = trkDir.make<TH1F>(
"h_hitsPixel",
"# hits [pixel];# hits [pixel];# tracks", 11, -1, 10);
1190 tkDetector_.
HitsStrip = trkDir.make<TH1F>(
"h_hitsStrip",
"# hits [strip];# hits [strip];# tracks", 41, -1, 40);
1191 tkDetector_.
Charge = trkDir.make<TH1F>(
"h_charge",
"charge q;q [e];# tracks", 5, -2, 3);
1193 tkDetector_.
Ndof = trkDir.make<TH1F>(
"h_ndof",
"# degrees of freedom f;f;# tracks", 101, -1, 100);
1194 tkDetector_.
NorChi2 = trkDir.make<TH1F>(
"h_norChi2",
"normalized #chi^{2};#chi^{2}/f;# tracks", 200, 0, norChi2Max);
1195 tkDetector_.
Prob = trkDir.make<TH1F>(
"h_prob",
" #chi^{2} probability;prob(#chi^{2},f);# tracks", 50, 0, 1);
1196 tkDetector_.
Eta = trkDir.make<TH1F>(
"h_eta",
"pseudorapidity #eta;#eta;# tracks", 100, -5, 5);
1197 tkDetector_.
EtaErr = trkDir.make<TH1F>(
"h_etaErr",
"Error of #eta;#sigma(#eta);# tracks", 100, 0, 0.001);
1199 trkDir.make<TH1F>(
"h_etaSig",
"Significance of #eta;#eta/#sigma(#eta);# tracks", 100, -20000, 20000);
1200 tkDetector_.
Theta = trkDir.make<TH1F>(
"h_theta",
"polar angle #theta;#theta [ ^{o}];# tracks", 100, -10, 190);
1201 tkDetector_.
Phi = trkDir.make<TH1F>(
"h_phi",
"azimuth angle #phi;#phi [ ^{o}];# tracks", 190, -190, 190);
1202 tkDetector_.
PhiErr = trkDir.make<TH1F>(
"h_phiErr",
"Error of #phi;#sigma(#phi) [ ^{o}];# tracks", 100, 0, 0.04);
1204 trkDir.make<TH1F>(
"h_phiSig",
"Significance of #phi;#phi/#sigma(#phi) [ ^{o}];# tracks", 100, -50000, 50000);
1206 "h_d0Beamspot",
"Closest approach d_{0} wrt. beamspot;d_{0, BS} [cm];# tracks", 200, -d0max, d0max);
1208 trkDir.make<TH1F>(
"h_d0BeamspotErr",
"Error of d_{0, BS};#sigma(d_{0, BS}) [cm];# tracks", 200, 0, 0.01);
1210 "h_d0BeamspotSig",
"Significance of d_{0, BS};d_{0, BS}/#sigma(d_{0, BS});# tracks", 100, -5, 5);
1211 tkDetector_.
Dz = trkDir.make<TH1F>(
"h_dz",
"Closest approach d_{z};d_{z} [cm];# tracks", 200, -dzmax, dzmax);
1212 tkDetector_.
DzErr = trkDir.make<TH1F>(
"h_dzErr",
"Error of d_{z};#sigma(d_{z}) [cm];# tracks", 200, 0, 0.01);
1214 trkDir.make<TH1F>(
"h_dzSig",
"Significance of d_{z};d_{z}/#sigma(d_{z});# tracks", 100, -10000, 10000);
1215 tkDetector_.
Pt = trkDir.make<TH1F>(
"h_pt",
"transverse momentum p_{t};p_{t} [GeV];# tracks", 100, 0,
pMax);
1216 tkDetector_.
PtErr = trkDir.make<TH1F>(
"h_ptErr",
"Error of p_{t};#sigma(p_{t}) [GeV];# tracks", 100, 0, 1.6);
1217 tkDetector_.
PtSig = trkDir.make<TH1F>(
"h_ptSig",
"Significance of p_{t};p_{t}/#sigma(p_{t});# tracks", 100, 0, 200);
1218 tkDetector_.
P = trkDir.make<TH1F>(
"h_p",
"momentum magnitude |p|;|p| [GeV];# tracks", 100, 0,
pMax);
1220 "h_meanAngle",
"mean angle on module <#phi_{module}>;<#phi_{module}> [ ^{o}];# tracks", 100, -5, 95);
1221 tkDetector_.
HitsGood = trkDir.make<TH1F>(
"h_hitsGood",
"# hits [good];# hits [good];# tracks", 51, -1, 50);
1224 "h2_meanAngleVsHits",
"<#phi_{module}> vs. # hits;# hits;<#phi_{module}> [ ^{o}]", 51, -1, 50, 50, -5, 95);
1226 trkDir.make<TH2F>(
"h2_hitsGoodVsHitsValid",
1227 "# hits [good] vs. # hits [valid];# hits [valid];# hits [good]",
1235 trkDir.make<TH2F>(
"h2_hitsPixelVsEta",
"# hits [pixel] vs. #eta;#eta;# hits [pixel]", 60, -3, 3, 11, -1, 10);
1237 "h2_hitsPixelVsTheta",
"# hits [pixel] vs. #theta;#theta;# hits [pixel]", 100, -10, 190, 11, -1, 10);
1239 trkDir.make<TH2F>(
"h2_hitsStripVsEta",
"# hits [strip] vs. #eta;#eta;# hits [strip]", 60, -3, 3, 31, -1, 40);
1241 "h2_hitsStripVsTheta",
"# hits [strip] vs. #theta;#theta;# hits [strip]", 100, -10, 190, 31, -1, 40);
1242 tkDetector_.
PtVsEta = trkDir.make<TH2F>(
"h2_ptVsEta",
"p_{t} vs. #eta;#eta;p_{t} [GeV]", 60, -3, 3, 100, 0,
pMax);
1244 trkDir.make<TH2F>(
"h2_ptVsTheta",
"p_{t} vs. #theta;#theta;p_{t} [GeV]", 100, -10, 190, 100, 0,
pMax);
1247 "p_meanAngleVsHits",
"<#phi_{module}> vs. # hits;# hits;<#phi_{module}> [ ^{o}]", 51, -1, 50);
1249 "p_hitsGoodVsHitsValid",
"# hits [good] vs. # hits [valid];# hits [valid];# hits [good]", 51, -1, 50);
1251 trkDir.make<TProfile>(
"p_hitsPixelVsEta",
"# hits [pixel] vs. #eta;#eta;# hits [pixel]", 60, -3, 3);
1253 trkDir.make<TProfile>(
"p_hitsPixelVsTheta",
"# hits [pixel] vs. #theta;#theta;# hits [pixel]", 100, -10, 190);
1255 trkDir.make<TProfile>(
"p_hitsStripVsEta",
"# hits [strip] vs. #eta;#eta;# hits [strip]", 60, -3, 3);
1257 trkDir.make<TProfile>(
"p_hitsStripVsTheta",
"# hits [strip] vs. #theta;#theta;# hits [strip]", 100, -10, 190);
1258 tkDetector_.
PPtVsEta = trkDir.make<TProfile>(
"p_ptVsEta",
"p_{t} vs. #eta;#eta;p_{t} [GeV]", 60, -3, 3);
1259 tkDetector_.
PPtVsTheta = trkDir.make<TProfile>(
"p_ptVsTheta",
"p_{t} vs. #theta;#theta;p_{t} [GeV]", 100, -10, 190);
1268 double d0BeamspotErr =
1279 trkParams.hitsValid = track.
found();
1280 trkParams.hitsInvalid = trkParams.hitsSize - trkParams.hitsValid;
1281 trkParams.layersMissed =
1283 trkParams.hitsPixel = hitPattern.numberOfValidPixelHits();
1284 trkParams.hitsStrip = hitPattern.numberOfValidStripHits();
1285 trkParams.charge = track.
charge();
1286 trkParams.chi2 = track.
chi2();
1287 trkParams.ndof = track.
ndof();
1288 trkParams.norChi2 = trkParams.chi2 / trkParams.ndof;
1289 trkParams.prob = TMath::Prob(trkParams.chi2, trkParams.ndof);
1290 trkParams.eta = track.
eta();
1291 trkParams.etaErr = track.
etaError();
1292 trkParams.theta = track.
theta();
1293 trkParams.phi = track.
phi();
1294 trkParams.phiErr = track.
phiError();
1295 trkParams.d0 = track.
d0();
1296 trkParams.d0Beamspot = -1. * track.
dxy(beamPoint);
1297 trkParams.d0BeamspotErr = d0BeamspotErr;
1298 trkParams.dz = track.
dz();
1299 trkParams.dzErr = track.
dzError();
1300 trkParams.dzBeamspot = track.
dz(beamPoint);
1301 trkParams.p = track.
p();
1302 trkParams.pt = track.
pt();
1303 trkParams.ptErr = track.
ptError();
1305 const std::vector<TrajectoryMeasurement>& v_meas = traj.
measurements();
1308 float meanPhiSensToNorm(0.
F);
1309 for (
auto const& i_meas : v_meas) {
1318 meanPhiSensToNorm += atan(fabs(
sqrt(mom.x() * mom.x() + mom.y() * mom.y()) / mom.z()));
1320 meanPhiSensToNorm *= (1. /
static_cast<float>(trkParams.hitsSize));
1322 trkParams.hits2D = count2D;
1323 trkParams.meanPhiSensToNorm = meanPhiSensToNorm;
1327 if (trkParams.hitsStrip < 11 || trkParams.hits2D < 2 || trkParams.hitsPixel < 2 ||
1328 trkParams.hitsStrip > 35 || trkParams.hitsPixel > 7 || trkParams.norChi2 > 5. || trkParams.pt < 25. ||
1329 trkParams.pt > 150. ||
std::abs(trkParams.d0Beamspot) > 0.02 ||
std::abs(trkParams.dz) > 15.)
1355 const uint32_t rawId(detId.rawId());
1358 for (
auto const& i_rawId : i_sector.second.v_rawId) {
1359 if (rawId == i_rawId) {
1360 hitParams.
v_sector.push_back(i_sector.first);
1367 int xMomentum(0), yMomentum(0), zMomentum(0);
1368 xMomentum = mom.x() > 0. ? 1 : -1;
1369 yMomentum = mom.y() > 0. ? 1 : -1;
1370 zMomentum = mom.z() > 0. ? 1 : -1;
1372 std::atan(std::fabs(mom.x() / mom.z())) *
1375 float phiSensY = std::atan(std::fabs(mom.y() / mom.z())) *
static_cast<float>(
m_tkTreeVar_[rawId].vDirection);
1376 hitParams.
phiSens = std::atan(std::fabs(
std::sqrt(mom.x() * mom.x() + mom.y() * mom.y()) / mom.z()));
1377 hitParams.
phiSensX = (xMomentum == zMomentum ? phiSensX : -phiSensX);
1378 hitParams.
phiSensY = (yMomentum == zMomentum ? phiSensY : -phiSensY);
1407 edm::LogWarning(
"FillHitVariables") <<
"cant identify wether hit is from pixel or strip";
1419 if (!dynamic_cast<const PixelTopology*>(&detUnit.
type().
topology())) {
1426 errorWithoutAPE =
LocalError(errHitApe.
xx() - lape.
xx(), errHitApe.
xy() - lape.
xy(), errHitApe.
yy() - lape.
yy());
1430 if (!dynamic_cast<const StripTopology*>(&detUnit.
type().
topology())) {
1437 errorWithoutAPE =
LocalError(errHitApe.
xx() - lape.
xx(), errHitApe.
xy() - lape.
xy(), errHitApe.
yy() - lape.
yy());
1441 const LocalError& errHitWoApe = errorWithoutAPE;
1446 edm::LogInfo(
"CalculateAPE") <<
"errHitWoApe " << errHitWoApe <<
"errHitApe " << errHitApe;
1473 const float xHit = positionAndError2Hit.second.posX;
1474 const float xTrk = positionAndError2Trk.second.posX;
1475 const float yHit = positionAndError2Hit.second.posY;
1476 const float yTrk = positionAndError2Trk.second.posY;
1478 const float errXHit2(positionAndError2Hit.second.errX2);
1479 const float errXHitWoApe2(positionAndError2HitWoApe.second.errX2);
1480 const float errXTrk2(positionAndError2Trk.second.errX2);
1481 const float errYHit2(positionAndError2Hit.second.errY2);
1482 const float errYHitWoApe2(positionAndError2HitWoApe.second.errY2);
1483 const float errYTrk2(positionAndError2Trk.second.errY2);
1485 const float errXHit =
std::sqrt(positionAndError2Hit.second.errX2);
1486 const float errXHitWoApe =
std::sqrt(positionAndError2HitWoApe.second.errX2);
1487 const float errXTrk =
std::sqrt(positionAndError2Trk.second.errX2);
1488 const float errYHit =
std::sqrt(positionAndError2Hit.second.errY2);
1489 const float errYHitWoApe =
std::sqrt(positionAndError2HitWoApe.second.errY2);
1490 const float errYTrk =
std::sqrt(positionAndError2Trk.second.errY2);
1492 const float resX = xTrk - xHit;
1493 const float resY = yTrk - yHit;
1496 const float errXWoApe2 = errXHitWoApe2 + errXTrk2;
1497 const float errXWoApe =
std::sqrt(errXWoApe2);
1499 const float errYWoApe2 = errYHitWoApe2 + errYTrk2;
1500 const float errYWoApe =
std::sqrt(errYWoApe2);
1502 const float norResX = resX /
errX;
1503 const float norResY = resY /
errY;
1507 float resXprime(999.
F), resYprime(999.
F), norResXprime(999.
F), norResYprime(999.
F);
1510 norResXprime = norResX;
1513 norResXprime = -norResX;
1515 edm::LogError(
"FillHitVariables") <<
"Incorrect value of uDirection, which gives global module orientation";
1521 norResYprime = norResY;
1524 norResYprime = -norResY;
1526 edm::LogError(
"FillHitVariables") <<
"Incorrect value of vDirection, which gives global module orientation";
1531 hitParams.
xHit = xHit;
1532 hitParams.
xTrk = xTrk;
1542 hitParams.
resX = resXprime;
1543 hitParams.
norResX = norResXprime;
1545 const float norResX2(norResXprime * norResXprime);
1546 hitParams.
probX = TMath::Prob(norResX2, 1);
1548 hitParams.
yHit = yHit;
1549 hitParams.
yTrk = yTrk;
1559 hitParams.
resY = resYprime;
1560 hitParams.
norResY = norResYprime;
1562 const float norResY2(norResYprime * norResYprime);
1563 hitParams.
probY = TMath::Prob(norResY2, 1);
1593 if (!(dynamic_cast<const SiStripRecHit2D*>(&recHit) || dynamic_cast<const SiStripRecHit1D*>(&recHit))) {
1595 <<
"RecHit in Strip is 'Matched' or 'Projected', but here all should be monohits per module";
1602 if (dynamic_cast<const SiStripRecHit1D*>(&recHit)) {
1604 clusterPtr = &(*stripHit.
cluster());
1605 }
else if (dynamic_cast<const SiStripRecHit2D*>(&recHit)) {
1606 edm::LogWarning(
"FillHitVariables") <<
"Data has TIB/TOB hits as SiStripRecHit2D and not 1D. Probably data is " 1607 "processed with CMSSW<34X. Nevertheless everything should work fine";
1609 clusterPtr = &(*stripHit.
cluster());
1614 clusterPtr = &(*stripHit.
cluster());
1617 edm::LogError(
"FillHitVariables") <<
"Pointer to cluster not valid!!! This should never happen...";
1625 const std::vector<uint8_t>::const_iterator stripChargeL(clusterInfo.
stripCharges().begin());
1626 const std::vector<uint8_t>::const_iterator stripChargeR(--(clusterInfo.
stripCharges().end()));
1627 const std::pair<uint16_t, uint16_t> stripChargeLR = std::make_pair(*stripChargeL, *stripChargeR);
1638 static_cast<float>(stripChargeLR.first + stripChargeLR.second) / static_cast<float>(hitParams.
chargeStrip);
1639 hitParams.
chargeAsymmetry =
static_cast<float>(stripChargeLR.first - stripChargeLR.second) /
1640 static_cast<float>(stripChargeLR.first + stripChargeLR.second);
1653 if (!dynamic_cast<const StripTopology*>(&detUnit.
type().
topology())) {
1670 float dirX = -tanLorentzAnglePerTesla * bField.y();
1671 float dirY = tanLorentzAnglePerTesla * bField.x();
1683 if (momentumDir.z() > 0.)
1684 scaledMomentumDir *= std::fabs(thickness / momentumDir.z());
1685 else if (momentumDir.z() < 0.)
1686 scaledMomentumDir *= -std::fabs(thickness / momentumDir.z());
1688 scaledMomentumDir *= maxLength / momentumDir.mag();
1701 float coveredStrips = std::fabs(projEdge2 - projEdge1);
1706 edm::LogError(
"FillHitVariables") <<
"Incorrect subdetector ID, hit not associated to tracker";
1731 const uint32_t& rawId(detId.rawId());
1732 const unsigned int& subdetId(
m_tkTreeVar_[rawId].subdetId);
1734 if (localError.
xx() < 0. || localError.
yy() < 0.) {
1754 if (!dynamic_cast<const RadialStripTopology*>(&detUnit.
type().
topology()))
1759 if (measError.
uu() < 0. || measError.
vv() < 0.) {
1774 edm::LogError(
"FillHitVariables") <<
"Incorrect subdetector ID, hit not associated to tracker";
1781 const float x(lP.
x());
1782 const float y(lP.
y());
1783 const float errX2(lE.
xx());
1784 const float errY2(lE.
yy());
1801 float errX2(-999.
F);
1802 float errY2(-999.
F);
1806 const float l_0 = r_0 - topol.
detHeight() / 2;
1808 y = measPos.
y() * stripLength - 0.5 * stripLength + l_0 * (1. / cosPhi - 1.);
1811 const float errPhi2(measErr.
uu() * angularWidth2);
1813 errX2 = errPhi2 * r_0 * r_0;
1816 const float helpSummand = l_0 * l_0 * (sinPhi2 / cosPhi4 * errPhi2);
1817 errY2 = measErr.
vv() * stripLength * stripLength + helpSummand;
1872 edm::LogInfo(
"HitSelector") <<
"applying hit cuts ...";
1873 bool emptyMap(
true);
1875 if (!i_hitSelection.second.empty()) {
1877 double intervalBegin(999.);
1878 for (std::vector<double>::iterator i_hitInterval = i_hitSelection.second.begin();
1879 i_hitInterval != i_hitSelection.second.end();
1881 if (entry % 2 == 1) {
1882 intervalBegin = *i_hitInterval;
1885 if (intervalBegin > *i_hitInterval) {
1886 edm::LogError(
"HitSelector") <<
"INVALID Interval selected for " << i_hitSelection.first <<
":\t" 1887 << intervalBegin <<
" > " << (*i_hitInterval) <<
"\n ... delete Selection for " 1888 << i_hitSelection.first;
1889 i_hitSelection.second.clear();
1890 i_hitInterval = i_hitSelection.second.begin();
1892 edm::LogInfo(
"HitSelector") <<
"Interval selected for " << i_hitSelection.first <<
":\t" << intervalBegin
1893 <<
", " << (*i_hitInterval);
1898 if (!i_hitSelection.second.empty())
1903 bool emptyMapUInt(
true);
1905 if (!i_hitSelection.second.empty()) {
1907 unsigned int intervalBegin(999);
1908 for (std::vector<unsigned int>::iterator i_hitInterval = i_hitSelection.second.begin();
1909 i_hitInterval != i_hitSelection.second.end();
1911 if (entry % 2 == 1) {
1912 intervalBegin = *i_hitInterval;
1915 if (intervalBegin > *i_hitInterval) {
1916 edm::LogError(
"HitSelector") <<
"INVALID Interval selected for " << i_hitSelection.first <<
":\t" 1917 << intervalBegin <<
" > " << (*i_hitInterval) <<
"\n ... delete Selection for " 1918 << i_hitSelection.first;
1919 i_hitSelection.second.clear();
1920 i_hitInterval = i_hitSelection.second.begin();
1922 edm::LogInfo(
"HitSelector") <<
"Interval selected for " << i_hitSelection.first <<
":\t" << intervalBegin
1923 <<
", " << (*i_hitInterval);
1928 if (!i_hitSelection.second.empty())
1929 emptyMapUInt =
false;
1933 if (emptyMap && emptyMapUInt) {
1934 m_hitSelection_.clear();
1935 m_hitSelectionUInt_.clear();
1943 std::vector<double> v_cutVariable(parSet.
getParameter<std::vector<double> >(cutVariable));
1944 if (v_cutVariable.size() % 2 == 1) {
1945 edm::LogError(
"HitSelector") <<
"Invalid Hit Selection for " << cutVariable
1946 <<
": need even number of arguments (intervals)" 1947 <<
"\n ... delete Selection for " << cutVariable;
1948 v_cutVariable.clear();
1958 std::vector<unsigned int> v_cutVariable(parSet.
getParameter<std::vector<unsigned int> >(cutVariable));
1959 if (v_cutVariable.size() % 2 == 1) {
1960 edm::LogError(
"HitSelector") <<
"Invalid Hit Selection for " << cutVariable
1961 <<
": need even number of arguments (intervals)" 1962 <<
"\n ... delete Selection for " << cutVariable;
1963 v_cutVariable.clear();
1979 bool isGoodHit(
true);
1980 bool isGoodHitX(
true);
1981 bool isGoodHitY(
true);
1985 const std::vector<double>& v_hitSelection(i_hitSelection.second);
1986 if (v_hitSelection.empty())
1990 if (hitSelection ==
"phiSens") {
1993 }
else if (hitSelection ==
"phiSensX") {
1996 }
else if (hitSelection ==
"phiSensY") {
2001 else if (hitSelection ==
"resX") {
2004 }
else if (hitSelection ==
"norResX") {
2007 }
else if (hitSelection ==
"probX") {
2010 }
else if (hitSelection ==
"errXHit") {
2013 }
else if (hitSelection ==
"errXTrk") {
2016 }
else if (hitSelection ==
"errX") {
2019 }
else if (hitSelection ==
"errX2") {
2026 if (hitSelection ==
"chargePixel") {
2029 }
else if (hitSelection ==
"clusterProbabilityXY") {
2032 }
else if (hitSelection ==
"clusterProbabilityQ") {
2035 }
else if (hitSelection ==
"clusterProbabilityXYQ") {
2038 }
else if (hitSelection ==
"logClusterProbability") {
2043 else if (hitSelection ==
"baryStripX") {
2046 }
else if (hitSelection ==
"baryStripY") {
2051 else if (hitSelection ==
"resY") {
2054 }
else if (hitSelection ==
"norResY") {
2057 }
else if (hitSelection ==
"probY") {
2060 }
else if (hitSelection ==
"errYHit") {
2063 }
else if (hitSelection ==
"errYTrk") {
2066 }
else if (hitSelection ==
"errY") {
2069 }
else if (hitSelection ==
"errY2") {
2074 if (hitSelection ==
"widthProj") {
2077 }
else if (hitSelection ==
"widthDiff") {
2080 }
else if (hitSelection ==
"charge") {
2083 }
else if (hitSelection ==
"maxCharge") {
2086 }
else if (hitSelection ==
"chargeOnEdges") {
2089 }
else if (hitSelection ==
"chargeAsymmetry") {
2092 }
else if (hitSelection ==
"chargeLRplus") {
2095 }
else if (hitSelection ==
"chargeLRminus") {
2098 }
else if (hitSelection ==
"sOverN") {
2107 const std::vector<unsigned int>& v_hitSelection(i_hitSelection.second);
2108 if (v_hitSelection.empty())
2115 if (hitSelection ==
"isOnEdge") {
2118 }
else if (hitSelection ==
"hasBadPixels") {
2121 }
else if (hitSelection ==
"spansTwoRoc") {
2124 }
else if (hitSelection ==
"qBin") {
2129 else if (hitSelection ==
"widthX") {
2132 }
else if (hitSelection ==
"widthY") {
2137 if (hitSelection ==
"width") {
2140 }
else if (hitSelection ==
"edgeStrips") {
2143 }
else if (hitSelection ==
"maxIndex") {
2166 double intervalBegin(999.);
2167 bool isSelected(
false);
2168 for (
auto const& i_hitInterval : v_hitSelection) {
2171 intervalBegin = i_hitInterval;
2172 else if (variable >= intervalBegin && variable < i_hitInterval)
2180 const unsigned int variable2)
const {
2182 unsigned int intervalBegin(999);
2183 bool isSelected(
false);
2184 for (
auto i_hitInterval : v_hitSelection) {
2187 intervalBegin = i_hitInterval;
2188 else if (variable >= intervalBegin && variable <= i_hitInterval) {
2189 if (variable2 == 999 || (variable2 >= intervalBegin && variable2 <= i_hitInterval))
2199 unsigned int goodHitsPerTrack(trackStruct.
v_hitParams.size());
2266 bool moduleInSector(
false);
2267 for (
auto const& i_hitSector : hit.
v_sector) {
2268 if (i_sector.first == i_hitSector) {
2269 moduleInSector =
true;
2273 if (!moduleInSector)
2278 std::map<std::string, TrackerSectorStruct::CorrelationHists>& m_corrHists(sector.
m_correlationHistsX);
2285 m_corrHists[
"HitsGood"].fillCorrHistsX(hit, goodHitsPerTrack);
2287 m_corrHists[
"Hits2D"].fillCorrHistsX(hit, trackStruct.
trkParams.
hits2D);
2293 m_corrHists[
"Phi"].fillCorrHistsX(hit, trackStruct.
trkParams.
phi * 180. /
M_PI);
2295 m_corrHists[
"Dz"].fillCorrHistsX(hit, trackStruct.
trkParams.
dz);
2296 m_corrHists[
"Pt"].fillCorrHistsX(hit, trackStruct.
trkParams.
pt);
2297 m_corrHists[
"P"].fillCorrHistsX(hit, trackStruct.
trkParams.
p);
2298 m_corrHists[
"InvP"].fillCorrHistsX(hit, 1. / trackStruct.
trkParams.
p);
2303 std::map<std::string, TrackerSectorStruct::CorrelationHists>& m_corrHists(sector.
m_correlationHistsY);
2310 m_corrHists[
"HitsGood"].fillCorrHistsY(hit, goodHitsPerTrack);
2312 m_corrHists[
"Hits2D"].fillCorrHistsY(hit, trackStruct.
trkParams.
hits2D);
2318 m_corrHists[
"Phi"].fillCorrHistsY(hit, trackStruct.
trkParams.
phi * 180. /
M_PI);
2320 m_corrHists[
"Dz"].fillCorrHistsY(hit, trackStruct.
trkParams.
dz);
2321 m_corrHists[
"Pt"].fillCorrHistsY(hit, trackStruct.
trkParams.
pt);
2322 m_corrHists[
"P"].fillCorrHistsY(hit, trackStruct.
trkParams.
p);
2323 m_corrHists[
"InvP"].fillCorrHistsY(hit, 1. / trackStruct.
trkParams.
p);
2328 for (
auto& i_sigmaX : sector.
m_sigmaX) {
2329 for (
auto& iHist : i_sigmaX.second) {
2330 if (i_sigmaX.first ==
"sigmaXHit")
2331 iHist->Fill(hit.
errXHit * 10000.);
2332 else if (i_sigmaX.first ==
"sigmaXTrk")
2333 iHist->Fill(hit.
errXTrk * 10000.);
2334 else if (i_sigmaX.first ==
"sigmaX")
2335 iHist->Fill(hit.
errX * 10000.);
2338 for (
auto& i_sigmaY : sector.
m_sigmaY) {
2339 for (
auto& iHist : i_sigmaY.second) {
2340 if (i_sigmaY.first ==
"sigmaYHit")
2341 iHist->Fill(hit.
errYHit * 10000.);
2342 else if (i_sigmaY.first ==
"sigmaYTrk")
2343 iHist->Fill(hit.
errYTrk * 10000.);
2344 else if (i_sigmaY.first ==
"sigmaY")
2345 iHist->Fill(hit.
errY * 10000.);
2354 std::map<std::string, TrackerSectorStruct::CorrelationHists>& m_corrHists(sector.
m_correlationHistsX);
2357 m_corrHists[
"WidthX"].fillCorrHistsX(hit, hit.
widthX);
2358 m_corrHists[
"BaryStripX"].fillCorrHistsX(hit, hit.
baryStripX);
2361 m_corrHists[
"ChargePixel"].fillCorrHistsX(hit, hit.
chargePixel);
2366 m_corrHists[
"IsOnEdge"].fillCorrHistsX(hit, hit.
isOnEdge);
2367 m_corrHists[
"HasBadPixels"].fillCorrHistsX(hit, hit.
hasBadPixels);
2368 m_corrHists[
"SpansTwoRoc"].fillCorrHistsX(hit, hit.
spansTwoRoc);
2369 m_corrHists[
"QBin"].fillCorrHistsX(hit, hit.
qBin);
2372 m_corrHists[
"ChargeStrip"].fillCorrHistsX(hit, hit.
chargeStrip);
2373 m_corrHists[
"MaxStrip"].fillCorrHistsX(hit, hit.
maxStrip);
2374 m_corrHists[
"MaxCharge"].fillCorrHistsX(hit, hit.
maxCharge);
2375 m_corrHists[
"MaxIndex"].fillCorrHistsX(hit, hit.
maxIndex);
2376 m_corrHists[
"ChargeOnEdges"].fillCorrHistsX(hit, hit.
chargeOnEdges);
2377 m_corrHists[
"ChargeAsymmetry"].fillCorrHistsX(hit, hit.
chargeAsymmetry);
2378 m_corrHists[
"ChargeLRplus"].fillCorrHistsX(hit, hit.
chargeLRplus);
2379 m_corrHists[
"ChargeLRminus"].fillCorrHistsX(hit, hit.
chargeLRminus);
2380 m_corrHists[
"SOverN"].fillCorrHistsX(hit, hit.
sOverN);
2381 m_corrHists[
"WidthProj"].fillCorrHistsX(hit, hit.
projWidth);
2382 m_corrHists[
"WidthDiff"].fillCorrHistsX(hit, hit.
projWidth - static_cast<float>(hit.
widthX));
2398 m_corrHists[
"SigmaXHit"].fillCorrHistsX(hit, hit.
errXHit * 10000.);
2399 m_corrHists[
"SigmaXTrk"].fillCorrHistsX(hit, hit.
errXTrk * 10000.);
2400 m_corrHists[
"SigmaX"].fillCorrHistsX(hit, hit.
errX * 10000.);
2402 m_corrHists[
"PhiSens"].fillCorrHistsX(hit, hit.
phiSens * 180. /
M_PI);
2403 m_corrHists[
"PhiSensX"].fillCorrHistsX(hit, hit.
phiSensX * 180. /
M_PI);
2404 m_corrHists[
"PhiSensY"].fillCorrHistsX(hit, hit.
phiSensY * 180. /
M_PI);
2410 sector.
ResX->Fill(hit.
resX * 10000.);
2421 std::map<std::string, TrackerSectorStruct::CorrelationHists>& m_corrHists(sector.
m_correlationHistsY);
2427 m_corrHists[
"WidthY"].fillCorrHistsY(hit, hit.
widthY);
2428 m_corrHists[
"BaryStripY"].fillCorrHistsY(hit, hit.
baryStripY);
2430 m_corrHists[
"ChargePixel"].fillCorrHistsY(hit, hit.
chargePixel);
2435 m_corrHists[
"IsOnEdge"].fillCorrHistsY(hit, hit.
isOnEdge);
2436 m_corrHists[
"HasBadPixels"].fillCorrHistsY(hit, hit.
hasBadPixels);
2437 m_corrHists[
"SpansTwoRoc"].fillCorrHistsY(hit, hit.
spansTwoRoc);
2438 m_corrHists[
"QBin"].fillCorrHistsY(hit, hit.
qBin);
2441 m_corrHists[
"SigmaYHit"].fillCorrHistsY(hit, hit.
errYHit * 10000.);
2442 m_corrHists[
"SigmaYTrk"].fillCorrHistsY(hit, hit.
errYTrk * 10000.);
2443 m_corrHists[
"SigmaY"].fillCorrHistsY(hit, hit.
errY * 10000.);
2445 m_corrHists[
"PhiSens"].fillCorrHistsY(hit, hit.
phiSens * 180. /
M_PI);
2446 m_corrHists[
"PhiSensX"].fillCorrHistsY(hit, hit.
phiSensX * 180. /
M_PI);
2447 m_corrHists[
"PhiSensY"].fillCorrHistsY(hit, hit.
phiSensY * 180. /
M_PI);
2453 sector.
ResY->Fill(hit.
resY * 10000.);
2463 unsigned int goodHitsPerTrack(trackStruct.
v_hitParams.size());
2471 for (
auto const& i_hit : trackStruct.
v_hitParams) {
2477 bool moduleInSector(
false);
2478 for (
auto const& i_hitSector : i_hit.v_sector) {
2479 if (i_sector.first == i_hitSector) {
2480 moduleInSector =
true;
2484 if (!moduleInSector)
2490 if (i_hit.goodXMeasurement) {
2495 if (i_hit.errXWoApe < i_errBins.second.first || i_hit.errXWoApe >= i_errBins.second.second) {
2498 i_sector.second.m_binnedHists[i_errBins.first][
"sigmaX"]->Fill(i_hit.errXWoApe);
2499 i_sector.second.m_binnedHists[i_errBins.first][
"norResX"]->Fill(i_hit.norResX);
2502 i_sector.second.ResX->Fill(i_hit.resX * 10000.);
2503 i_sector.second.NorResX->Fill(i_hit.norResX);
2506 if (i_hit.goodYMeasurement) {
2511 if (i_hit.errYWoApe < i_errBins.second.first || i_hit.errYWoApe >= i_errBins.second.second) {
2514 i_sector.second.m_binnedHists[i_errBins.first][
"sigmaY"]->Fill(i_hit.errYWoApe);
2515 i_sector.second.m_binnedHists[i_errBins.first][
"norResY"]->Fill(i_hit.norResY);
2518 i_sector.second.ResY->Fill(i_hit.resY * 10000.);
2519 i_sector.second.NorResY->Fill(i_hit.norResY);
2531 for (
auto const& i_errBins : i_sector.second.m_binnedHists) {
2532 std::map<std::string, TH1*> m_Hists = i_errBins.second;
2535 double integralX = m_Hists[
"norResX"]->Integral();
2536 i_sector.second.EntriesX->SetBinContent(i_errBins.first, integralX);
2538 if (i_sector.second.isPixel) {
2539 double integralY = m_Hists[
"norResY"]->Integral();
2540 i_sector.second.EntriesY->SetBinContent(i_errBins.first, integralY);
2563 else if (dynamic_cast<const SiStripRecHit1D*>(&hit) ||
dynamic_cast<const SiStripRecHit2D*
>(&hit))
2566 else if (dynamic_cast<const SiStripMatchedRecHit2D*>(&hit))
2568 else if (dynamic_cast<const ProjectedSiStripRecHit2D*>(&hit)) {
2572 edm::LogError(
"UnkownType") <<
"@SUB=AlignmentTrackSelector::isHit2D" 2573 <<
"Tracker hit not in pixel, neither SiStripRecHit[12]D nor " 2574 <<
"SiStripMatchedRecHit2D nor ProjectedSiStripRecHit2D.";
2579 edm::LogWarning(
"DetectorMismatch") <<
"@SUB=AlignmentTrackSelector::isHit2D" 2580 <<
"Hit not in tracker with 'official' dimension >=2.";
2595 if (beamSpotHandle.
isValid()) {
2596 beamSpot = *beamSpotHandle;
2598 edm::LogError(
"ApeEstimator") <<
"No beam spot available from EventSetup" 2599 <<
"\n...skip event";
2614 typedef std::vector<ConstTrajTrackPair> ConstTrajTrackPairCollection;
2615 ConstTrajTrackPairCollection trajTracks;
2618 for (i_trajTrack = m_TrajTracksMap->
begin(); i_trajTrack != m_TrajTracksMap->
end(); ++i_trajTrack) {
2619 trajTracks.push_back(
ConstTrajTrackPair(&(*(*i_trajTrack).key), &(*(*i_trajTrack).val)));
2623 unsigned int trackSizeGood(0);
2624 ConstTrajTrackPairCollection::const_iterator iTrack;
2625 for (iTrack = trajTracks.begin(); iTrack != trajTracks.end(); ++iTrack) {
2635 const std::vector<TrajectoryMeasurement> v_meas = (*traj).measurements();
2638 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 &)