64 ATH_MSG_DEBUG(
"Filling Histograms for " << name() <<
" ... " );
70 using ConstTrackProxy = ActsTrk::TrackContainer::ConstTrackProxy;
73 std::vector<ConstTrackProxy> proxies;
74 for (
auto proxy: *tracks ) {
75 proxies.push_back(proxy);
78 std::vector<int> nSharedPerTrack {};
79 nSharedPerTrack.reserve(tracks->size());
81 std::vector<int> nSharedPixelBarrelLayer;
82 std::vector<int> nSharedPixelEndCapLayer;
83 std::vector<int> nSharedStripBarrelLayer;
84 std::vector<int> nSharedStripEndCapLayer;
85 nSharedPixelBarrelLayer.reserve(5*tracks->size());
86 nSharedPixelEndCapLayer.reserve(5*tracks->size());
87 nSharedStripBarrelLayer.reserve(5*tracks->size());
88 nSharedStripEndCapLayer.reserve(5*tracks->size());
90 for (
const auto track_proxy : proxies) {
92 track_proxy.container().trackStateContainer()
93 .visitBackwards(track_proxy.tipIndex(),
96 &nSharedPixelBarrelLayer, &nSharedPixelEndCapLayer,
97 &nSharedStripBarrelLayer, &nSharedStripEndCapLayer]
100 auto flags = state.typeFlags();
101 if (not flags.test(Acts::TrackStateFlag::SharedHitFlag)) return;
104 auto sl = state.getUncalibratedSourceLink().template get<ATLASUncalibSourceLink>();
105 assert( sl != nullptr);
106 const xAOD::UncalibratedMeasurement &cluster = getUncalibratedMeasurement(sl);
107 xAOD::DetectorIDHashType idHash = cluster.identifierHash();
109 xAOD::UncalibMeasType clusterType = cluster.type();
110 if (clusterType == xAOD::UncalibMeasType::PixelClusterType) {
111 const Identifier& id = m_pixelID->wafer_id(idHash);
112 auto barrel_or_endcap = m_pixelID->barrel_ec(id);
113 auto layer = m_pixelID->layer_disk(id);
114 if (barrel_or_endcap == 0) {
115 nSharedPixelBarrelLayer.push_back(layer);
117 nSharedPixelEndCapLayer.push_back(layer);
121 auto barrel_or_endcap =
m_stripID->barrel_ec(
id);
123 if (barrel_or_endcap == 0) {
124 nSharedStripBarrelLayer.push_back(layer);
126 nSharedStripEndCapLayer.push_back(layer);
131 nSharedPerTrack.push_back(nShared);
135 auto monitor_nsharedperlayer_pixelbarrel =
Monitored::Collection(
"NsharedPerLayer_pixelBarrel", nSharedPixelBarrelLayer);
136 auto monitor_nsharedperlayer_pixelendcap =
Monitored::Collection(
"NsharedPerLayer_pixelEndCap", nSharedPixelEndCapLayer);
137 auto monitor_nsharedperlayer_stripbarrel =
Monitored::Collection(
"NsharedPerLayer_stripBarrel", nSharedStripBarrelLayer);
138 auto monitor_nsharedperlayer_stripendcap =
Monitored::Collection(
"NsharedPerLayer_stripEndCap", nSharedStripEndCapLayer);
141 auto monitor_theta =
Monitored::Collection(
"theta", proxies, [](
const ConstTrackProxy& tp){
return static_cast<double>(tp.theta()); } );
143 [](
const ConstTrackProxy& tp)
144 {
return static_cast<double>( -std::log(std::tan(tp.theta() * 0.5)) ); } );
145 auto monitor_qoverp =
Monitored::Collection(
"qoverp", proxies, [](
const ConstTrackProxy& tp){
return static_cast<double>(
tp.qOverP()); } );
146 auto monitor_pt =
Monitored::Collection(
"pt", proxies, [](
const ConstTrackProxy& tp){
return tp.transverseMomentum(); } );
147 auto monitor_phi =
Monitored::Collection(
"phi", proxies, [](
const ConstTrackProxy& tp){
return static_cast<double>(
tp.phi()); } );
148 auto monitor_chi2 =
Monitored::Collection(
"chi2", proxies, [](
const ConstTrackProxy& tp){
return static_cast<double>(
tp.chi2()); } );
149 auto monitor_chi2OverNdof =
Monitored::Collection(
"chi2OverNdof", proxies, [](
const ConstTrackProxy& tp){
return static_cast<double>(
tp.chi2()/
tp.nDoF()); } );
150 auto monitor_ndof =
Monitored::Collection(
"ndof", proxies, [](
const ConstTrackProxy& tp){
return static_cast<double>(
tp.nDoF()); } );
151 auto monitor_nstates =
Monitored::Collection(
"nStates", proxies, [](
const ConstTrackProxy& tp){
return static_cast<double>(
tp.nTrackStates()); } );
153 auto monitor_nPixelHits =
Monitored::Collection(
"nPixelHits", proxies, [&tracks](
const ConstTrackProxy& tp){
155 auto monitor_nStripHits =
Monitored::Collection(
"nStripHits", proxies, [&tracks](
const ConstTrackProxy& tp){
157 auto monitor_nmeas =
Monitored::Collection(
"nMeasurements", proxies, [](
const ConstTrackProxy& tp){
return static_cast<double>(
tp.nMeasurements()); } );
158 auto monitor_noutliers =
Monitored::Collection(
"nOutliers", proxies, [](
const ConstTrackProxy& tp){
return static_cast<double>(
tp.nOutliers()); } );
159 auto monitor_nholes =
Monitored::Collection(
"nHoles", proxies, [](
const ConstTrackProxy& tp){
return static_cast<double>(
tp.nHoles()); } );
160 auto monitor_surftype =
Monitored::Collection(
"surfaceType", proxies, [](
const ConstTrackProxy& tp){
return static_cast<double>(
tp.referenceSurface().
type()); } );
163 fill(m_monGroupName.value(),
164 monitor_nsharedpertrack,
165 monitor_nsharedperlayer_pixelbarrel, monitor_nsharedperlayer_pixelendcap,
166 monitor_nsharedperlayer_stripbarrel, monitor_nsharedperlayer_stripendcap,
167 monitor_ntracks, monitor_theta, monitor_eta, monitor_phi, monitor_pt,
168 monitor_qoverp, monitor_nstates, monitor_phi, monitor_chi2, monitor_chi2OverNdof,
169 monitor_ndof, monitor_nstates, monitor_nmeas, monitor_noutliers, monitor_nholes, monitor_surftype,
170 monitor_nPixelHits, monitor_nStripHits);
172 return StatusCode::SUCCESS;