 |
ATLAS Offline Software
|
Go to the documentation of this file.
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;
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
@ numberOfInnermostPixelLayerHits
these are the hits in the 1st pixel layer
const PixelID * m_pixelid
const_pointer_type cptr()
Dereference the pointer.
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.
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
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
@ numberOfNextToInnermostPixelLayerHits
these are the pixel hits, including the b-layer
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.
float nPixelHits(const U &p)
#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.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
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
ToolHandle< InDet::IInDetTestPixelLayerTool > m_testPixelLayerTool
tool to calculate expected hit information in innermost layers
A summary of the information contained by a track.
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
const_id_iterator wafer_end() const
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]
Identifier identify() const
return the identifier -extends MeasurementBase
bool isGood(const InDet::SiDetectorElementStatus *element_status, const IdentifierHash &module_hash) const
virtual StatusCode initialize() override
initialize
float totalCharge() const
const_id_iterator wafer_begin() const
Iterators over full set of ids. Wafer iterator is sorted.
int getNumberOfFEs(int pixlayer, int etaMod) const
helper function to get number of FEs per module
int get(const SummaryType &type) const
returns the summary information for the passed SummaryType.
Declare a monitored scalar variable.
const int clusterToTMinCut[PixLayers::COUNT]
constexpr int pow(int base, int exp) noexcept
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]