![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
22 m_holeSearchTool(
"InDet::InDetTrackHoleSearchTool/InDetHoleSearchTool", this),
23 m_trackSelTool(
"InDet::InDetTrackSelectionTool/TrackSelectionTool", this),
48 return StatusCode::SUCCESS;
74 bool copyFEval(
false);
83 Identifier waferID = *idIt;
87 if (pixlayer == 99)
continue;
109 clusPerEventArray.
DA[phiMod][
etaMod] = -1;
113 clusPerEventArray.
DC[phiMod][
etaMod] = -1;
117 clusPerEventArray.
B0[phiMod][
etaMod] = -1;
121 clusPerEventArray.
B1[phiMod][
etaMod] = -1;
125 clusPerEventArray.
B2[phiMod][
etaMod] = -1;
129 clusPerEventArray.
IBL[phiMod][
etaMod] = -1;
130 if (copyFEval) clusPerEventArray.
IBL[phiMod][++
etaMod] = -1;
135 Map_Of_Modules_Status.
add(pixlayer, waferID,
index);
141 for (
int iFE = 0; iFE < nFE; iFE++) {
142 Identifier pixelID =
m_pixelReadout->getPixelIdfromHash(id_hash, iFE, 1, 1);
143 if (not pixelID.is_valid())
continue;
150 if (is_good)
index = 0;
154 Map_Of_FEs_Status.
add(pixlayer, waferID, iFE,
index);
163 for (
unsigned int ii = 0; ii <
PixLayers::COUNT; ii++) nBadAndDisabledMod[ii] = nBadMod[ii]+nDisabledMod[ii];
192 if (!(tracks.isValid())) {
196 return StatusCode::RECOVERABLE;
198 ATH_MSG_DEBUG(
"PixelMonitoring: Track container " << tracks.name() <<
" is found.");
201 int ntracksPerEvent = 0;
202 bool havePixelHits(
false);
203 std::vector<std::pair<Identifier, double> > ClusterIDs;
207 for (
auto track: *tracks) {
208 if (
track ==
nullptr ||
track->perigeeParameters() ==
nullptr ||
track->trackSummary() ==
nullptr ||
210 ATH_MSG_DEBUG(
"PixelMonitoring: Track either invalid or it does not contain pixel hits, continuing...");
217 bool pass1hole1GeVptTightCut = (passJOTrkTightCut && (measPerigee->pT() / 1000.0 > 1.0));
218 bool pass1hole5GeVptTightCut = (passJOTrkTightCut && (measPerigee->pT() / 1000.0 > 5.0));
221 std::unique_ptr<const Trk::Track> trackWithHolesUnique =
nullptr;
224 trackWithHoles = trackWithHolesUnique.get();
227 for (
auto trackStateOnSurface: *trackStates) {
235 if (mesBase && !RIOOnTrack)
continue;
240 Identifier surfaceID;
247 ATH_MSG_INFO(
"PixelMonitoring: pointer of TSOS to track parameters or associated surface is null");
253 if (pixlayer == 99)
continue;
267 if ( mesBase && siclus) {
269 if ( !(locPosID.is_valid()) ) {
270 ATH_MSG_INFO(
"Pixel Monitoring: got invalid track local position on surface for an outlier.");
273 TSOS_Outlier.
add(pixlayer, locPosID, 1.0);
275 TSOS_Outlier_FE.
add(pixlayer, locPosID,
m_pixelReadout->getFE(locPosID, locPosID), 1.0);
283 if ( !(locPosID.is_valid()) ) {
284 ATH_MSG_INFO(
"Pixel Monitoring: got invalid track local position on surface for a hole.");
287 TSOS_Hole.
add(pixlayer, locPosID, 1.0);
289 TSOS_Hole_FE.
add(pixlayer, locPosID,
m_pixelReadout->getFE(locPosID, locPosID), 1.0);
294 if (not mesBase)
continue;
298 if (!
side || !clus)
continue;
305 if ( !(locPosID.is_valid()) ) {
306 ATH_MSG_INFO(
"Pixel Monitoring: got invalid cluster on track ID.");
309 TSOS_Measurement.
add(pixlayer, locPosID, 1.0);
311 TSOS_Measurement_FE.
add(pixlayer, locPosID,
m_pixelReadout->getFE(locPosID, locPosID), 1.0);
317 const Amg::Vector2D localpos = trackAtPlane->localPosition();
320 const AmgSymMatrix(5) trackErrMat = (*trackAtPlane->covariance());
327 if (error_sum != 0) {
335 if (error_sum != 0) {
344 double trknormcomp = mytrack.dot(mynormal);
346 double mytrack_mag = mytrack.mag();
347 double cosalpha = 0.;
348 if (mytrack_mag != 0) cosalpha = std::abs(trknormcomp / mytrack_mag);
349 ClusterIDs.emplace_back(clus->
identify(), cosalpha);
354 if (pass1hole5GeVptTightCut) {
361 if (pass1hole1GeVptTightCut && locPosID.is_valid()) {
362 HolesRatio.
add(pixlayer, locPosID, nHole);
363 MissHitsRatio.
add(pixlayer, locPosID, nOutlier + nHole);
372 int trkfitndf =
track->fitQuality()->numberDoF();
373 double trkfitchi2 =
track->fitQuality()->chiSquared();
374 if (trkfitndf != 0) {
378 havePixelHits = havePixelHits || (
nPixelHits > 0);
381 if (!havePixelHits) {
397 sort(ClusterIDs.begin(), ClusterIDs.end(),
398 [](
const std::pair<Identifier, double>& left,
const std::pair<Identifier, double>& right) {
399 return left.first < right.first;
433 auto clusterGroup_OnTrack =
getGroup(
"Cluster_OnTrack");
437 if (!(pixel_clcontainer.isValid())) {
441 return StatusCode::RECOVERABLE;
443 ATH_MSG_DEBUG(
"Pixel Monitoring: Pixel Cluster container " << pixel_clcontainer.name() <<
" is found.");
447 int nclusters_ontrack = 0;
456 for (
auto colNext: *pixel_clcontainer) {
458 if (!ClusterCollection) {
459 ATH_MSG_DEBUG(
"Pixel Monitoring: Pixel Cluster container is empty.");
465 for (
auto p_clus: *ClusterCollection) {
466 clusID = p_clus->identify();
468 if (pixlayer == 99)
continue;
478 Cluster_LVL1A_Mod.
add(pixlayer, clusID, cluster.
LVL1A() + 0.00001);
479 if (cluster.
rdoList().size() > 1) Cluster_LVL1A_SizeCut.
add(pixlayer, clusID, cluster.
LVL1A() + 0.00001);
483 nclusters_mod[iblsublayer]++;
486 nclusters_mod[pixlayer]++;
497 Cluster_Occupancy.
add(pixlayer, clusID);
499 Cluster_FE_Occupancy.
add(pixlayer, clusID,
m_pixelReadout->getFE(clusID, clusID), 1.0);
501 if (cluster.
rdoList().size() > 1) Clus_Occ_SizeCut.
add(pixlayer, clusID);
509 clusPerEventArray.
DA[phiMod][
etaMod]++;
513 clusPerEventArray.
DC[phiMod][
etaMod]++;
517 clusPerEventArray.
B0[phiMod][
etaMod]++;
521 clusPerEventArray.
B1[phiMod][
etaMod]++;
525 clusPerEventArray.
B2[phiMod][
etaMod]++;
534 clLVL1A = cluster.
LVL1A();
535 fill(clusterGroup_OnTrack, clLVL1A);
536 Cluster_LVL1A_Mod_OnTrack.
add(pixlayer, clusID, cluster.
LVL1A() + 0.00001);
537 if (cluster.
rdoList().size() > 1) Cluster_LVL1A_SizeCut_OnTrack.
add(pixlayer, clusID,
538 cluster.
LVL1A() + 0.00001);
548 Cluster_Size_Map_OnTrack.
add(pixlayer, clusID, cluster.
rdoList().size());
553 if (
m_doOnline) ClusterMap_Mon_OnTrack.
add(pixlayer, clusID);
558 Cluster_Occupancy_OnTrack.
add(pixlayer, clusID);
560 Cluster_FE_Occupancy_OnTrack.
add(pixlayer, clusID,
m_pixelReadout->getFE(clusID, clusID), 1.0);
562 if (cluster.
rdoList().size() > 1) Clus_Occ_SizeCut_OnTrack.
add(pixlayer, clusID);
580 nclusters_ontrack_mod[pixlayer]++;
608 fill(clusterGroup_OnTrack, lbval, nClsOnTrk);
617 fill(clusterGroup_OnTrack, lbval, clsFracOnTrack);
628 if (ntracksPerEvent > 0) {
629 for (
unsigned int ii = 0; ii <
PixLayers::COUNT; ii++) nclusters_ontrack_mod[ii] /= ntracksPerEvent;
640 return StatusCode::SUCCESS;
def retrieve(aClass, aKey=None)
bool is_pixel(Identifier id) const
Identifier identifierOfPosition(const Amg::Vector2D &localPos) const
Full identifier of the cell for a given position: assumes a raw local position (no Lorentz shift)
@ numberOfPixelHits
number of pixel layers on track with absence of hits
int getPixLayersID(int ec, int ld) const
helper function to get layers ID
const AtlasDetectorID * m_atlasid
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
const TrkDetElementBase * associatedDetectorElement() const
return associated Detector Element
const_id_iterator wafer_end(void) const
const PixelID * m_pixelid
const_pointer_type cptr()
Dereference the pointer.
bool nPixelHits(const xAOD::TauJet &, const xAOD::TauTrack &track, double &out)
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
Eigen::Matrix< double, 2, 1 > Vector2D
virtual const Surface & associatedSurface() const override=0
Access to the Surface associated to the Parameters.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
const Trk::TrackStates * trackStateOnSurfaces() const
return a pointer to a const DataVector of const TrackStateOnSurfaces.
Dummy class used to allow special convertors to be called for surfaces owned by a detector element.
SG::ReadHandleKey< InDet::SiDetectorElementStatus > m_pixelDetElStatusActiveOnly
Optional read handle to get status data to test whether a pixel detector element is active.
const std::string pixLayersLabel[PixLayers::COUNT]
Identifier associatedDetectorElementIdentifier() const
return Identifier of the associated Detector Element
virtual StatusCode initialize() override
initialize
const_id_iterator wafer_begin(void) const
Iterators over full set of ids. Wafer iterator is sorted.
SG::ReadHandleKey< InDet::SiDetectorElementStatus > m_pixelDetElStatus
Optional read handle to get status data to test whether a pixel detector element is good.
const std::vector< Identifier > & rdoList() const
return the List of rdo identifiers (pointers)
SG::ReadHandleKey< TrackCollection > m_tracksKey
ServiceHandle< InDetDD::IPixelReadoutManager > m_pixelReadout
virtual Identifier identify() const =0
Identifier.
const std::string & key() const
Return the StoreGate ID for the referenced object.
bool empty() const
Test if the key is blank.
#define AmgSymMatrix(dim)
SG::ReadHandle< InDet::SiDetectorElementStatus > getPixelDetElStatus(const SG::ReadHandleKey< InDet::SiDetectorElementStatus > &key, const EventContext &ctx) const
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
@ Outlier
This TSoS contains an outlier, that is, it contains a MeasurementBase/RIO_OnTrack which was not used ...
Base class for Athena Monitoring Algorithms.
dictionary clusterGroup
begin cluster timing
void fill2DProfLayerAccum(const VecAccumulator2DMap &accumulator) const
take VecAccumulator2DMap and fill the corresponding group
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
std::tuple< bool, bool > isChipGood(const IdentifierHash &module_hash, unsigned int chip_i) const
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
IdentifierHash wafer_hash(Identifier wafer_id) const
wafer hash from id
ToolHandle< InDet::IInDetTrackSelectionTool > m_trackSelTool
@ Hole
A hole on the track - this is defined in the following way.
Generic monitoring tool for athena components.
::StatusCode StatusCode
StatusCode definition for legacy code.
PixelAthClusterMonAlg(const std::string &name, ISvcLocator *pSvcLocator)
bool isActive(const InDet::SiDetectorElementStatus *element_status, const IdentifierHash &module_hash) const
SG::ReadHandleKey< InDet::PixelClusterContainer > m_clustersKey
int DC[PixMon::kNumModulesDisk][PixMon::kNumLayersDisk]
virtual bool type(MeasurementBaseType::Type type) const =0
Interface method checking the type.
void fill(const ToolHandle< GenericMonitoringTool > &groupHandle, std::vector< std::reference_wrapper< Monitored::IMonitoredVariable >> &&variables) const
Fills a vector of variables to a group by reference.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
SG::ReadHandle< xAOD::EventInfo > GetEventInfo(const EventContext &) const
Return a ReadHandle for an EventInfo object (get run/event numbers, etc.)
const float inv_nmod_per_layer[PixLayers::COUNT]
virtual const InDetDD::SiDetectorElement * detectorElement() const override final
return the detector element corresponding to this PRD The pointer will be zero if the det el is not d...
void fill1DProfLumiLayers(const std::string &prof1Dname, int lb, float *weights, int nlayers=PixLayers::COUNT) const
filling 1DProf per-lumi per-layer histograms ["ECA","ECC","BLayer","Layer1","Layer2",...
const Amg::MatrixX & localCovariance() const
Interface method to get the localError.
@ numberOfPixelHoles
number of pixels which have a ganged ambiguity.
bool isClusterOnTrack(Identifier id, std::vector< std::pair< Identifier, double > > const &ClusterIDs) const
checks if cluster is on track
Amg::Vector2D localPosition() const
Access method for the local coordinates, local parameter definitions differ for each surface type.
int layer_disk(const Identifier &id) const
int DA[PixMon::kNumModulesDisk][PixMon::kNumLayersDisk]
int eta_module(const Identifier &id) const
virtual const Surface & associatedSurface() const =0
Interface method to get the associated Surface.
double error(const Amg::MatrixX &mat, int index)
return diagonal error of the matrix caller should ensure the matrix is symmetric and the index is in ...
int B1[PixMon::kNumStavesL1][PixMon::kNumModulesBarrel]
Eigen::Matrix< double, 3, 1 > Vector3D
virtual const Trk::PrepRawData * prepRawData() const =0
returns the PrepRawData (also known as RIO) object to which this RIO_OnTrack is associated.
const LocalParameters & localParameters() const
Interface method to get the LocalParameters.
ToolHandle< Trk::ITrackHoleSearchTool > m_holeSearchTool
virtual StatusCode fillHistograms(const EventContext &ctx) const override
adds event to the monitoring histograms
void getPhiEtaMod(Identifier &id, int &phiMod, int &etaMod, bool ©FE) const
helper function to get eta phi coordinates of per-layer arrays
helper class to accumulate points to fill a 2D plot with
void add(const int layer, const Identifier &id, float value=1.0)
helper class to accumulate points to fill a 2D per-module plot with
void fillFromArrays(const std::string &namePP0, AccumulatorArrays &pixarrays, const std::string &name2DMap="") const
filling 1DProfile per-pp0(ROD) histograms for ["ECA","ECC","BLayer","Layer1","Layer2",...
const std::string pixBaseLayersLabel[PixLayers::NBASELAYERS]
bool isGood(const InDet::SiDetectorElementStatus *element_status, const IdentifierHash &module_hash) const
virtual StatusCode initialize() override
initialize
float totalCharge() const
virtual Identifier identify() const final
return the identifier -extends MeasurementBase
int getNumberOfFEs(int pixlayer, int etaMod) const
helper function to get number of FEs per module
Declare a monitored scalar variable.
const int clusterToTMinCut[PixLayers::COUNT]
int B0[PixMon::kNumStavesL0][PixMon::kNumModulesBarrel]
virtual ~PixelAthClusterMonAlg()
int B2[PixMon::kNumStavesL2][PixMon::kNumModulesBarrel]
const ToolHandle< GenericMonitoringTool > & getGroup(const std::string &name) const
Get a specific monitoring tool from the tool handle array.
@ Measurement
This is a measurement, and will at least contain a Trk::MeasurementBase.
Trk::PrepRawDataCollection< PixelCluster > PixelClusterCollection
int IBL[PixMon::kNumStavesIBL][PixMon::kNumFEsIBL]