18 m_pm[layer].push_back(
m_host.m_pixelid->phi_module(
id));
19 int ld =
m_host.m_pixelid->layer_disk(
id);
21 m_val[layer].push_back(value);
24 if (
m_host.m_pixelid->barrel_ec(
id) == 0) {
25 em =
m_host.m_pixelid->eta_module(
id);
31 }
else if (em > -7 && em < 6) {
32 if (
m_host.m_pixelid->eta_index(
id) >= 80) feid = 1;
41 m_em[layer].push_back(em);
45 m_pm[layer].push_back(
m_host.m_pixelid->phi_module(
id));
46 m_em[layer].push_back(em);
47 m_val[layer].push_back(value);
56 int iFE,
float value) {
58 m_val[layer].push_back(value);
67 m_pm[layer].push_back(
m_host.m_pixelid->phi_module(
id) * 2 + iFE / 8);
69 m_pm[layer].push_back(
m_host.m_pixelid->phi_module(
id) * 2 + 1 - iFE / 8);
73 int ld =
m_host.m_pixelid->layer_disk(
id);
77 if (iFE < 8) em += (7 - iFE % 8);
82 if (
m_host.m_pixelid->barrel_ec(
id) == 0) {
84 em =
m_host.m_pixelid->eta_module(
id);
88 }
else if (em > -7 && em < 6) {
95 em =
m_host.m_pixelid->eta_module(
id) * 8 - 4;
96 if (iFE < 8) em += (7 - iFE % 8);
100 m_em[layer].push_back(em);
105 ATH_CHECK(
m_pixelCondSummaryTool.retrieve( DisableTool{ !m_pixelDetElStatus.empty() && !m_pixelDetElStatusActiveOnly.empty() && !VALIDATE_STATUS_ARRAY_ACTIVATED} ) );
112 return StatusCode::SUCCESS;
121 for (
const auto& itr : accumulator.m_pm) {
123 int layer = itr.first;
140 for (
const auto& itr : accumulator.m_pm) {
141 int layer = itr.first;
142 auto pm_v = accumulator.m_pm.at(layer);
143 auto em_v = accumulator.m_em.at(layer);
144 auto val_v = accumulator.m_val.at(layer);
145 auto pi = pm_v.begin();
146 auto ei = em_v.begin();
147 auto vi = val_v.begin();
148 while (
pi!=pm_v.end() and ei!=em_v.end() and vi!=val_v.end() )
151 auto em = em_offsets[layer] + *ei++;
175 for (
int i = i_start; i < i_end; i++) {
196 for (cat = 0; cat < nCategories[i]; cat++) {
197 val = values[cat][i];
210 const std::string& name2DMap)
const {
213 const float weightPix = 1.0 / 46080.0;
214 const float weightIBL = 1.0 / 26880.0;
216 bool fillPP0only(name2DMap ==
"");
217 std::string pospp0varx = namePP0 +
"_pospp0x";
218 std::string valvarp = namePP0 +
"_val";
219 std::string posvarx = name2DMap +
"_em";
220 std::string posvary = name2DMap +
"_pm";
221 std::string valvarm = name2DMap +
"_val";
237 if (pixarrays.DA[
a][b] > -1) {
238 fill(
"ECA", pospp0x, valp);
239 if (!fillPP0only)
fill(
"ECA", posx, posy, valm);
241 valp = pixarrays.DC[
a][b];
242 valm = pixarrays.DC[
a][b] * weightPix;
243 if (pixarrays.DC[
a][b] > -1) {
244 fill(
"ECC", pospp0x, valp);
245 if (!fillPP0only)
fill(
"ECC", posx, posy, valm);
261 if (pixarrays.B0[
a][b] > -1) {
262 fill(
"BLayer", pospp0x, valp);
263 if (!fillPP0only)
fill(
"BLayer", posx, posy, valm);
271 if (pixarrays.B1[
a][b] > -1) {
272 fill(
"Layer1", pospp0x, valp);
273 if (!fillPP0only)
fill(
"Layer1", posx, posy, valm);
281 if (pixarrays.B2[
a][b] > -1) {
282 fill(
"Layer2", pospp0x, valp);
283 if (!fillPP0only)
fill(
"Layer2", posx, posy, valm);
289 for (
unsigned int a = 0;
a < nbina; ++
a) {
292 for (
unsigned int b = 0; b < nbinb; ++b) {
299 if (pixarrays.IBL[
a][b] > -1) {
300 if (b > (0.5 * nbinb - 1)) {
301 fill(
"IBLA", pospp0x, valp);
303 fill(
"IBLC", pospp0x, valp);
305 if (!fillPP0only)
fill(
"IBL", posx, posy, valm);
322 }
else if (ec == -2) {
324 }
else if (ec == 0) {
338 if ( hashID>=156 && hashID<=435 )
340 int module = (hashID-156) % 20;
341 if (module>3 && module<16)
356 if ( hashID>=156 && hashID<=435 )
358 int module = (hashID-156) % 20;
359 if (module<4 || module>15)
377 if (etaMod > -7 && etaMod < 6) nFE = 2;
389 bool& copyFE)
const {
392 int layerDisk =
m_pixelid->layer_disk(
id);
397 if (layerDisk == 0) {
400 }
else if (etaMod > -7 && etaMod < 6) {
402 if (
m_pixelid->eta_index(
id) >= 80) feid = 1;
403 etaMod = 2 * etaMod + feid;
408 etaMod = etaMod + 16;
409 }
else etaMod = etaMod + 6;
419 return binary_search(RDOIDs.begin(), RDOIDs.end(),
id);
432 double> >
const& ClusterIDs)
const {
433 bool onTrack =
false;
435 std::pair<Identifier, double> searchVal = std::make_pair(
id, -1.0);
436 onTrack = std::binary_search(ClusterIDs.begin(), ClusterIDs.end(), searchVal,
437 [](std::pair<Identifier, double> l, std::pair<Identifier, double>
r) ->
bool {
438 return l.first < r.first;
449 double> >
const& ClusterIDs,
450 double& cosalpha)
const {
453 std::pair<Identifier, double> searchVal = std::make_pair(
id, -1.0);
454 auto it = std::lower_bound(ClusterIDs.begin(), ClusterIDs.end(), searchVal,
455 [](std::pair<Identifier, double> l, std::pair<Identifier, double>
r) ->
bool {
456 return l.first < r.first;
459 if (it != ClusterIDs.end() && !(
id < (*it).first)) {
461 cosalpha = (*it).second;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
const std::string pixBaseLayersLabel[PixLayers::NBASELAYERS]
const std::string pixLayersLabel[PixLayers::COUNT]
#define VALIDATE_STATUS_ARRAY_ACTIVATED
const ServiceHandle< StoreGateSvc > & detStore() const
virtual StatusCode initialize() override
initialize
ToolHandleArray< GenericMonitoringTool > m_tools
Array of Generic Monitoring Tools.
Declare a monitored scalar variable.
void fill2DProfLayerAccum(const VecAccumulator2DMap &accumulator) const
take VecAccumulator2DMap and fill the corresponding group
SG::ReadHandleKey< InDet::SiDetectorElementStatus > m_pixelDetElStatusActiveOnly
Optional read handle to get status data to test whether a pixel detector element is active.
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
void fill1DModProfAccum(const VecAccumulator2DMap &accumulator, int lumiblock) const
take VecAccumulator2DMap and fill 3D arrays [layer, pm, em] with its values and lumiblock
ServiceHandle< InDetDD::IPixelReadoutManager > m_pixelReadout
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::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
SG::ReadHandleKey< InDet::SiDetectorElementStatus > m_pixelDetElStatus
Optional read handle to get status data to test whether a pixel detector element is good.
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",...
virtual StatusCode initialize() override
initialize
const PixelID * m_pixelid
ValuesCollection< T > Collection(std::string name, const T &collection)
Declare a monitored (double-convertible) collection.
const int pixPhiSteps[PixLayers::NBASELAYERS]
const unsigned int kNumStavesL0
const unsigned int kNumStavesL1
const unsigned int kNumFEsIBL
const unsigned int kNumStavesIBL
const unsigned int kNumModulesDisk
const unsigned int kNumStavesL2
const unsigned int kNumLayersDisk
const unsigned int 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
std::unordered_map< int, std::vector< int > > m_em
void fill(H5::Group &out_file, size_t iterations)