24 m_holeSearchTool(
"InDet::InDetTrackHoleSearchTool/InDetHoleSearchTool", this),
25 m_trackSelTool(
"InDet::InDetTrackSelectionTool/TrackSelectionTool", this),
51 return StatusCode::SUCCESS;
77 bool copyFEval(
false);
90 if (pixlayer == 99)
continue;
112 clusPerEventArray.
DA[phiMod][
etaMod] = -1;
116 clusPerEventArray.
DC[phiMod][
etaMod] = -1;
120 clusPerEventArray.
B0[phiMod][
etaMod] = -1;
124 clusPerEventArray.
B1[phiMod][
etaMod] = -1;
128 clusPerEventArray.
B2[phiMod][
etaMod] = -1;
132 clusPerEventArray.
IBL[phiMod][
etaMod] = -1;
133 if (copyFEval) clusPerEventArray.
IBL[phiMod][++
etaMod] = -1;
138 Map_Of_Modules_Status.
add(pixlayer, waferID,
index);
144 for (
int iFE = 0; iFE < nFE; iFE++) {
146 if (not pixelID.is_valid())
continue;
153 if (is_good)
index = 0;
157 Map_Of_FEs_Status.
add(pixlayer, waferID, iFE,
index);
166 for (
unsigned int ii = 0; ii <
PixLayers::COUNT; ii++) nBadAndDisabledMod[ii] = nBadMod[ii]+nDisabledMod[ii];
197 if (!(tracks.isValid())) {
201 return StatusCode::RECOVERABLE;
203 ATH_MSG_DEBUG(
"PixelMonitoring: Track container " << tracks.name() <<
" is found.");
206 int ntracksPerEvent = 0;
207 bool havePixelHits(
false);
208 std::vector<std::pair<Identifier, double> > ClusterIDs;
212 for (
auto track: *tracks) {
213 if (
track ==
nullptr ||
track->perigeeParameters() ==
nullptr ||
track->trackSummary() ==
nullptr ||
215 ATH_MSG_DEBUG(
"PixelMonitoring: Track either invalid or it does not contain pixel hits, continuing...");
222 bool pass1hole1GeVptTightCut = (passJOTrkTightCut && (measPerigee->pT() / 1000.0 > 1.0));
223 bool pass1hole5GeVptTightCut = (passJOTrkTightCut && (measPerigee->pT() / 1000.0 > 5.0));
225 if(measPerigee->pT()<1000.)
continue;
228 std::unique_ptr<const Trk::Track> trackWithHolesUnique =
nullptr;
231 trackWithHoles = trackWithHolesUnique.get();
234 for (
auto trackStateOnSurface: *trackStates) {
242 if (mesBase && !RIOOnTrack)
continue;
254 ATH_MSG_INFO(
"PixelMonitoring: pointer of TSOS to track parameters or associated surface is null");
260 if (pixlayer == 99)
continue;
274 if ( mesBase && siclus) {
276 if ( !(locPosID.is_valid()) ) {
277 ATH_MSG_INFO(
"Pixel Monitoring: got invalid track local position on surface for an outlier.");
280 TSOS_Outlier.
add(pixlayer, locPosID, 1.0);
282 TSOS_Outlier_FE.
add(pixlayer, locPosID,
m_pixelReadout->getFE(locPosID, locPosID), 1.0);
290 if ( !(locPosID.is_valid()) ) {
291 ATH_MSG_INFO(
"Pixel Monitoring: got invalid track local position on surface for a hole.");
294 TSOS_Hole.
add(pixlayer, locPosID, 1.0);
296 TSOS_Hole_FE.
add(pixlayer, locPosID,
m_pixelReadout->getFE(locPosID, locPosID), 1.0);
301 if (not mesBase)
continue;
305 if (!
side || !clus)
continue;
312 if ( !(locPosID.is_valid()) ) {
313 ATH_MSG_INFO(
"Pixel Monitoring: got invalid cluster on track ID.");
316 TSOS_Measurement.
add(pixlayer, locPosID, 1.0);
318 TSOS_Measurement_FE.
add(pixlayer, locPosID,
m_pixelReadout->getFE(locPosID, locPosID), 1.0);
324 const Amg::Vector2D localpos = trackAtPlane->localPosition();
327 const AmgSymMatrix(5) trackErrMat = (*trackAtPlane->covariance());
334 if (error_sum != 0) {
342 if (error_sum != 0) {
351 double trknormcomp = mytrack.dot(mynormal);
353 double mytrack_mag = mytrack.mag();
354 double cosalpha = 0.;
355 if (mytrack_mag != 0) cosalpha = std::abs(trknormcomp / mytrack_mag);
356 ClusterIDs.emplace_back(clus->
identify(), cosalpha);
361 if (pass1hole5GeVptTightCut) {
368 if (pass1hole1GeVptTightCut && locPosID.is_valid()) {
369 HolesRatio.
add(pixlayer, locPosID, nHole);
370 MissHitsRatio.
add(pixlayer, locPosID, nOutlier + nHole);
378 int nIBLHits=0, nBLHits=0;
384 if(expectIBLHit && nIBLHits==0 && pass1hole1GeVptTightCut){
385 std::vector<InDet::TrackStateOnPixelLayerInfo> trackStateIBLlayer;
386 if(
m_testPixelLayerTool->getTrackStateOnInnermostPixelLayerInfo(measPerigee, trackStateIBLlayer)){
388 for (
auto &tstate : trackStateIBLlayer){
390 if(posid==posid_prev)
continue;
398 }
else if(expectIBLHit && pass1hole1GeVptTightCut)
fill(
trackGroup,etanoibl,phinoibl,missibl);
405 int trkfitndf =
track->fitQuality()->numberDoF();
406 double trkfitchi2 =
track->fitQuality()->chiSquared();
407 if (trkfitndf != 0) {
411 havePixelHits = havePixelHits || (
nPixelHits > 0);
414 if (!havePixelHits) {
432 sort(ClusterIDs.begin(), ClusterIDs.end(),
433 [](
const std::pair<Identifier, double>& left,
const std::pair<Identifier, double>& right) {
434 return left.first < right.first;
468 auto clusterGroup_OnTrack =
getGroup(
"Cluster_OnTrack");
472 if (!(pixel_clcontainer.isValid())) {
476 return StatusCode::RECOVERABLE;
478 ATH_MSG_DEBUG(
"Pixel Monitoring: Pixel Cluster container " << pixel_clcontainer.name() <<
" is found.");
482 int nclusters_ontrack = 0;
491 for (
auto colNext: *pixel_clcontainer) {
493 if (!ClusterCollection) {
494 ATH_MSG_DEBUG(
"Pixel Monitoring: Pixel Cluster container is empty.");
500 for (
auto p_clus: *ClusterCollection) {
501 clusID = p_clus->identify();
503 if (pixlayer == 99)
continue;
513 Cluster_LVL1A_Mod.
add(pixlayer, clusID, cluster.
LVL1A() + 0.00001);
514 if (cluster.
rdoList().size() > 1) Cluster_LVL1A_SizeCut.
add(pixlayer, clusID, cluster.
LVL1A() + 0.00001);
518 nclusters_mod[iblsublayer]++;
521 nclusters_mod[pixlayer]++;
532 Cluster_Occupancy.
add(pixlayer, clusID);
534 Cluster_FE_Occupancy.
add(pixlayer, clusID,
m_pixelReadout->getFE(clusID, clusID), 1.0);
536 if (cluster.
rdoList().size() > 1) Clus_Occ_SizeCut.
add(pixlayer, clusID);
544 clusPerEventArray.
DA[phiMod][
etaMod]++;
548 clusPerEventArray.
DC[phiMod][
etaMod]++;
552 clusPerEventArray.
B0[phiMod][
etaMod]++;
556 clusPerEventArray.
B1[phiMod][
etaMod]++;
560 clusPerEventArray.
B2[phiMod][
etaMod]++;
569 clLVL1A = cluster.
LVL1A();
570 fill(clusterGroup_OnTrack, clLVL1A);
571 Cluster_LVL1A_Mod_OnTrack.
add(pixlayer, clusID, cluster.
LVL1A() + 0.00001);
572 if (cluster.
rdoList().size() > 1) Cluster_LVL1A_SizeCut_OnTrack.
add(pixlayer, clusID,
573 cluster.
LVL1A() + 0.00001);
583 Cluster_Size_Map_OnTrack.
add(pixlayer, clusID, cluster.
rdoList().size());
588 if (
m_doOnline) ClusterMap_Mon_OnTrack.
add(pixlayer, clusID);
593 Cluster_Occupancy_OnTrack.
add(pixlayer, clusID);
595 Cluster_FE_Occupancy_OnTrack.
add(pixlayer, clusID,
m_pixelReadout->getFE(clusID, clusID), 1.0);
597 if (cluster.
rdoList().size() > 1) Clus_Occ_SizeCut_OnTrack.
add(pixlayer, clusID);
615 nclusters_ontrack_mod[pixlayer]++;
643 fill(clusterGroup_OnTrack, lbval, nClsOnTrk);
652 fill(clusterGroup_OnTrack, lbval, clsFracOnTrack);
663 if (ntracksPerEvent > 0) {
664 for (
unsigned int ii = 0; ii <
PixLayers::COUNT; ii++) nclusters_ontrack_mod[ii] /= ntracksPerEvent;
675 return StatusCode::SUCCESS;