5#ifndef PIXELATHMONITORINGBASE_H
6#define PIXELATHMONITORINGBASE_H
24 kECA = 0,
kECC,
kBLayer,
kLayer1,
kLayer2,
kIBL2D,
NFEI3LAYERS=
kIBL2D,
kIBL=
kIBL2D,
kIBL3D,
NBASELAYERS=
kIBL3D,
COUNT
34 "ECA",
"ECC",
"BLayer",
"Layer1",
"Layer2",
"IBL2D",
"IBL3D"
37 "ECA",
"ECC",
"BLayer",
"Layer1",
"Layer2",
"IBL"
40 1.f / 144.f, 1.f / 144.f, 1.f / 286.f, 1.f / 494.f, 1.f / 676.f, 1.f / 336.f, 1.f / 112.f
43 15, 15, 15, 15, 15, 4, 4
78const std::vector<float>
iblFEetaEdges = { 0.5894, 1.0531, 1.3851, 1.6499, 1.8559, 2.0336, 2.1805, 2.3132,
79 2.4268, 2.5324, 2.6249, 2.7116, 2.7906, 2.8638, 2.9321, 2.9953 };
80const std::vector<float>
iblFEphiLoEdges = { -3.0551, -2.6063, -2.1575, -1.7087, -1.2599, -0.8111, -0.3623,
81 0.0865, 0.5353, 0.9841, 1.4329, 1.8817, 2.3305, 2.7793 };
82const std::vector<float>
iblFEphiUpEdges = { -3.0215, -2.5727, -2.1239, -1.6751, -1.2263, -0.7775, -0.3287,
83 0.1201, 0.5689, 1.0177, 1.4665, 1.9153, 2.3641, 2.8129 };
92 const int* nCategories)
const;
102 double& cosalpha)
const;
105 std::unordered_map<int, std::vector<int> >
m_pm;
106 std::unordered_map<int, std::vector<int> >
m_em;
107 std::unordered_map<int, std::vector<float> >
m_val;
116 void add(
const int layer,
const Identifier&
id,
float value = 1.0);
118 int iFE,
float value);
120 void fill2DProfLayerAccum(
const VecAccumulator2DMap& accumulator)
const;
121 void fill1DModProfAccum(
const VecAccumulator2DMap& accumulator,
int lumiblock)
const;
131 void fillFromArrays(
const std::string& namePP0, AccumulatorArrays& pixarrays,
132 const std::string& name2DMap =
"")
const;
136 this,
"PixelConditionsSummaryTool",
"PixelConditionsSummaryTool",
"Tool to retrieve Pixel Conditions summary"
140 this,
"PixelReadoutManager",
"PixelReadoutManager",
"Pixel readout manager"
149 {
this,
"PixelDetElStatus",
"",
"Key of SiDetectorElementStatus for Pixel"};
156 {
this,
"PixelDetElStatusActiveOnly",
"",
"Key of SiDetectorElementStatus for Pixel which reflects only whether modules or chips are active rather than delivering good data"};
162 if (!pixelDetElStatus.
isValid()) {
163 std::stringstream
msg;
164 msg <<
"Failed to get " << key.key() <<
" from StoreGate in " << name();
165 throw std::runtime_error(
msg.str());
168 return pixelDetElStatus;
172 const EventContext& ctx{Gaudi::Hive::currentContext()};
179 const EventContext& ctx{Gaudi::Hive::currentContext()};
185 unsigned int chip_i)
const {
186 bool is_active=
false;
190 const EventContext& ctx{Gaudi::Hive::currentContext()};
196 return std::make_tuple(is_active,is_good);
199 unsigned int chip_i)
const {
200 bool is_active=
false;
203 const EventContext& ctx{Gaudi::Hive::currentContext()};
211 unsigned int chip_i)
const {
212 return std::make_tuple(element_active.
isChipGood(module_hash, chip_i), element_status.
isChipGood(module_hash, chip_i) );
217 unsigned int chip_i)
const {
218 std::tuple<bool,bool> ret( element_active && element_status
219 ?
isChipGood( *element_active, *element_status, module_hash, chip_i)
221#ifdef DO_VALIDATE_STATUS_ARRAY
223 const EventContext& ctx{Gaudi::Hive::currentContext()};
231 unsigned int chip_i)
const {
232 bool ret( element_active
233 ? element_active->
isChipGood(module_hash, chip_i)
235#ifdef DO_VALIDATE_STATUS_ARRAY
236 const EventContext& ctx{Gaudi::Hive::currentContext()};
Header file to be included by clients of the Monitored infrastructure.
const std::string pixBaseLayersLabel[PixLayers::NBASELAYERS]
const std::string pixLayersLabel[PixLayers::COUNT]
const std::vector< float > iblFEphiLoEdges
const int clusterToTMinCut[PixLayers::COUNT]
const std::vector< float > iblFEphiUpEdges
const std::vector< float > iblFEetaEdges
const float inv_nmod_per_layer[PixLayers::COUNT]
This is an Identifier helper class for the Pixel subdetector.
#define VALIDATE_STATUS_ARRAY(use_info, info_val, summary_val)
AthMonitorAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
This is a "hash" representation of an Identifier.
bool is_valid() const
Check if id is in a valid state.
bool isChipGood(IdentifierHash hash, unsigned int chip) const
bool isGood(IdentifierHash hash) const
SG::ReadHandleKey< InDet::SiDetectorElementStatus > m_pixelDetElStatusActiveOnly
Optional read handle to get status data to test whether a pixel detector element is active.
bool isChipActive(const IdentifierHash &module_hash, unsigned int chip_i) const
int getNumberOfFEs(int pixlayer, int etaMod) const
helper function to get number of FEs per module
ToolHandle< IInDetConditionsTool > m_pixelCondSummaryTool
bool isClusterOnTrack(Identifier id, std::vector< std::pair< Identifier, double > > const &ClusterIDs) const
checks if cluster is on track
void fill2DProfLumiLayers(const std::string &prof2Dname, int lb, float(*weights)[PixLayers::COUNT], const int *nCategories) const
filling 2DProf per-lumi per-layer histograms ["ECA","ECC","BLayer","Layer1","Layer2",...
bool isHitOnTrack(Identifier id, std::vector< Identifier > const &RDOIDs) const
checks if hit is on track
void getPhiEtaMod(Identifier &id, int &phiMod, int &etaMod, bool ©FE) const
helper function to get eta phi coordinates of per-layer arrays
bool isIBL3D(int hashID) const
helper function to check if module is IBL 3D based on pixel hash ID
ServiceHandle< InDetDD::IPixelReadoutManager > m_pixelReadout
bool isGood(const InDet::SiDetectorElementStatus *element_status, const IdentifierHash &module_hash) const
std::tuple< bool, bool > isChipGood(const InDet::SiDetectorElementStatus *element_active, const InDet::SiDetectorElementStatus *element_status, const IdentifierHash &module_hash, unsigned int chip_i) const
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",...
int getPixLayersID(int ec, int ld) const
helper function to get layers ID
std::tuple< bool, bool > isChipGood(const InDet::SiDetectorElementStatus &element_active, const InDet::SiDetectorElementStatus &element_status, const IdentifierHash &module_hash, unsigned int chip_i) const
std::vector< int > m_modData[PixLayers::NBASELAYERS]
bool isIBL2D(int hashID) const
helper function to check if module is IBL planar based on pixel hash ID
std::tuple< bool, bool > isChipGood(const IdentifierHash &module_hash, unsigned int chip_i) const
SG::ReadHandleKey< InDet::SiDetectorElementStatus > m_pixelDetElStatus
Optional read handle to get status data to test whether a pixel detector element is good.
bool isChipActive(const InDet::SiDetectorElementStatus *element_active, const IdentifierHash &module_hash, unsigned int chip_i) const
bool isActive(const InDet::SiDetectorElementStatus *element_status, const IdentifierHash &module_hash) const
SG::ReadHandle< InDet::SiDetectorElementStatus > getPixelDetElStatus(const SG::ReadHandleKey< InDet::SiDetectorElementStatus > &key, const EventContext &ctx) const
const PixelID * m_pixelid
This is an Identifier helper class for the Pixel subdetector.
Property holding a SG store/key/clid from which a ReadHandle is made.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const int pixPhiSteps[PixLayers::NBASELAYERS]
const unsigned int kNumStavesL0
const unsigned int kNumPP0sEC
const unsigned int kNumStavesL1
const unsigned int kNumFEsIBL
const unsigned int kNumStavesIBL
const unsigned int kNumModulesDisk
const int pixEtaSteps[PixLayers::NBASELAYERS]
const unsigned int kNumStavesL2
const unsigned int kNumLayersDisk
const unsigned int kNumModulesBarrel
int DA[PixMon::kNumModulesDisk][PixMon::kNumLayersDisk]
int DC[PixMon::kNumModulesDisk][PixMon::kNumLayersDisk]
int IBL[PixMon::kNumStavesIBL][PixMon::kNumFEsIBL]
int B1[PixMon::kNumStavesL1][PixMon::kNumModulesBarrel]
int B0[PixMon::kNumStavesL0][PixMon::kNumModulesBarrel]
int B2[PixMon::kNumStavesL2][PixMon::kNumModulesBarrel]
const PixelAthMonitoringBase & m_host
std::unordered_map< int, std::vector< float > > m_val
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
std::unordered_map< int, std::vector< int > > m_pm
VecAccumulator2DMap(const PixelAthMonitoringBase &host, const std::string &prof2Dname, bool copy2DFEval=false)
std::unordered_map< int, std::vector< int > > m_em