148 bool checkModuleIds(
const unsigned int,
const std::vector<unsigned int>&)
const;
172 bool inUintInterval(
const std::vector<unsigned int>&,
const unsigned int,
const unsigned int = 999)
const;
223 : parameterSet_(iConfig),
226 siStripClusterInfo_(consumesCollector(),
std::
string(
"")),
231 maxTracksPerEvent_(parameterSet_.getParameter<unsigned
int>(
"maxTracksPerEvent")),
232 minGoodHitsPerTrack_(parameterSet_.getParameter<unsigned
int>(
"minGoodHitsPerTrack")),
233 analyzerMode_(parameterSet_.getParameter<
bool>(
"analyzerMode")),
234 calculateApe_(parameterSet_.getParameter<
bool>(
"calculateApe")) {
251 edm::LogError(
"SectorBuilder") <<
"TrackerTreeFile not found";
254 TTree* tkTree(
nullptr);
255 tkTreeFile->GetObject(
"TrackerTreeGenerator/TrackerTree/TrackerTree", tkTree);
259 edm::LogError(
"SectorBuilder") <<
"TrackerTree not found in file";
262 unsigned int rawId(999), subdetId(999),
layer(999),
side(999), half(999), rod(999),
ring(999), petal(999), blade(999),
264 bool isDoubleSide(
false), isRPhi(
false), isStereo(
false);
265 int uDirection(999), vDirection(999), wDirection(999);
266 float posR(999.
F), posPhi(999.
F), posEta(999.
F),
posX(999.
F),
posY(999.
F), posZ(999.
F);
268 tkTree->SetBranchAddress(
"RawId", &
rawId);
269 tkTree->SetBranchAddress(
"SubdetId", &subdetId);
270 tkTree->SetBranchAddress(
"Layer", &
layer);
271 tkTree->SetBranchAddress(
"Side", &
side);
272 tkTree->SetBranchAddress(
"Half", &half);
273 tkTree->SetBranchAddress(
"Rod", &rod);
274 tkTree->SetBranchAddress(
"Ring", &
ring);
275 tkTree->SetBranchAddress(
"Petal", &petal);
276 tkTree->SetBranchAddress(
"Blade", &blade);
277 tkTree->SetBranchAddress(
"Panel", &panel);
278 tkTree->SetBranchAddress(
"OuterInner", &outerInner);
279 tkTree->SetBranchAddress(
"Module", &
module);
280 tkTree->SetBranchAddress(
"NStrips", &
nStrips);
281 tkTree->SetBranchAddress(
"IsDoubleSide", &isDoubleSide);
282 tkTree->SetBranchAddress(
"IsRPhi", &isRPhi);
283 tkTree->SetBranchAddress(
"IsStereo", &isStereo);
284 tkTree->SetBranchAddress(
"UDirection", &uDirection);
285 tkTree->SetBranchAddress(
"VDirection", &vDirection);
286 tkTree->SetBranchAddress(
"WDirection", &wDirection);
287 tkTree->SetBranchAddress(
"PosR", &posR);
288 tkTree->SetBranchAddress(
"PosPhi", &posPhi);
289 tkTree->SetBranchAddress(
"PosEta", &posEta);
290 tkTree->SetBranchAddress(
"PosX", &
posX);
291 tkTree->SetBranchAddress(
"PosY", &
posY);
292 tkTree->SetBranchAddress(
"PosZ", &posZ);
294 int nModules(tkTree->GetEntries());
298 unsigned int sectorCounter(0);
300 edm::LogInfo(
"SectorBuilder") <<
"There are " << v_sectorDef.size() <<
" Sectors definded";
301 for (
auto const& parSet : v_sectorDef) {
304 std::vector<unsigned int> v_rawId(parSet.getParameter<std::vector<unsigned int> >(
"rawId")),
305 v_subdetId(parSet.getParameter<std::vector<unsigned int> >(
"subdetId")),
306 v_layer(parSet.getParameter<std::vector<unsigned int> >(
"layer")),
307 v_side(parSet.getParameter<std::vector<unsigned int> >(
"side")),
308 v_half(parSet.getParameter<std::vector<unsigned int> >(
"half")),
309 v_rod(parSet.getParameter<std::vector<unsigned int> >(
"rod")),
310 v_ring(parSet.getParameter<std::vector<unsigned int> >(
"ring")),
311 v_petal(parSet.getParameter<std::vector<unsigned int> >(
"petal")),
312 v_blade(parSet.getParameter<std::vector<unsigned int> >(
"blade")),
313 v_panel(parSet.getParameter<std::vector<unsigned int> >(
"panel")),
314 v_outerInner(parSet.getParameter<std::vector<unsigned int> >(
"outerInner")),
315 v_module(parSet.getParameter<std::vector<unsigned int> >(
"module")),
316 v_nStrips(parSet.getParameter<std::vector<unsigned int> >(
"nStrips")),
317 v_isDoubleSide(parSet.getParameter<std::vector<unsigned int> >(
"isDoubleSide")),
318 v_isRPhi(parSet.getParameter<std::vector<unsigned int> >(
"isRPhi")),
319 v_isStereo(parSet.getParameter<std::vector<unsigned int> >(
"isStereo"));
320 std::vector<int> v_uDirection(parSet.getParameter<std::vector<int> >(
"uDirection")),
321 v_vDirection(parSet.getParameter<std::vector<int> >(
"vDirection")),
322 v_wDirection(parSet.getParameter<std::vector<int> >(
"wDirection"));
323 std::vector<double> v_posR(parSet.getParameter<std::vector<double> >(
"posR")),
324 v_posPhi(parSet.getParameter<std::vector<double> >(
"posPhi")),
325 v_posEta(parSet.getParameter<std::vector<double> >(
"posEta")),
326 v_posX(parSet.getParameter<std::vector<double> >(
"posX")),
327 v_posY(parSet.getParameter<std::vector<double> >(
"posY")),
328 v_posZ(parSet.getParameter<std::vector<double> >(
"posZ"));
339 tkSector.
name = sectorName;
347 if (sectorCounter == 1) {
408 bool moduleSelected(
false);
409 for (
auto const& i_rawId : allSectors.v_rawId) {
410 if (
rawId == i_rawId)
411 moduleSelected =
true;
414 allSectors.v_rawId.push_back(
rawId);
419 for (
auto const& i_rawId : tkSector.
v_rawId) {
436 <<
"Incorrect Sector Definition: there are pixel and strip modules within one sector" 437 <<
"\n... sector selection is not applied, sector " << sectorCounter <<
" is not built";
443 edm::LogInfo(
"SectorBuilder") <<
"There are " << tkSector.
v_rawId.size() <<
" Modules in Sector " << sectorCounter;
454 if (v_id.size() % 2 == 1) {
456 <<
"Incorrect Sector Definition: Position Vectors need even number of arguments (Intervals)" 457 <<
"\n... sector selection is not applied, sector " << sectorCounter <<
" is not built";
461 double intervalBegin(999.);
462 for (
auto const& i_id : v_id) {
465 intervalBegin = i_id;
466 if (
entry % 2 == 0 && intervalBegin > i_id) {
467 edm::LogError(
"SectorBuilder") <<
"Incorrect Sector Definition (Position Vector Intervals): \t" << intervalBegin
468 <<
" is bigger than " << i_id <<
" but is expected to be smaller" 469 <<
"\n... sector selection is not applied, sector " << sectorCounter
480 for (
auto const& i_id : v_id) {
490 for (
auto const& i_id : v_id) {
493 if (2 == i_id && !
id)
502 for (
auto const& i_id : v_id) {
513 double intervalBegin(999.);
514 for (
auto const& i_id : v_id) {
517 intervalBegin = i_id;
518 if (
entry % 2 == 0 &&
id >= intervalBegin &&
id < i_id)
525 bool commonModules(
false);
526 for (std::map<unsigned int, TrackerSectorStruct>::const_iterator i_sector =
m_tkSector_.begin();
529 std::map<unsigned int, TrackerSectorStruct>::const_iterator i_sector2(i_sector);
530 for (++i_sector2; i_sector2 !=
m_tkSector_.end(); ++i_sector2) {
531 unsigned int nCommonModules(0);
532 for (
auto const& i_module : (*i_sector).second.v_rawId) {
533 for (
auto const& i_module2 : (*i_sector2).second.v_rawId) {
534 if (i_module2 == i_module)
538 if (nCommonModules == 0)
541 edm::LogError(
"SectorBuilder") <<
"Sector " << (*i_sector).first <<
" and Sector " << (*i_sector2).first
542 <<
" have " << nCommonModules <<
" Modules in common";
543 commonModules =
true;
547 if (static_cast<int>(allSectors.
v_rawId.size()) == nModules)
548 edm::LogInfo(
"SectorBuilder") <<
"ALL Tracker Modules are contained in the Sectors";
550 edm::LogWarning(
"SectorBuilder") <<
"There are " << allSectors.
v_rawId.size() <<
" Modules in all Sectors" 551 <<
" out of " << nModules <<
" Tracker Modules";
553 edm::LogInfo(
"SectorBuilder") <<
"There are ZERO modules associated to different sectors, no ambiguities exist";
556 <<
"There are modules associated to different sectors, APE value cannot be assigned reasonably";
563 if (v_residualErrorBinning.size() == 1) {
564 edm::LogError(
"ResidualErrorBinning") <<
"Incorrect selection of Residual Error Bins (used for APE calculation): \t" 565 <<
"Only one argument passed, so no interval is specified" 566 <<
"\n... delete whole bin selection";
570 unsigned int binCounter(-1);
571 for (
auto const& i_binning : v_residualErrorBinning) {
573 if (binCounter == 0) {
580 <<
"Incorrect selection of Residual Error Bins (used for APE calculation): \t" <<
xMin <<
" is bigger than " 581 <<
xMax <<
" but is expected to be smaller" 582 <<
"\n... delete whole bin selection";
591 <<
m_resErrBins_.size() <<
" Intervals of residual errors used for separate APE calculation sucessfully set";
598 for (std::vector<unsigned int>::iterator i_errHists = v_errHists.begin(); i_errHists != v_errHists.end();
600 for (std::vector<unsigned int>::iterator i_errHists2 = i_errHists; i_errHists2 != v_errHists.end();) {
602 if (*i_errHists == *i_errHists2) {
603 edm::LogError(
"BookSectorHists") <<
"Value of vErrHists in config exists twice: " << *i_errHists
604 <<
"\n... delete one of both";
605 v_errHists.erase(i_errHists2);
613 double widthMax = zoomHists ? 20. : 200.;
614 double chargePixelMax = zoomHists ? 200000. : 2000000.;
615 double chargeStripMax = zoomHists ? 1000. : 10000.;
616 double sOverNMax = zoomHists ? 200. : 2000.;
617 double logClusterProbMin = zoomHists ? -5. : -15.;
619 double resXAbsMax = zoomHists ? 0.5 : 5.;
620 double norResXAbsMax = zoomHists ? 10. : 50.;
621 double probXMin = zoomHists ? -0.01 : -0.1;
622 double probXMax = zoomHists ? 0.11 : 1.1;
623 double sigmaXMin = zoomHists ? 0. : -0.05;
624 double sigmaXMax = zoomHists ? 0.02 : 1.;
626 double sigmaXHitMax = zoomHists ? 0.02 : 1.;
627 double phiSensXMax = zoomHists ? 31. : 93.;
629 double norChi2Max = zoomHists ? 5. : 1000.;
630 double d0Max = zoomHists ? 0.02 : 40.;
631 double dzMax = zoomHists ? 15. : 100.;
632 double pMax = zoomHists ? 200. : 2000.;
633 double invPMax = zoomHists ? 0.05 : 10.;
641 sector <<
"Sector_" << i_sector.first;
645 i_sector.second.Name = secDir.
make<TH1F>(
"z_name", i_sector.second.name.c_str(), 1, 0, 1);
648 if (i_sector.second.v_rawId.empty()) {
652 i_sector.second.setCorrHistParams(&secDir, norResXAbsMax, sigmaXHitMax,
sigmaXMax);
655 const bool pixelSector(i_sector.second.isPixel);
658 i_sector.second.m_correlationHistsX[
"WidthX"] = i_sector.second.bookCorrHistsX(
"WidthX",
662 static_cast<int>(widthMax),
663 static_cast<int>(widthMax),
667 i_sector.second.m_correlationHistsX[
"BaryStripX"] = i_sector.second.bookCorrHistsX(
668 "BaryStripX",
"barycenter of cluster charge",
"b_{cl,x}",
"[# channels]", 800, 100, -10., 790.,
"nph");
671 i_sector.second.m_correlationHistsY[
"WidthY"] = i_sector.second.bookCorrHistsY(
"WidthY",
675 static_cast<int>(widthMax),
676 static_cast<int>(widthMax),
680 i_sector.second.m_correlationHistsY[
"BaryStripY"] = i_sector.second.bookCorrHistsY(
681 "BaryStripY",
"barycenter of cluster charge",
"b_{cl,y}",
"[# channels]", 800, 100, -10., 790.,
"nph");
683 i_sector.second.m_correlationHistsX[
"ChargePixel"] = i_sector.second.bookCorrHistsX(
684 "ChargePixel",
"cluster charge",
"c_{cl}",
"[e]", 100, 50, 0., chargePixelMax,
"nph");
685 i_sector.second.m_correlationHistsX[
"ClusterProbXY"] = i_sector.second.bookCorrHistsX(
686 "ClusterProbXY",
"cluster probability xy",
"prob_{cl,xy}",
"", 100, 50, 0., 1.,
"nph");
687 i_sector.second.m_correlationHistsX[
"ClusterProbQ"] = i_sector.second.bookCorrHistsX(
688 "ClusterProbQ",
"cluster probability q",
"prob_{cl,q}",
"", 100, 50, 0., 1.,
"nph");
689 i_sector.second.m_correlationHistsX[
"ClusterProbXYQ"] = i_sector.second.bookCorrHistsX(
690 "ClusterProbXYQ",
"cluster probability xyq",
"prob_{cl,xyq}",
"", 100, 50, 0., 1.,
"nph");
691 i_sector.second.m_correlationHistsX[
"LogClusterProb"] = i_sector.second.bookCorrHistsX(
692 "LogClusterProb",
"cluster probability xy",
"log(prob_{cl,xy})",
"", 60, 30, logClusterProbMin, 0.,
"nph");
693 i_sector.second.m_correlationHistsX[
"IsOnEdge"] =
694 i_sector.second.bookCorrHistsX(
"IsOnEdge",
"IsOnEdge",
"isOnEdge",
"", 2, 2, 0, 2,
"nph");
695 i_sector.second.m_correlationHistsX[
"HasBadPixels"] =
696 i_sector.second.bookCorrHistsX(
"HasBadPixels",
"HasBadPixels",
"hasBadPixels",
"", 2, 2, 0, 2,
"nph");
697 i_sector.second.m_correlationHistsX[
"SpansTwoRoc"] =
698 i_sector.second.bookCorrHistsX(
"SpansTwoRoc",
"SpansTwoRoc",
"spansTwoRoc",
"", 2, 2, 0, 2,
"nph");
699 i_sector.second.m_correlationHistsX[
"QBin"] =
700 i_sector.second.bookCorrHistsX(
"QBin",
"q bin",
"q bin",
"", 8, 8, 0, 8,
"nph");
702 i_sector.second.m_correlationHistsY[
"ChargePixel"] = i_sector.second.bookCorrHistsY(
703 "ChargePixel",
"cluster charge",
"c_{cl}",
"[e]", 100, 50, 0., chargePixelMax,
"nph");
704 i_sector.second.m_correlationHistsY[
"ClusterProbXY"] = i_sector.second.bookCorrHistsY(
705 "ClusterProbXY",
"cluster probability xy",
"prob_{cl,xy}",
"", 100, 50, 0., 1.,
"nph");
706 i_sector.second.m_correlationHistsY[
"ClusterProbQ"] = i_sector.second.bookCorrHistsY(
707 "ClusterProbQ",
"cluster probability q",
"prob_{cl,q}",
"", 100, 50, 0., 1.,
"nph");
708 i_sector.second.m_correlationHistsY[
"ClusterProbXYQ"] = i_sector.second.bookCorrHistsY(
709 "ClusterProbXYQ",
"cluster probability xyq",
"prob_{cl,xyq}",
"", 100, 50, 0., 1.,
"nph");
710 i_sector.second.m_correlationHistsY[
"LogClusterProb"] = i_sector.second.bookCorrHistsY(
711 "LogClusterProb",
"cluster probability xy",
"log(prob_{cl,xy})",
"", 60, 30, logClusterProbMin, 0.,
"nph");
712 i_sector.second.m_correlationHistsY[
"IsOnEdge"] =
713 i_sector.second.bookCorrHistsY(
"IsOnEdge",
"IsOnEdge",
"isOnEdge",
"", 2, 2, 0, 2,
"nph");
714 i_sector.second.m_correlationHistsY[
"HasBadPixels"] =
715 i_sector.second.bookCorrHistsY(
"HasBadPixels",
"HasBadPixels",
"hasBadPixels",
"", 2, 2, 0, 2,
"nph");
716 i_sector.second.m_correlationHistsY[
"SpansTwoRoc"] =
717 i_sector.second.bookCorrHistsY(
"SpansTwoRoc",
"SpansTwoRoc",
"spansTwoRoc",
"", 2, 2, 0, 2,
"nph");
718 i_sector.second.m_correlationHistsY[
"QBin"] =
719 i_sector.second.bookCorrHistsY(
"QBin",
"q bin",
"q bin",
"", 8, 8, 0, 8,
"nph");
723 i_sector.second.m_correlationHistsX[
"ChargeStrip"] = i_sector.second.bookCorrHistsX(
724 "ChargeStrip",
"cluster charge",
"c_{cl}",
"[APV counts]", 100, 50, 0., chargeStripMax,
"nph");
725 i_sector.second.m_correlationHistsX[
"MaxStrip"] = i_sector.second.bookCorrHistsX(
726 "MaxStrip",
"strip with max. charge",
"n_{cl,max}",
"[# strips]", 800, 800, -10., 790.,
"npht");
727 i_sector.second.m_correlationHistsX[
"MaxCharge"] = i_sector.second.bookCorrHistsX(
728 "MaxCharge",
"charge of strip with max. charge",
"c_{cl,max}",
"[APV counts]", 300, 75, -10., 290.,
"nph");
729 i_sector.second.m_correlationHistsX[
"MaxIndex"] = i_sector.second.bookCorrHistsX(
730 "MaxIndex",
"cluster-index of strip with max. charge",
"i_{cl,max}",
"[# strips]", 10, 10, 0., 10.,
"nph");
731 i_sector.second.m_correlationHistsX[
"ChargeOnEdges"] =
732 i_sector.second.bookCorrHistsX(
"ChargeOnEdges",
733 "fraction of charge on edge strips",
734 "(c_{st,L}+c_{st,R})/c_{cl}",
741 i_sector.second.m_correlationHistsX[
"ChargeAsymmetry"] =
742 i_sector.second.bookCorrHistsX(
"ChargeAsymmetry",
743 "asymmetry of charge on edge strips",
744 "(c_{st,L}-c_{st,R})/c_{cl}",
751 i_sector.second.m_correlationHistsX[
"ChargeLRplus"] =
752 i_sector.second.bookCorrHistsX(
"ChargeLRplus",
753 "fraction of charge not on maxStrip",
754 "(c_{cl,L}+c_{cl,R})/c_{cl}",
761 i_sector.second.m_correlationHistsX[
"ChargeLRminus"] =
762 i_sector.second.bookCorrHistsX(
"ChargeLRminus",
763 "asymmetry of charge L and R of maxStrip",
764 "(c_{cl,L}-c_{cl,R})/c_{cl}",
771 i_sector.second.m_correlationHistsX[
"SOverN"] =
772 i_sector.second.bookCorrHistsX(
"SOverN",
"signal over noise",
"s/N",
"", 100, 50, 0, sOverNMax,
"nph");
773 i_sector.second.m_correlationHistsX[
"WidthProj"] = i_sector.second.bookCorrHistsX(
774 "WidthProj",
"projected width",
"w_{p}",
"[# strips]", 200, 20, 0., widthMax,
"nph");
775 i_sector.second.m_correlationHistsX[
"WidthDiff"] = i_sector.second.bookCorrHistsX(
"WidthDiff",
785 i_sector.second.WidthVsWidthProjected = secDir.
make<TH2F>(
"h2_widthVsWidthProj",
786 "w_{cl} vs. w_{p};w_{p} [# strips];w_{cl} [# strips]",
787 static_cast<int>(widthMax),
790 static_cast<int>(widthMax),
793 i_sector.second.PWidthVsWidthProjected =
794 secDir.
make<TProfile>(
"p_widthVsWidthProj",
795 "w_{cl} vs. w_{p};w_{p} [# strips];w_{cl} [# strips]",
796 static_cast<int>(widthMax),
800 i_sector.second.WidthDiffVsMaxStrip =
801 secDir.
make<TH2F>(
"h2_widthDiffVsMaxStrip",
802 "(w_{p} - w_{cl}) vs. n_{cl,max};n_{cl,max};w_{p} - w_{cl} [# strips]",
806 static_cast<int>(widthMax),
809 i_sector.second.PWidthDiffVsMaxStrip =
810 secDir.
make<TProfile>(
"p_widthDiffVsMaxStrip",
811 "(w_{p} - w_{cl}) vs. n_{cl,max};n_{cl,max};w_{p} - w_{cl} [# strips]",
816 i_sector.second.WidthDiffVsSigmaXHit =
817 secDir.
make<TH2F>(
"h2_widthDiffVsSigmaXHit",
818 "(w_{p} - w_{cl}) vs. #sigma_{hit,x};#sigma_{hit,x} [cm];w_{p} - w_{cl} [# strips]",
825 i_sector.second.PWidthDiffVsSigmaXHit =
826 secDir.
make<TProfile>(
"p_widthDiffVsSigmaXHit",
827 "(w_{p} - w_{cl}) vs. #sigma_{hit,x};#sigma_{hit,x} [cm];w_{p} - w_{cl} [# strips]",
832 i_sector.second.WidthVsPhiSensX =
833 secDir.
make<TH2F>(
"h2_widthVsPhiSensX",
834 "w_{cl} vs. #phi_{module,x};#phi_{module,x} [ ^{o}];w_{cl} [# strips]",
838 static_cast<int>(widthMax),
841 i_sector.second.PWidthVsPhiSensX = secDir.
make<TProfile>(
842 "p_widthVsPhiSensX",
"w_{cl} vs. #phi_{module,x};#phi_{module,x} [ ^{o}];w_{cl} [# strips]", 93, -93, 93);
846 i_sector.second.m_correlationHistsX[
"SigmaXHit"] = i_sector.second.bookCorrHistsX(
847 "SigmaXHit",
"hit error",
"#sigma_{hit,x}",
"[#mum]", 105, 20,
sigmaXMin * 10000.,
sigmaXMax * 10000.,
"np");
848 i_sector.second.m_correlationHistsX[
"SigmaXTrk"] = i_sector.second.bookCorrHistsX(
849 "SigmaXTrk",
"track error",
"#sigma_{trk,x}",
"[#mum]", 105, 20,
sigmaXMin * 10000.,
sigmaXMax * 10000.,
"np");
850 i_sector.second.m_correlationHistsX[
"SigmaX"] = i_sector.second.bookCorrHistsX(
851 "SigmaX",
"residual error",
"#sigma_{r,x}",
"[#mum]", 105, 20,
sigmaXMin * 10000.,
sigmaXMax * 10000.,
"np");
852 i_sector.second.m_correlationHistsX[
"PhiSens"] = i_sector.second.bookCorrHistsX(
853 "PhiSens",
"track angle on sensor",
"#phi_{module}",
"[ ^{o}]", 96, 48, -3, 93,
"nphtr");
854 i_sector.second.m_correlationHistsX[
"PhiSensX"] = i_sector.second.bookCorrHistsX(
855 "PhiSensX",
"track angle on sensor",
"#phi_{module,x}",
"[ ^{o}]", 186, 93, -phiSensXMax, phiSensXMax,
"nphtr");
856 i_sector.second.m_correlationHistsX[
"PhiSensY"] = i_sector.second.bookCorrHistsX(
857 "PhiSensY",
"track angle on sensor",
"#phi_{module,y}",
"[ ^{o}]", 186, 93, -93, 93,
"nphtr");
859 i_sector.second.XHit = secDir.
make<TH1F>(
"h_XHit",
" hit measurement x_{hit};x_{hit} [cm];# hits", 100, -20, 20);
860 i_sector.second.XTrk = secDir.
make<TH1F>(
"h_XTrk",
"track prediction x_{trk};x_{trk} [cm];# hits", 100, -20, 20);
861 i_sector.second.SigmaX2 =
862 secDir.
make<TH1F>(
"h_SigmaX2",
863 "squared residual error #sigma_{r,x}^{2};#sigma_{r,x}^{2} [#mum^{2}];# hits",
866 sigmaX2Max * 10000. * 10000.);
867 i_sector.second.ResX = secDir.
make<TH1F>(
868 "h_ResX",
"residual r_{x};x_{trk}-x_{hit} [#mum];# hits", 100, -resXAbsMax * 10000., resXAbsMax * 10000.);
869 i_sector.second.NorResX =
870 secDir.
make<TH1F>(
"h_NorResX",
871 "normalized residual r_{x}/#sigma_{r,x};(x_{trk}-x_{hit})/#sigma_{r,x};# hits",
875 i_sector.second.ProbX = secDir.
make<TH1F>(
876 "h_ProbX",
"residual probability;prob(r_{x}^{2}/#sigma_{r,x}^{2},1);# hits", 60, probXMin, probXMax);
878 i_sector.second.PhiSensXVsBarycentreX =
879 secDir.
make<TH2F>(
"h2_phiSensXVsBarycentreX",
880 "#phi_{module,x} vs. b_{cl,x};b_{cl,x} [# channels];#phi_{module,x} [ ^{o}]",
887 i_sector.second.PPhiSensXVsBarycentreX =
888 secDir.
make<TProfile>(
"p_phiSensXVsBarycentreX",
889 "#phi_{module,x} vs. b_{cl,x};b_{cl,x} [# channels];#phi_{module,x} [ ^{o}]",
895 i_sector.second.m_correlationHistsY[
"SigmaYHit"] = i_sector.second.bookCorrHistsY(
896 "SigmaYHit",
"hit error",
"#sigma_{hit,y}",
"[#mum]", 105, 20,
sigmaXMin * 10000.,
sigmaXMax * 10000.,
"np");
897 i_sector.second.m_correlationHistsY[
"SigmaYTrk"] = i_sector.second.bookCorrHistsY(
898 "SigmaYTrk",
"track error",
"#sigma_{trk,y}",
"[#mum]", 105, 20,
sigmaXMin * 10000.,
sigmaXMax * 10000.,
"np");
899 i_sector.second.m_correlationHistsY[
"SigmaY"] = i_sector.second.bookCorrHistsY(
900 "SigmaY",
"residual error",
"#sigma_{r,y}",
"[#mum]", 105, 20,
sigmaXMin * 10000.,
sigmaXMax * 10000.,
"np");
901 i_sector.second.m_correlationHistsY[
"PhiSens"] = i_sector.second.bookCorrHistsY(
902 "PhiSens",
"track angle on sensor",
"#phi_{module}",
"[ ^{o}]", 96, 48, -3, 93,
"nphtr");
903 i_sector.second.m_correlationHistsY[
"PhiSensX"] = i_sector.second.bookCorrHistsY(
"PhiSensX",
904 "track angle on sensor",
912 i_sector.second.m_correlationHistsY[
"PhiSensY"] = i_sector.second.bookCorrHistsY(
913 "PhiSensY",
"track angle on sensor",
"#phi_{module,y}",
"[ ^{o}]", 186, 93, -93, 93,
"nphtr");
915 i_sector.second.YHit = secDir.
make<TH1F>(
"h_YHit",
" hit measurement y_{hit};y_{hit} [cm];# hits", 100, -20, 20);
916 i_sector.second.YTrk = secDir.
make<TH1F>(
"h_YTrk",
"track prediction y_{trk};y_{trk} [cm];# hits", 100, -20, 20);
917 i_sector.second.SigmaY2 =
918 secDir.
make<TH1F>(
"h_SigmaY2",
919 "squared residual error #sigma_{r,y}^{2};#sigma_{r,y}^{2} [#mum^{2}];# hits",
922 sigmaX2Max * 10000. * 10000.);
923 i_sector.second.ResY = secDir.
make<TH1F>(
924 "h_ResY",
"residual r_{y};y_{trk}-y_{hit} [#mum];# hits", 100, -resXAbsMax * 10000., resXAbsMax * 10000.);
925 i_sector.second.NorResY =
926 secDir.
make<TH1F>(
"h_NorResY",
927 "normalized residual r_{y}/#sigma_{r,y};(y_{trk}-y_{hit})/#sigma_{r,y};# hits",
931 i_sector.second.ProbY = secDir.
make<TH1F>(
932 "h_ProbY",
"residual probability;prob(r_{y}^{2}/#sigma_{r,y}^{2},1);# hits", 60, probXMin, probXMax);
934 i_sector.second.PhiSensYVsBarycentreY =
935 secDir.
make<TH2F>(
"h2_phiSensYVsBarycentreY",
936 "#phi_{module,y} vs. b_{cl,y};b_{cl,y} [# channels];#phi_{module,y} [ ^{o}]",
943 i_sector.second.PPhiSensYVsBarycentreY =
944 secDir.
make<TProfile>(
"p_phiSensYVsBarycentreY",
945 "#phi_{module,y} vs. b_{cl,y};b_{cl,y} [# channels];#phi_{module,y} [ ^{o}]",
952 i_sector.second.m_correlationHistsX[
"HitsValid"] =
953 i_sector.second.bookCorrHistsX(
"HitsValid",
"# hits",
"[valid]", 50, 0, 50,
"npt");
954 i_sector.second.m_correlationHistsX[
"HitsInvalid"] =
955 i_sector.second.bookCorrHistsX(
"HitsInvalid",
"# hits",
"[invalid]", 20, 0, 20,
"npt");
956 i_sector.second.m_correlationHistsX[
"Hits2D"] =
957 i_sector.second.bookCorrHistsX(
"Hits2D",
"# hits",
"[2D]", 20, 0, 20,
"npt");
958 i_sector.second.m_correlationHistsX[
"LayersMissed"] =
959 i_sector.second.bookCorrHistsX(
"LayersMissed",
"# layers",
"[missed]", 10, 0, 10,
"npt");
960 i_sector.second.m_correlationHistsX[
"HitsPixel"] =
961 i_sector.second.bookCorrHistsX(
"HitsPixel",
"# hits",
"[pixel]", 10, 0, 10,
"npt");
962 i_sector.second.m_correlationHistsX[
"HitsStrip"] =
963 i_sector.second.bookCorrHistsX(
"HitsStrip",
"# hits",
"[strip]", 40, 0, 40,
"npt");
964 i_sector.second.m_correlationHistsX[
"HitsGood"] =
965 i_sector.second.bookCorrHistsX(
"HitsGood",
"# hits",
"[good]", 50, 0, 50,
"npt");
966 i_sector.second.m_correlationHistsX[
"NorChi2"] =
967 i_sector.second.bookCorrHistsX(
"NorChi2",
"#chi^{2}/f",
"", 50, 0, norChi2Max,
"npr");
968 i_sector.second.m_correlationHistsX[
"Theta"] =
969 i_sector.second.bookCorrHistsX(
"Theta",
"#theta",
"[ ^{o}]", 40, -10, 190,
"npt");
970 i_sector.second.m_correlationHistsX[
"Phi"] =
971 i_sector.second.bookCorrHistsX(
"Phi",
"#phi",
"[ ^{o}]", 76, -190, 190,
"npt");
972 i_sector.second.m_correlationHistsX[
"D0Beamspot"] =
973 i_sector.second.bookCorrHistsX(
"D0Beamspot",
"d_{0, BS}",
"[cm]", 40, -
d0Max,
d0Max,
"npt");
974 i_sector.second.m_correlationHistsX[
"Dz"] =
975 i_sector.second.bookCorrHistsX(
"Dz",
"d_{z}",
"[cm]", 40, -
dzMax,
dzMax,
"npt");
976 i_sector.second.m_correlationHistsX[
"Pt"] =
977 i_sector.second.bookCorrHistsX(
"Pt",
"p_{t}",
"[GeV]", 50, 0,
pMax,
"npt");
978 i_sector.second.m_correlationHistsX[
"P"] = i_sector.second.bookCorrHistsX(
"P",
"|p|",
"[GeV]", 50, 0,
pMax,
"npt");
979 i_sector.second.m_correlationHistsX[
"InvP"] =
980 i_sector.second.bookCorrHistsX(
"InvP",
"1/|p|",
"[GeV^{-1}]", 25, 0, invPMax,
"t");
981 i_sector.second.m_correlationHistsX[
"MeanAngle"] =
982 i_sector.second.bookCorrHistsX(
"MeanAngle",
"<#phi_{module}>",
"[ ^{o}]", 25, -5, 95,
"npt");
986 i_sector.second.m_correlationHistsY[
"HitsValid"] =
987 i_sector.second.bookCorrHistsY(
"HitsValid",
"# hits",
"[valid]", 50, 0, 50,
"npt");
988 i_sector.second.m_correlationHistsY[
"HitsInvalid"] =
989 i_sector.second.bookCorrHistsY(
"HitsInvalid",
"# hits",
"[invalid]", 20, 0, 20,
"npt");
990 i_sector.second.m_correlationHistsY[
"Hits2D"] =
991 i_sector.second.bookCorrHistsY(
"Hits2D",
"# hits",
"[2D]", 20, 0, 20,
"npt");
992 i_sector.second.m_correlationHistsY[
"LayersMissed"] =
993 i_sector.second.bookCorrHistsY(
"LayersMissed",
"# layers",
"[missed]", 10, 0, 10,
"npt");
994 i_sector.second.m_correlationHistsY[
"HitsPixel"] =
995 i_sector.second.bookCorrHistsY(
"HitsPixel",
"# hits",
"[pixel]", 10, 0, 10,
"npt");
996 i_sector.second.m_correlationHistsY[
"HitsStrip"] =
997 i_sector.second.bookCorrHistsY(
"HitsStrip",
"# hits",
"[strip]", 40, 0, 40,
"npt");
998 i_sector.second.m_correlationHistsY[
"HitsGood"] =
999 i_sector.second.bookCorrHistsY(
"HitsGood",
"# hits",
"[good]", 50, 0, 50,
"npt");
1000 i_sector.second.m_correlationHistsY[
"NorChi2"] =
1001 i_sector.second.bookCorrHistsY(
"NorChi2",
"#chi^{2}/f",
"", 50, 0, norChi2Max,
"npr");
1002 i_sector.second.m_correlationHistsY[
"Theta"] =
1003 i_sector.second.bookCorrHistsY(
"Theta",
"#theta",
"[ ^{o}]", 40, -10, 190,
"npt");
1004 i_sector.second.m_correlationHistsY[
"Phi"] =
1005 i_sector.second.bookCorrHistsY(
"Phi",
"#phi",
"[ ^{o}]", 76, -190, 190,
"npt");
1006 i_sector.second.m_correlationHistsY[
"D0Beamspot"] =
1007 i_sector.second.bookCorrHistsY(
"D0Beamspot",
"d_{0, BS}",
"[cm]", 40, -
d0Max,
d0Max,
"npt");
1008 i_sector.second.m_correlationHistsY[
"Dz"] =
1009 i_sector.second.bookCorrHistsY(
"Dz",
"d_{z}",
"[cm]", 40, -
dzMax,
dzMax,
"npt");
1010 i_sector.second.m_correlationHistsY[
"Pt"] =
1011 i_sector.second.bookCorrHistsY(
"Pt",
"p_{t}",
"[GeV]", 50, 0,
pMax,
"npt");
1012 i_sector.second.m_correlationHistsY[
"P"] =
1013 i_sector.second.bookCorrHistsY(
"P",
"|p|",
"[GeV]", 50, 0,
pMax,
"npt");
1014 i_sector.second.m_correlationHistsY[
"InvP"] =
1015 i_sector.second.bookCorrHistsY(
"InvP",
"1/|p|",
"[GeV^{-1}]", 25, 0, invPMax,
"t");
1016 i_sector.second.m_correlationHistsY[
"MeanAngle"] =
1017 i_sector.second.bookCorrHistsY(
"MeanAngle",
"<#phi_{module}>",
"[ ^{o}]", 25, -5, 95,
"npt");
1021 for (
auto const& i_errHists : v_errHists) {
1022 double xMin(0.01 * (i_errHists - 1)),
xMax(0.01 * (i_errHists));
1023 std::stringstream sigmaXHit, sigmaXTrk,
sigmaX;
1024 sigmaXHit <<
"h_sigmaXHit_" << i_errHists;
1025 sigmaXTrk <<
"h_sigmaXTrk_" << i_errHists;
1026 sigmaX <<
"h_sigmaX_" << i_errHists;
1027 i_sector.second.m_sigmaX[
"sigmaXHit"].push_back(
1028 secDir.
make<TH1F>(sigmaXHit.str().c_str(),
1029 "hit error #sigma_{hit,x};#sigma_{hit,x} [#mum];# hits",
1033 i_sector.second.m_sigmaX[
"sigmaXTrk"].push_back(
1034 secDir.
make<TH1F>(sigmaXTrk.str().c_str(),
1035 "track error #sigma_{trk,x};#sigma_{trk,x} [#mum];# hits",
1039 i_sector.second.m_sigmaX[
"sigmaX"].push_back(
1041 "residual error #sigma_{r,x};#sigma_{r,x} [#mum];# hits",
1046 std::stringstream sigmaYHit, sigmaYTrk,
sigmaY;
1047 sigmaYHit <<
"h_sigmaYHit_" << i_errHists;
1048 sigmaYTrk <<
"h_sigmaYTrk_" << i_errHists;
1049 sigmaY <<
"h_sigmaY_" << i_errHists;
1050 i_sector.second.m_sigmaY[
"sigmaYHit"].push_back(
1051 secDir.
make<TH1F>(sigmaYHit.str().c_str(),
1052 "hit error #sigma_{hit,y};#sigma_{hit,y} [#mum];# hits",
1056 i_sector.second.m_sigmaY[
"sigmaYTrk"].push_back(
1057 secDir.
make<TH1F>(sigmaYTrk.str().c_str(),
1058 "track error #sigma_{trk,y};#sigma_{trk,y} [#mum];# hits",
1062 i_sector.second.m_sigmaY[
"sigmaY"].push_back(
1064 "residual error #sigma_{r,y};#sigma_{r,y} [#mum];# hits",
1075 for (std::vector<unsigned int>::iterator i_errHists = v_errHists.begin(); i_errHists != v_errHists.end();
1077 for (std::vector<unsigned int>::iterator i_errHists2 = i_errHists; i_errHists2 != v_errHists.end();) {
1079 if (*i_errHists == *i_errHists2) {
1080 edm::LogError(
"BookSectorHists") <<
"Value of vErrHists in config exists twice: " << *i_errHists
1081 <<
"\n... delete one of both";
1082 v_errHists.erase(i_errHists2);
1093 std::stringstream
sector;
1094 sector <<
"Sector_" << i_sector.first;
1098 i_sector.second.Name = secDir.
make<TH1F>(
"z_name", i_sector.second.name.c_str(), 1, 0, 1);
1101 if (i_sector.second.v_rawId.empty()) {
1113 interval <<
"Interval_" << i_errBins.first;
1115 i_sector.second.m_binnedHists[i_errBins.first][
"sigmaX"] =
1116 intDir.
make<TH1F>(
"h_sigmaX",
"residual resolution #sigma_{x};#sigma_{x} [cm];# hits", 100, 0., 0.01);
1117 i_sector.second.m_binnedHists[i_errBins.first][
"norResX"] = intDir.
make<TH1F>(
1118 "h_norResX",
"normalized residual r_{x}/#sigma_{r,x};(x_{trk}-x_{hit})/#sigma_{r,x};# hits", 100, -10, 10);
1119 if (i_sector.second.isPixel) {
1120 i_sector.second.m_binnedHists[i_errBins.first][
"sigmaY"] =
1121 intDir.
make<TH1F>(
"h_sigmaY",
"residual resolution #sigma_{y};#sigma_{y} [cm];# hits", 100, 0., 0.01);
1122 i_sector.second.m_binnedHists[i_errBins.first][
"norResY"] = intDir.
make<TH1F>(
1123 "h_norResY",
"normalized residual r_{y}/#sigma_{r,y};(y_{trk}-y_{hit})/#sigma_{r,y};# hits", 100, -10, 10);
1130 unsigned int rawId(0);
1131 i_sector.second.RawId = resDir.
make<TTree>(
"rawIdTree",
"Tree containing rawIds of all modules in sector");
1132 i_sector.second.RawId->Branch(
"RawId", &
rawId,
"RawId/i");
1133 for (
auto const& i_rawId : i_sector.second.v_rawId) {
1135 i_sector.second.RawId->Fill();
1141 for (
auto& i_binX : v_binX) {
1144 i_sector.second.EntriesX =
1145 resDir.
make<TH1F>(
"h_entriesX",
"# hits used;#sigma_{x} [#mum];# hits", v_binX.size() - 1, &(v_binX[0]));
1146 if (i_sector.second.isPixel) {
1147 i_sector.second.EntriesY =
1148 resDir.
make<TH1F>(
"h_entriesY",
"# hits used;#sigma_{y} [#mum];# hits", v_binX.size() - 1, &(v_binX[0]));
1153 i_sector.second.ResX = resDir.
make<TH1F>(
1154 "h_ResX",
"residual r_{x};x_{trk}-x_{hit} [#mum];# hits", 100, -0.03 * 10000., 0.03 * 10000.);
1155 i_sector.second.NorResX = resDir.
make<TH1F>(
1156 "h_NorResX",
"normalized residual r_{x}/#sigma_{r,x};(x_{trk}-x_{hit})/#sigma_{r,x};# hits", 100, -5., 5.);
1157 if (i_sector.second.isPixel) {
1158 i_sector.second.ResY = resDir.
make<TH1F>(
1159 "h_ResY",
"residual r_{y};y_{trk}-y_{hit} [#mum];# hits", 100, -0.03 * 10000., 0.03 * 10000.);
1160 i_sector.second.NorResY = resDir.
make<TH1F>(
1161 "h_NorResY",
"normalized residual r_{y}/#sigma_{r,y};(y_{trk}-y_{hit})/#sigma_{r,y};# hits", 100, -5., 5.);
1171 int trackSizeBins = zoomHists ? 6 : 201;
1172 double trackSizeMax = trackSizeBins - 1;
1174 double chi2Max = zoomHists ? 100. : 2000.;
1175 double norChi2Max = zoomHists ? 5. : 1000.;
1176 double d0max = zoomHists ? 0.02 : 40.;
1177 double dzmax = zoomHists ? 15. : 100.;
1178 double pMax = zoomHists ? 200. : 2000.;
1183 evtDir.
make<TH1F>(
"h_trackSize",
"# tracks [all];# tracks;# events", trackSizeBins, -1, trackSizeMax);
1185 evtDir.
make<TH1F>(
"h_trackSizeGood",
"# tracks [good];# tracks;# events", trackSizeBins, -1, trackSizeMax);
1187 tkDetector_.
HitsSize = trkDir.make<TH1F>(
"h_hitsSize",
"# hits;# hits;# tracks", 51, -1, 50);
1188 tkDetector_.
HitsValid = trkDir.make<TH1F>(
"h_hitsValid",
"# hits [valid];# hits [valid];# tracks", 51, -1, 50);
1190 trkDir.make<TH1F>(
"h_hitsInvalid",
"# hits [invalid];# hits [invalid];# tracks", 21, -1, 20);
1191 tkDetector_.
Hits2D = trkDir.make<TH1F>(
"h_hits2D",
"# hits [2D];# hits [2D];# tracks", 21, -1, 20);
1193 trkDir.make<TH1F>(
"h_layersMissed",
"# layers [missed];# layers [missed];# tracks", 11, -1, 10);
1194 tkDetector_.
HitsPixel = trkDir.make<TH1F>(
"h_hitsPixel",
"# hits [pixel];# hits [pixel];# tracks", 11, -1, 10);
1195 tkDetector_.
HitsStrip = trkDir.make<TH1F>(
"h_hitsStrip",
"# hits [strip];# hits [strip];# tracks", 41, -1, 40);
1196 tkDetector_.
Charge = trkDir.make<TH1F>(
"h_charge",
"charge q;q [e];# tracks", 5, -2, 3);
1198 tkDetector_.
Ndof = trkDir.make<TH1F>(
"h_ndof",
"# degrees of freedom f;f;# tracks", 101, -1, 100);
1199 tkDetector_.
NorChi2 = trkDir.make<TH1F>(
"h_norChi2",
"normalized #chi^{2};#chi^{2}/f;# tracks", 200, 0, norChi2Max);
1200 tkDetector_.
Prob = trkDir.make<TH1F>(
"h_prob",
" #chi^{2} probability;prob(#chi^{2},f);# tracks", 50, 0, 1);
1201 tkDetector_.
Eta = trkDir.make<TH1F>(
"h_eta",
"pseudorapidity #eta;#eta;# tracks", 100, -5, 5);
1202 tkDetector_.
EtaErr = trkDir.make<TH1F>(
"h_etaErr",
"Error of #eta;#sigma(#eta);# tracks", 100, 0, 0.001);
1204 trkDir.make<TH1F>(
"h_etaSig",
"Significance of #eta;#eta/#sigma(#eta);# tracks", 100, -20000, 20000);
1205 tkDetector_.
Theta = trkDir.make<TH1F>(
"h_theta",
"polar angle #theta;#theta [ ^{o}];# tracks", 100, -10, 190);
1206 tkDetector_.
Phi = trkDir.make<TH1F>(
"h_phi",
"azimuth angle #phi;#phi [ ^{o}];# tracks", 190, -190, 190);
1207 tkDetector_.
PhiErr = trkDir.make<TH1F>(
"h_phiErr",
"Error of #phi;#sigma(#phi) [ ^{o}];# tracks", 100, 0, 0.04);
1209 trkDir.make<TH1F>(
"h_phiSig",
"Significance of #phi;#phi/#sigma(#phi) [ ^{o}];# tracks", 100, -50000, 50000);
1211 "h_d0Beamspot",
"Closest approach d_{0} wrt. beamspot;d_{0, BS} [cm];# tracks", 200, -d0max, d0max);
1213 trkDir.make<TH1F>(
"h_d0BeamspotErr",
"Error of d_{0, BS};#sigma(d_{0, BS}) [cm];# tracks", 200, 0, 0.01);
1215 "h_d0BeamspotSig",
"Significance of d_{0, BS};d_{0, BS}/#sigma(d_{0, BS});# tracks", 100, -5, 5);
1216 tkDetector_.
Dz = trkDir.make<TH1F>(
"h_dz",
"Closest approach d_{z};d_{z} [cm];# tracks", 200, -dzmax, dzmax);
1217 tkDetector_.
DzErr = trkDir.make<TH1F>(
"h_dzErr",
"Error of d_{z};#sigma(d_{z}) [cm];# tracks", 200, 0, 0.01);
1219 trkDir.make<TH1F>(
"h_dzSig",
"Significance of d_{z};d_{z}/#sigma(d_{z});# tracks", 100, -10000, 10000);
1220 tkDetector_.
Pt = trkDir.make<TH1F>(
"h_pt",
"transverse momentum p_{t};p_{t} [GeV];# tracks", 100, 0,
pMax);
1221 tkDetector_.
PtErr = trkDir.make<TH1F>(
"h_ptErr",
"Error of p_{t};#sigma(p_{t}) [GeV];# tracks", 100, 0, 1.6);
1222 tkDetector_.
PtSig = trkDir.make<TH1F>(
"h_ptSig",
"Significance of p_{t};p_{t}/#sigma(p_{t});# tracks", 100, 0, 200);
1223 tkDetector_.
P = trkDir.make<TH1F>(
"h_p",
"momentum magnitude |p|;|p| [GeV];# tracks", 100, 0,
pMax);
1225 "h_meanAngle",
"mean angle on module <#phi_{module}>;<#phi_{module}> [ ^{o}];# tracks", 100, -5, 95);
1226 tkDetector_.
HitsGood = trkDir.make<TH1F>(
"h_hitsGood",
"# hits [good];# hits [good];# tracks", 51, -1, 50);
1229 "h2_meanAngleVsHits",
"<#phi_{module}> vs. # hits;# hits;<#phi_{module}> [ ^{o}]", 51, -1, 50, 50, -5, 95);
1231 trkDir.make<TH2F>(
"h2_hitsGoodVsHitsValid",
1232 "# hits [good] vs. # hits [valid];# hits [valid];# hits [good]",
1240 trkDir.make<TH2F>(
"h2_hitsPixelVsEta",
"# hits [pixel] vs. #eta;#eta;# hits [pixel]", 60, -3, 3, 11, -1, 10);
1242 "h2_hitsPixelVsTheta",
"# hits [pixel] vs. #theta;#theta;# hits [pixel]", 100, -10, 190, 11, -1, 10);
1244 trkDir.make<TH2F>(
"h2_hitsStripVsEta",
"# hits [strip] vs. #eta;#eta;# hits [strip]", 60, -3, 3, 31, -1, 40);
1246 "h2_hitsStripVsTheta",
"# hits [strip] vs. #theta;#theta;# hits [strip]", 100, -10, 190, 31, -1, 40);
1247 tkDetector_.
PtVsEta = trkDir.make<TH2F>(
"h2_ptVsEta",
"p_{t} vs. #eta;#eta;p_{t} [GeV]", 60, -3, 3, 100, 0,
pMax);
1249 trkDir.make<TH2F>(
"h2_ptVsTheta",
"p_{t} vs. #theta;#theta;p_{t} [GeV]", 100, -10, 190, 100, 0,
pMax);
1252 "p_meanAngleVsHits",
"<#phi_{module}> vs. # hits;# hits;<#phi_{module}> [ ^{o}]", 51, -1, 50);
1254 "p_hitsGoodVsHitsValid",
"# hits [good] vs. # hits [valid];# hits [valid];# hits [good]", 51, -1, 50);
1256 trkDir.make<TProfile>(
"p_hitsPixelVsEta",
"# hits [pixel] vs. #eta;#eta;# hits [pixel]", 60, -3, 3);
1258 trkDir.make<TProfile>(
"p_hitsPixelVsTheta",
"# hits [pixel] vs. #theta;#theta;# hits [pixel]", 100, -10, 190);
1260 trkDir.make<TProfile>(
"p_hitsStripVsEta",
"# hits [strip] vs. #eta;#eta;# hits [strip]", 60, -3, 3);
1262 trkDir.make<TProfile>(
"p_hitsStripVsTheta",
"# hits [strip] vs. #theta;#theta;# hits [strip]", 100, -10, 190);
1263 tkDetector_.
PPtVsEta = trkDir.make<TProfile>(
"p_ptVsEta",
"p_{t} vs. #eta;#eta;p_{t} [GeV]", 60, -3, 3);
1264 tkDetector_.
PPtVsTheta = trkDir.make<TProfile>(
"p_ptVsTheta",
"p_{t} vs. #theta;#theta;p_{t} [GeV]", 100, -10, 190);
1273 double d0BeamspotErr =
1284 trkParams.hitsValid =
track.found();
1285 trkParams.hitsInvalid = trkParams.hitsSize - trkParams.hitsValid;
1286 trkParams.layersMissed =
1288 trkParams.hitsPixel = hitPattern.numberOfValidPixelHits();
1289 trkParams.hitsStrip = hitPattern.numberOfValidStripHits();
1290 trkParams.charge =
track.charge();
1291 trkParams.chi2 =
track.chi2();
1292 trkParams.ndof =
track.ndof();
1293 trkParams.norChi2 = trkParams.chi2 / trkParams.ndof;
1294 trkParams.prob = TMath::Prob(trkParams.chi2, trkParams.ndof);
1295 trkParams.eta =
track.eta();
1296 trkParams.etaErr =
track.etaError();
1297 trkParams.theta =
track.theta();
1298 trkParams.phi =
track.phi();
1299 trkParams.phiErr =
track.phiError();
1300 trkParams.d0 =
track.d0();
1301 trkParams.d0Beamspot = -1. *
track.dxy(beamPoint);
1302 trkParams.d0BeamspotErr = d0BeamspotErr;
1303 trkParams.dz =
track.dz();
1304 trkParams.dzErr =
track.dzError();
1305 trkParams.dzBeamspot =
track.dz(beamPoint);
1306 trkParams.p =
track.p();
1307 trkParams.pt =
track.pt();
1308 trkParams.ptErr =
track.ptError();
1310 const std::vector<TrajectoryMeasurement>& v_meas = traj.
measurements();
1313 float meanPhiSensToNorm(0.
F);
1314 for (
auto const& i_meas : v_meas) {
1323 meanPhiSensToNorm += atan(fabs(
sqrt(mom.x() * mom.x() + mom.y() * mom.y()) / mom.z()));
1325 meanPhiSensToNorm *= (1. /
static_cast<float>(trkParams.hitsSize));
1327 trkParams.hits2D = count2D;
1328 trkParams.meanPhiSensToNorm = meanPhiSensToNorm;
1332 if (trkParams.hitsStrip < 11 || trkParams.hits2D < 2 || trkParams.hitsPixel < 2 ||
1333 trkParams.hitsStrip > 35 || trkParams.hitsPixel > 7 || trkParams.norChi2 > 5. || trkParams.pt < 25. ||
1334 trkParams.pt > 150. ||
std::abs(trkParams.d0Beamspot) > 0.02 ||
std::abs(trkParams.dz) > 15.)
1363 for (
auto const& i_rawId : i_sector.second.v_rawId) {
1364 if (
rawId == i_rawId) {
1365 hitParams.
v_sector.push_back(i_sector.first);
1372 int xMomentum(0), yMomentum(0), zMomentum(0);
1373 xMomentum = mom.x() > 0. ? 1 : -1;
1374 yMomentum = mom.y() > 0. ? 1 : -1;
1375 zMomentum = mom.z() > 0. ? 1 : -1;
1377 std::atan(std::fabs(mom.x() / mom.z())) *
1380 float phiSensY = std::atan(std::fabs(mom.y() / mom.z())) *
static_cast<float>(
m_tkTreeVar_[
rawId].vDirection);
1381 hitParams.
phiSens = std::atan(std::fabs(
std::sqrt(mom.x() * mom.x() + mom.y() * mom.y()) / mom.z()));
1382 hitParams.
phiSensX = (xMomentum == zMomentum ? phiSensX : -phiSensX);
1383 hitParams.
phiSensY = (yMomentum == zMomentum ? phiSensY : -phiSensY);
1385 if (!
hit.isValid()) {
1412 edm::LogWarning(
"FillHitVariables") <<
"cant identify wether hit is from pixel or strip";
1417 if (!
hit.detUnit()) {
1424 if (!dynamic_cast<const PixelTopology*>(&detUnit.
type().
topology())) {
1431 errorWithoutAPE =
LocalError(errHitApe.
xx() - lape.
xx(), errHitApe.
xy() - lape.
xy(), errHitApe.
yy() - lape.
yy());
1435 if (!dynamic_cast<const StripTopology*>(&detUnit.
type().
topology())) {
1442 errorWithoutAPE =
LocalError(errHitApe.
xx() - lape.
xx(), errHitApe.
xy() - lape.
xy(), errHitApe.
yy() - lape.
yy());
1446 const LocalError& errHitWoApe = errorWithoutAPE;
1451 edm::LogInfo(
"CalculateAPE") <<
"errHitWoApe " << errHitWoApe <<
"errHitApe " << errHitApe;
1478 const float xHit = positionAndError2Hit.second.posX;
1479 const float xTrk = positionAndError2Trk.second.posX;
1480 const float yHit = positionAndError2Hit.second.posY;
1481 const float yTrk = positionAndError2Trk.second.posY;
1483 const float errXHit2(positionAndError2Hit.second.errX2);
1484 const float errXHitWoApe2(positionAndError2HitWoApe.second.errX2);
1485 const float errXTrk2(positionAndError2Trk.second.errX2);
1486 const float errYHit2(positionAndError2Hit.second.errY2);
1487 const float errYHitWoApe2(positionAndError2HitWoApe.second.errY2);
1488 const float errYTrk2(positionAndError2Trk.second.errY2);
1490 const float errXHit =
std::sqrt(positionAndError2Hit.second.errX2);
1491 const float errXHitWoApe =
std::sqrt(positionAndError2HitWoApe.second.errX2);
1492 const float errXTrk =
std::sqrt(positionAndError2Trk.second.errX2);
1493 const float errYHit =
std::sqrt(positionAndError2Hit.second.errY2);
1494 const float errYHitWoApe =
std::sqrt(positionAndError2HitWoApe.second.errY2);
1495 const float errYTrk =
std::sqrt(positionAndError2Trk.second.errY2);
1497 const float resX = xTrk - xHit;
1498 const float resY = yTrk - yHit;
1501 const float errXWoApe2 = errXHitWoApe2 + errXTrk2;
1502 const float errXWoApe =
std::sqrt(errXWoApe2);
1504 const float errYWoApe2 = errYHitWoApe2 + errYTrk2;
1505 const float errYWoApe =
std::sqrt(errYWoApe2);
1507 const float norResX = resX /
errX;
1508 const float norResY = resY /
errY;
1512 float resXprime(999.
F), resYprime(999.
F), norResXprime(999.
F), norResYprime(999.
F);
1515 norResXprime = norResX;
1518 norResXprime = -norResX;
1520 edm::LogError(
"FillHitVariables") <<
"Incorrect value of uDirection, which gives global module orientation";
1526 norResYprime = norResY;
1529 norResYprime = -norResY;
1531 edm::LogError(
"FillHitVariables") <<
"Incorrect value of vDirection, which gives global module orientation";
1536 hitParams.
xHit = xHit;
1537 hitParams.
xTrk = xTrk;
1547 hitParams.
resX = resXprime;
1548 hitParams.
norResX = norResXprime;
1550 const float norResX2(norResXprime * norResXprime);
1551 hitParams.
probX = TMath::Prob(norResX2, 1);
1553 hitParams.
yHit = yHit;
1554 hitParams.
yTrk = yTrk;
1564 hitParams.
resY = resYprime;
1565 hitParams.
norResY = norResYprime;
1567 const float norResY2(norResYprime * norResYprime);
1568 hitParams.
probY = TMath::Prob(norResY2, 1);
1598 if (!(dynamic_cast<const SiStripRecHit2D*>(&
recHit) || dynamic_cast<const SiStripRecHit1D*>(&
recHit))) {
1600 <<
"RecHit in Strip is 'Matched' or 'Projected', but here all should be monohits per module";
1607 if (dynamic_cast<const SiStripRecHit1D*>(&
recHit)) {
1609 clusterPtr = &(*stripHit.
cluster());
1610 }
else if (dynamic_cast<const SiStripRecHit2D*>(&
recHit)) {
1611 edm::LogWarning(
"FillHitVariables") <<
"Data has TIB/TOB hits as SiStripRecHit2D and not 1D. Probably data is " 1612 "processed with CMSSW<34X. Nevertheless everything should work fine";
1614 clusterPtr = &(*stripHit.
cluster());
1619 clusterPtr = &(*stripHit.
cluster());
1622 edm::LogError(
"FillHitVariables") <<
"Pointer to cluster not valid!!! This should never happen...";
1632 const std::pair<uint16_t, uint16_t> stripChargeLR = std::make_pair(*stripChargeL, *stripChargeR);
1643 static_cast<float>(stripChargeLR.first + stripChargeLR.second) / static_cast<float>(hitParams.
chargeStrip);
1644 hitParams.
chargeAsymmetry =
static_cast<float>(stripChargeLR.first - stripChargeLR.second) /
1645 static_cast<float>(stripChargeLR.first + stripChargeLR.second);
1655 if (!
hit.detUnit()) {
1660 if (!dynamic_cast<const StripTopology*>(&detUnit.
type().
topology())) {
1672 float dirX = -tanLorentzAnglePerTesla *
bField.y();
1673 float dirY = tanLorentzAnglePerTesla *
bField.x();
1685 if (momentumDir.z() > 0.)
1686 scaledMomentumDir *= std::fabs(
thickness / momentumDir.z());
1687 else if (momentumDir.z() < 0.)
1688 scaledMomentumDir *= -std::fabs(
thickness / momentumDir.z());
1690 scaledMomentumDir *= maxLength / momentumDir.mag();
1703 float coveredStrips = std::fabs(projEdge2 - projEdge1);
1708 edm::LogError(
"FillHitVariables") <<
"Incorrect subdetector ID, hit not associated to tracker";
1736 if (localError.
xx() < 0. || localError.
yy() < 0.) {
1756 if (!dynamic_cast<const RadialStripTopology*>(&detUnit.
type().
topology()))
1761 if (measError.
uu() < 0. || measError.
vv() < 0.) {
1776 edm::LogError(
"FillHitVariables") <<
"Incorrect subdetector ID, hit not associated to tracker";
1783 const float x(lP.
x());
1784 const float y(lP.
y());
1785 const float errX2(lE.
xx());
1786 const float errY2(lE.
yy());
1803 float errX2(-999.
F);
1804 float errY2(-999.
F);
1808 const float l_0 = r_0 - topol.
detHeight() / 2;
1810 y = measPos.
y() * stripLength - 0.5 * stripLength + l_0 * (1. /
cosPhi - 1.);
1813 const float errPhi2(measErr.
uu() * angularWidth2);
1815 errX2 = errPhi2 * r_0 * r_0;
1818 const float helpSummand = l_0 * l_0 * (sinPhi2 / cosPhi4 * errPhi2);
1819 errY2 = measErr.
vv() * stripLength * stripLength + helpSummand;
1874 edm::LogInfo(
"HitSelector") <<
"applying hit cuts ...";
1875 bool emptyMap(
true);
1877 if (!i_hitSelection.second.empty()) {
1879 double intervalBegin(999.);
1880 for (std::vector<double>::iterator i_hitInterval = i_hitSelection.second.begin();
1881 i_hitInterval != i_hitSelection.second.end();
1883 if (
entry % 2 == 1) {
1884 intervalBegin = *i_hitInterval;
1887 if (intervalBegin > *i_hitInterval) {
1888 edm::LogError(
"HitSelector") <<
"INVALID Interval selected for " << i_hitSelection.first <<
":\t" 1889 << intervalBegin <<
" > " << (*i_hitInterval) <<
"\n ... delete Selection for " 1890 << i_hitSelection.first;
1891 i_hitSelection.second.clear();
1892 i_hitInterval = i_hitSelection.second.begin();
1894 edm::LogInfo(
"HitSelector") <<
"Interval selected for " << i_hitSelection.first <<
":\t" << intervalBegin
1895 <<
", " << (*i_hitInterval);
1900 if (!i_hitSelection.second.empty())
1905 bool emptyMapUInt(
true);
1907 if (!i_hitSelection.second.empty()) {
1909 unsigned int intervalBegin(999);
1910 for (std::vector<unsigned int>::iterator i_hitInterval = i_hitSelection.second.begin();
1911 i_hitInterval != i_hitSelection.second.end();
1913 if (
entry % 2 == 1) {
1914 intervalBegin = *i_hitInterval;
1917 if (intervalBegin > *i_hitInterval) {
1918 edm::LogError(
"HitSelector") <<
"INVALID Interval selected for " << i_hitSelection.first <<
":\t" 1919 << intervalBegin <<
" > " << (*i_hitInterval) <<
"\n ... delete Selection for " 1920 << i_hitSelection.first;
1921 i_hitSelection.second.clear();
1922 i_hitInterval = i_hitSelection.second.begin();
1924 edm::LogInfo(
"HitSelector") <<
"Interval selected for " << i_hitSelection.first <<
":\t" << intervalBegin
1925 <<
", " << (*i_hitInterval);
1930 if (!i_hitSelection.second.empty())
1931 emptyMapUInt =
false;
1935 if (emptyMap && emptyMapUInt) {
1945 std::vector<double> v_cutVariable(parSet.
getParameter<std::vector<double> >(cutVariable));
1946 if (v_cutVariable.size() % 2 == 1) {
1947 edm::LogError(
"HitSelector") <<
"Invalid Hit Selection for " << cutVariable
1948 <<
": need even number of arguments (intervals)" 1949 <<
"\n ... delete Selection for " << cutVariable;
1950 v_cutVariable.clear();
1960 std::vector<unsigned int> v_cutVariable(parSet.
getParameter<std::vector<unsigned int> >(cutVariable));
1961 if (v_cutVariable.size() % 2 == 1) {
1962 edm::LogError(
"HitSelector") <<
"Invalid Hit Selection for " << cutVariable
1963 <<
": need even number of arguments (intervals)" 1964 <<
"\n ... delete Selection for " << cutVariable;
1965 v_cutVariable.clear();
1981 bool isGoodHit(
true);
1982 bool isGoodHitX(
true);
1983 bool isGoodHitY(
true);
1987 const std::vector<double>& v_hitSelection(i_hitSelection.second);
1988 if (v_hitSelection.empty())
2109 const std::vector<unsigned int>& v_hitSelection(i_hitSelection.second);
2110 if (v_hitSelection.empty())
2168 double intervalBegin(999.);
2170 for (
auto const& i_hitInterval : v_hitSelection) {
2173 intervalBegin = i_hitInterval;
2182 const unsigned int variable2)
const {
2184 unsigned int intervalBegin(999);
2186 for (
auto i_hitInterval : v_hitSelection) {
2189 intervalBegin = i_hitInterval;
2191 if (variable2 == 999 || (variable2 >= intervalBegin && variable2 <= i_hitInterval))
2201 unsigned int goodHitsPerTrack(trackStruct.
v_hitParams.size());
2268 bool moduleInSector(
false);
2269 for (
auto const& i_hitSector :
hit.v_sector) {
2270 if (i_sector.first == i_hitSector) {
2271 moduleInSector =
true;
2275 if (!moduleInSector)
2279 if (
hit.goodXMeasurement) {
2280 std::map<std::string, TrackerSectorStruct::CorrelationHists>& m_corrHists(
sector.m_correlationHistsX);
2287 m_corrHists[
"HitsGood"].fillCorrHistsX(
hit, goodHitsPerTrack);
2299 m_corrHists[
"P"].fillCorrHistsX(
hit, trackStruct.
trkParams.
p);
2300 m_corrHists[
"InvP"].fillCorrHistsX(
hit, 1. / trackStruct.
trkParams.
p);
2304 if (
hit.goodYMeasurement) {
2305 std::map<std::string, TrackerSectorStruct::CorrelationHists>& m_corrHists(
sector.m_correlationHistsY);
2312 m_corrHists[
"HitsGood"].fillCorrHistsY(
hit, goodHitsPerTrack);
2324 m_corrHists[
"P"].fillCorrHistsY(
hit, trackStruct.
trkParams.
p);
2325 m_corrHists[
"InvP"].fillCorrHistsY(
hit, 1. / trackStruct.
trkParams.
p);
2330 for (
auto& i_sigmaX :
sector.m_sigmaX) {
2331 for (
auto& iHist : i_sigmaX.second) {
2332 if (i_sigmaX.first ==
"sigmaXHit")
2333 iHist->Fill(
hit.errXHit * 10000.);
2334 else if (i_sigmaX.first ==
"sigmaXTrk")
2335 iHist->Fill(
hit.errXTrk * 10000.);
2336 else if (i_sigmaX.first ==
"sigmaX")
2337 iHist->Fill(
hit.errX * 10000.);
2340 for (
auto& i_sigmaY :
sector.m_sigmaY) {
2341 for (
auto& iHist : i_sigmaY.second) {
2342 if (i_sigmaY.first ==
"sigmaYHit")
2343 iHist->Fill(
hit.errYHit * 10000.);
2344 else if (i_sigmaY.first ==
"sigmaYTrk")
2345 iHist->Fill(
hit.errYTrk * 10000.);
2346 else if (i_sigmaY.first ==
"sigmaY")
2347 iHist->Fill(
hit.errY * 10000.);
2356 std::map<std::string, TrackerSectorStruct::CorrelationHists>& m_corrHists(
sector.m_correlationHistsX);
2359 m_corrHists[
"WidthX"].fillCorrHistsX(
hit,
hit.widthX);
2360 m_corrHists[
"BaryStripX"].fillCorrHistsX(
hit,
hit.baryStripX);
2362 if (
hit.isPixelHit) {
2363 m_corrHists[
"ChargePixel"].fillCorrHistsX(
hit,
hit.chargePixel);
2364 m_corrHists[
"ClusterProbXY"].fillCorrHistsX(
hit,
hit.clusterProbabilityXY);
2365 m_corrHists[
"ClusterProbQ"].fillCorrHistsX(
hit,
hit.clusterProbabilityQ);
2366 m_corrHists[
"ClusterProbXYQ"].fillCorrHistsX(
hit,
hit.clusterProbabilityXYQ);
2367 m_corrHists[
"LogClusterProb"].fillCorrHistsX(
hit,
hit.logClusterProbability);
2368 m_corrHists[
"IsOnEdge"].fillCorrHistsX(
hit,
hit.isOnEdge);
2369 m_corrHists[
"HasBadPixels"].fillCorrHistsX(
hit,
hit.hasBadPixels);
2370 m_corrHists[
"SpansTwoRoc"].fillCorrHistsX(
hit,
hit.spansTwoRoc);
2371 m_corrHists[
"QBin"].fillCorrHistsX(
hit,
hit.qBin);
2374 m_corrHists[
"ChargeStrip"].fillCorrHistsX(
hit,
hit.chargeStrip);
2375 m_corrHists[
"MaxStrip"].fillCorrHistsX(
hit,
hit.maxStrip);
2376 m_corrHists[
"MaxCharge"].fillCorrHistsX(
hit,
hit.maxCharge);
2377 m_corrHists[
"MaxIndex"].fillCorrHistsX(
hit,
hit.maxIndex);
2378 m_corrHists[
"ChargeOnEdges"].fillCorrHistsX(
hit,
hit.chargeOnEdges);
2379 m_corrHists[
"ChargeAsymmetry"].fillCorrHistsX(
hit,
hit.chargeAsymmetry);
2380 m_corrHists[
"ChargeLRplus"].fillCorrHistsX(
hit,
hit.chargeLRplus);
2381 m_corrHists[
"ChargeLRminus"].fillCorrHistsX(
hit,
hit.chargeLRminus);
2382 m_corrHists[
"SOverN"].fillCorrHistsX(
hit,
hit.sOverN);
2383 m_corrHists[
"WidthProj"].fillCorrHistsX(
hit,
hit.projWidth);
2384 m_corrHists[
"WidthDiff"].fillCorrHistsX(
hit,
hit.projWidth - static_cast<float>(
hit.widthX));
2386 sector.WidthVsWidthProjected->Fill(
hit.projWidth,
hit.widthX);
2387 sector.PWidthVsWidthProjected->Fill(
hit.projWidth,
hit.widthX);
2389 sector.WidthDiffVsMaxStrip->Fill(
hit.maxStrip,
hit.projWidth - static_cast<float>(
hit.widthX));
2390 sector.PWidthDiffVsMaxStrip->Fill(
hit.maxStrip,
hit.projWidth - static_cast<float>(
hit.widthX));
2392 sector.WidthDiffVsSigmaXHit->Fill(
hit.errXHit,
hit.projWidth - static_cast<float>(
hit.widthX));
2393 sector.PWidthDiffVsSigmaXHit->Fill(
hit.errXHit,
hit.projWidth - static_cast<float>(
hit.widthX));
2400 m_corrHists[
"SigmaXHit"].fillCorrHistsX(
hit,
hit.errXHit * 10000.);
2401 m_corrHists[
"SigmaXTrk"].fillCorrHistsX(
hit,
hit.errXTrk * 10000.);
2402 m_corrHists[
"SigmaX"].fillCorrHistsX(
hit,
hit.errX * 10000.);
2404 m_corrHists[
"PhiSens"].fillCorrHistsX(
hit,
hit.phiSens * 180. /
M_PI);
2405 m_corrHists[
"PhiSensX"].fillCorrHistsX(
hit,
hit.phiSensX * 180. /
M_PI);
2406 m_corrHists[
"PhiSensY"].fillCorrHistsX(
hit,
hit.phiSensY * 180. /
M_PI);
2410 sector.SigmaX2->Fill(
hit.errX2 * 10000. * 10000.);
2417 sector.PhiSensXVsBarycentreX->Fill(
hit.baryStripX,
hit.phiSensX * 180. /
M_PI);
2418 sector.PPhiSensXVsBarycentreX->Fill(
hit.baryStripX,
hit.phiSensX * 180. /
M_PI);
2423 std::map<std::string, TrackerSectorStruct::CorrelationHists>& m_corrHists(
sector.m_correlationHistsY);
2425 if (!
hit.isPixelHit)
2429 m_corrHists[
"WidthY"].fillCorrHistsY(
hit,
hit.widthY);
2430 m_corrHists[
"BaryStripY"].fillCorrHistsY(
hit,
hit.baryStripY);
2432 m_corrHists[
"ChargePixel"].fillCorrHistsY(
hit,
hit.chargePixel);
2433 m_corrHists[
"ClusterProbXY"].fillCorrHistsY(
hit,
hit.clusterProbabilityXY);
2434 m_corrHists[
"ClusterProbQ"].fillCorrHistsY(
hit,
hit.clusterProbabilityQ);
2435 m_corrHists[
"ClusterProbXYQ"].fillCorrHistsY(
hit,
hit.clusterProbabilityXYQ);
2436 m_corrHists[
"LogClusterProb"].fillCorrHistsY(
hit,
hit.logClusterProbability);
2437 m_corrHists[
"IsOnEdge"].fillCorrHistsY(
hit,
hit.isOnEdge);
2438 m_corrHists[
"HasBadPixels"].fillCorrHistsY(
hit,
hit.hasBadPixels);
2439 m_corrHists[
"SpansTwoRoc"].fillCorrHistsY(
hit,
hit.spansTwoRoc);
2440 m_corrHists[
"QBin"].fillCorrHistsY(
hit,
hit.qBin);
2443 m_corrHists[
"SigmaYHit"].fillCorrHistsY(
hit,
hit.errYHit * 10000.);
2444 m_corrHists[
"SigmaYTrk"].fillCorrHistsY(
hit,
hit.errYTrk * 10000.);
2445 m_corrHists[
"SigmaY"].fillCorrHistsY(
hit,
hit.errY * 10000.);
2447 m_corrHists[
"PhiSens"].fillCorrHistsY(
hit,
hit.phiSens * 180. /
M_PI);
2448 m_corrHists[
"PhiSensX"].fillCorrHistsY(
hit,
hit.phiSensX * 180. /
M_PI);
2449 m_corrHists[
"PhiSensY"].fillCorrHistsY(
hit,
hit.phiSensY * 180. /
M_PI);
2453 sector.SigmaY2->Fill(
hit.errY2 * 10000. * 10000.);
2460 sector.PhiSensYVsBarycentreY->Fill(
hit.baryStripY,
hit.phiSensY * 180. /
M_PI);
2461 sector.PPhiSensYVsBarycentreY->Fill(
hit.baryStripY,
hit.phiSensY * 180. /
M_PI);
2465 unsigned int goodHitsPerTrack(trackStruct.
v_hitParams.size());
2473 for (
auto const& i_hit : trackStruct.
v_hitParams) {
2479 bool moduleInSector(
false);
2480 for (
auto const& i_hitSector : i_hit.v_sector) {
2481 if (i_sector.first == i_hitSector) {
2482 moduleInSector =
true;
2486 if (!moduleInSector)
2492 if (i_hit.goodXMeasurement) {
2497 if (i_hit.errXWoApe < i_errBins.second.first || i_hit.errXWoApe >= i_errBins.second.second) {
2500 i_sector.second.m_binnedHists[i_errBins.first][
"sigmaX"]->Fill(i_hit.errXWoApe);
2501 i_sector.second.m_binnedHists[i_errBins.first][
"norResX"]->Fill(i_hit.norResX);
2504 i_sector.second.ResX->Fill(i_hit.resX * 10000.);
2505 i_sector.second.NorResX->Fill(i_hit.norResX);
2508 if (i_hit.goodYMeasurement) {
2513 if (i_hit.errYWoApe < i_errBins.second.first || i_hit.errYWoApe >= i_errBins.second.second) {
2516 i_sector.second.m_binnedHists[i_errBins.first][
"sigmaY"]->Fill(i_hit.errYWoApe);
2517 i_sector.second.m_binnedHists[i_errBins.first][
"norResY"]->Fill(i_hit.norResY);
2520 i_sector.second.ResY->Fill(i_hit.resY * 10000.);
2521 i_sector.second.NorResY->Fill(i_hit.norResY);
2533 for (
auto const& i_errBins : i_sector.second.m_binnedHists) {
2534 std::map<std::string, TH1*> m_Hists = i_errBins.second;
2537 double integralX = m_Hists[
"norResX"]->Integral();
2538 i_sector.second.EntriesX->SetBinContent(i_errBins.first, integralX);
2540 if (i_sector.second.isPixel) {
2541 double integralY = m_Hists[
"norResY"]->Integral();
2542 i_sector.second.EntriesY->SetBinContent(i_errBins.first, integralY);
2568 else if (dynamic_cast<const SiStripMatchedRecHit2D*>(&
hit))
2570 else if (dynamic_cast<const ProjectedSiStripRecHit2D*>(&
hit)) {
2574 edm::LogError(
"UnknownType") <<
"@SUB=ApeEstimator::isHit2D" 2575 <<
"Tracker hit not in pixel, neither SiStripRecHit[12]D nor " 2576 <<
"SiStripMatchedRecHit2D nor ProjectedSiStripRecHit2D.";
2582 <<
"Hit not in tracker with 'official' dimension >=2.";
2597 if (beamSpotHandle.
isValid()) {
2600 edm::LogError(
"ApeEstimator") <<
"No beam spot available from EventSetup" 2601 <<
"\n...skip event";
2618 typedef std::vector<ConstTrajTrackPair> ConstTrajTrackPairCollection;
2619 ConstTrajTrackPairCollection trajTracks;
2622 for (i_trajTrack = m_TrajTracksMap->
begin(); i_trajTrack != m_TrajTracksMap->
end(); ++i_trajTrack) {
2623 trajTracks.push_back(
ConstTrajTrackPair(&(*(*i_trajTrack).key), &(*(*i_trajTrack).val)));
2627 unsigned int trackSizeGood(0);
2628 ConstTrajTrackPairCollection::const_iterator iTrack;
2629 for (iTrack = trajTracks.begin(); iTrack != trajTracks.end(); ++iTrack) {
2639 const std::vector<TrajectoryMeasurement> v_meas = (*traj).measurements();
2642 for (std::vector<TrajectoryMeasurement>::const_iterator i_meas = v_meas.begin(); i_meas != v_meas.end(); ++i_meas) {
ClusterRef cluster() const
bool inDoubleInterval(const std::vector< double > &, const float) const
static constexpr auto TEC
std::vector< unsigned int > v_sector
const edm::ParameterSet parameterSet_
TProfile * PHitsPixelVsTheta
T getParameter(std::string const &) const
float logClusterProbability
void setCluster(const SiStripCluster &cluster, int detId)
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
void bookSectorHistsForAnalyzerMode()
const LocalTrajectoryError & localError() const
float clusterProbabilityXYQ
LocalPoint localPosition() const
TProfile * PHitsStripVsEta
friend struct const_iterator
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
ApeEstimator(const edm::ParameterSet &)
TrajectoryStateOnSurface const & forwardPredictedState() const
Access to forward predicted state (from fitter or builder)
Sin< T >::type sin(const T &t)
TProfile * PMeanAngleVsHits
SiStripClusterInfo siStripClusterInfo_
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magFieldToken_
ALPAKA_FN_ACC int side(int ieta, int iphi)
bool hasBadPixels() const
PositionAndError2 radialPositionAndError2(const LocalPoint &, const LocalError &, const RadialStripTopology &)
void fillHitHistsYForAnalyzerMode(const TrackStruct::HitParameterStruct &, TrackerSectorStruct &)
Log< level::Error, false > LogError
LocalError positionError() const
virtual const GeomDetType & type() const
virtual float detHeight() const =0
PositionAndError2 rectangularPositionAndError2(const LocalPoint &, const LocalError &)
TrackerDetectorStruct tkDetector_
const unsigned int maxTracksPerEvent_
ClusterRef cluster() const
TrackStruct::HitParameterStruct fillHitVariables(const TrajectoryMeasurement &, const edm::EventSetup &)
bool checkIntervalsForSectors(const unsigned int sectorCounter, const std::vector< double > &) const
auto stripCharges() const -> decltype(cluster() ->amplitudes())
nStrips
1.2 is to make the matching window safely the two nearest strips 0.35 is the size of an ME0 chamber i...
void residualErrorBinning()
DataContainer const & measurements() const
const_iterator end() const
last iterator over the map (read only)
const edm::ESGetToken< SiStripLorentzAngle, SiStripLorentzAngleDepRcd > lorentzAngleToken_
float signalOverNoise() const
MeasurementPoint measurementPosition(const LocalPoint &) const override=0
size_type size() const
map size
T * make(const Args &...args) const
make new ROOT object
std::vector< HitParameterStruct > v_hitParams
float clusterProbabilityXY
TrackStruct::TrackParameterStruct fillTrackVariables(const reco::Track &, const Trajectory &, const reco::BeamSpot &)
TProfile * PHitsStripVsTheta
TrackParameterStruct trkParams
Cos< T >::type cos(const T &t)
LocalVector localDirection() const
edm::EDGetTokenT< reco::BeamSpot > offlinebeamSpot_
bool checkModulePositions(const float, const std::vector< double > &) const
uint8_t maxCharge() const
Abs< T >::type abs(const T &t)
TrajectoryStateOnSurface const & backwardPredictedState() const
Access to backward predicted state (from smoother)
TProfile * PHitsGoodVsHitsValid
#define DEFINE_FWK_MODULE(type)
virtual float angularWidth() const =0
virtual MeasurementPoint measurementPosition(const LocalPoint &) const =0
void analyze(const edm::Event &, const edm::EventSetup &) override
float stripAngle(float strip) const override=0
TH2 * HitsGoodVsHitsValid
static constexpr auto TOB
float clusterProbability(unsigned int flags=0) const
std::map< unsigned int, TrackerSectorStruct > m_tkSector_
uint16_t maxStrip() const
DetId geographicalId() const
The label of this GeomDet.
std::map< unsigned int, std::pair< double, double > > m_resErrBins_
float localStripLength(const LocalPoint &) const override=0
LocalVector toLocal(const reco::Track::Vector &v, const Surface &s)
bool inUintInterval(const std::vector< unsigned int > &, const unsigned int, const unsigned int=999) const
bool checkModuleBools(const bool, const std::vector< unsigned int > &) const
bool IsModuleUsable() const
Log< level::Info, false > LogInfo
Detector identifier class for the strip tracker.
uint16_t maxIndex() const
float getLorentzAngle(const uint32_t &) const
static constexpr auto TIB
const Plane & surface() const
The nominal surface of the GeomDet.
TFileDirectory mkdir(const std::string &dir, const std::string &descr="")
create a new subdirectory
const PositionType & position() const
std::pair< uint16_t, uint16_t > chargeLR() const
TFileDirectory mkdir(const std::string &dir, const std::string &descr="")
create a new subdirectory
constexpr uint32_t rawId() const
get the raw id
XYZPointD XYZPoint
point in space with cartesian internal representation
float clusterProbabilityQ
virtual float originToIntersection() const =0
bool isSelected(const std::vector< L1HPSPFTauQualityCut > &qualityCuts, const l1t::PFCandidate &pfCand, float_t primaryVertexZ)
virtual const Topology & topology() const =0
std::map< unsigned int, ReducedTrackerTreeVariables > m_tkTreeVar_
LocalError const & localAlignmentError() const
Return local alligment error.
bool isHit2D(const TrackingRecHit &) const
bool spansTwoROCs() const
const_iterator begin() const
first iterator over the map (read only)
Pixel cluster – collection of neighboring pixels above threshold.
bool checkModuleIds(const unsigned int, const std::vector< unsigned int > &) const
bool hitSelected(TrackStruct::HitParameterStruct &) const
void fillHistsForApeCalculation(const TrackStruct &)
SiStripRecHit2D originalHit() const
bool checkModuleDirections(const int, const std::vector< int > &) const
bool isPixel(HitType hitType)
const unsigned int minGoodHitsPerTrack_
MeasurementError measurementError(const LocalPoint &, const LocalError &) const override=0
void statistics(const TrackerSectorStruct &, const int) const
void setHitSelectionMap(const std::string &)
edm::EDGetTokenT< TrajTrackAssociationCollection > tjTagToken_
void fillHitHistsXForAnalyzerMode(const TrackStruct::HitParameterStruct &, TrackerSectorStruct &)
std::pair< const Trajectory *, const reco::Track * > ConstTrajTrackPair
void fillHistsForAnalyzerMode(const TrackStruct &)
void bookSectorHistsForApeCalculation()
Log< level::Warning, false > LogWarning
std::map< std::string, std::vector< double > > m_hitSelection_
void initEvent(const edm::EventSetup &iSetup)
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
const Plane & specificSurface() const
Same as surface(), kept for backward compatibility.
TProfile * PHitsPixelVsEta
std::map< std::string, std::vector< unsigned int > > m_hitSelectionUInt_
std::pair< TrackStruct::HitState, PositionAndError2 > StatePositionAndError2
void setHitSelectionMapUInt(const std::string &)
ClusterRef cluster() const
static constexpr auto TID
Power< A, B >::type pow(const A &a, const B &b)
std::vector< unsigned int > v_rawId
ConstRecHitPointer const & recHit() const
StatePositionAndError2 positionAndError2(const LocalPoint &, const LocalError &, const TransientTrackingRecHit &)
const Bounds & bounds() const