ATLAS Offline Software
NswPassivationDbData.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
8  m_mmIdHelper(mmIdHelper) {}
9 
10 
12  const int pcb,
13  const float indiv,
14  const float extra,
15  const std::string& position) {
16  unsigned long long channelId = chnlId.get_compact();
17  PCBPassivation& passiv = m_data[channelId];
18  passiv.valid = true;
19  if (position=="left" ) passiv.left = indiv + extra;
20  else if(position=="right") passiv.right = indiv + extra;
21  else {
22  passiv.left = extra;
23  passiv.right = extra;
24  }
25  if(extra==0) return;
26  /* in case an extra passivation is given (extra>0), it is applied (1/2)
27  to top or bottom depending on the following cases:
28  * if pcb = 1 or 6 => only top
29  * if pcb = 5 or 8 => only bottom
30  * else (if pcb = 2, 3, 4 or 7) => both top and bottom
31  */
32  if(pcb!=5 && pcb!=8) passiv.top = extra/2;
33  if(pcb!=1 && pcb!=6) passiv.bottom = extra/2;
34 }
35 // retrieval functions -------------------------------
36 
37 // getChannelIds
38 std::vector<Identifier> NswPassivationDbData::getChannelIds() const {
39  std::vector<Identifier> keys;
40  std::transform(m_data.begin(),m_data.end(), std::back_inserter(keys),
41  [](const PassivationMap::value_type& key_pair) ->Identifier{
42  return Identifier{key_pair.first};
43  });
44  return keys;
45 }
46 
48  unsigned long long channelId = m_mmIdHelper.pcbID(id).get_compact();
49  PassivationMap::const_iterator itr = m_data.find(channelId);
50  if (itr != m_data.end()) return itr->second;
51  static const PCBPassivation dummy{};
52  return dummy;
53 }
NswPassivationDbData::NswPassivationDbData
NswPassivationDbData(const MmIdHelper &)
Definition: NswPassivationDbData.cxx:7
NswPassivationDbData::getPassivation
const PCBPassivation & getPassivation(const Identifier &id) const
Definition: NswPassivationDbData.cxx:47
NswPassivationDbData::PCBPassivation
Helper struct to save the four passivation values of each PCB.
Definition: NswPassivationDbData.h:24
NswPassivationDbData.h
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
Amg::transform
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
Definition: GeoPrimitivesHelpers.h:156
MmIdHelper.h
NswPassivationDbData::PCBPassivation::valid
bool valid
Definition: NswPassivationDbData.h:29
NswPassivationDbData::PCBPassivation::bottom
double bottom
Definition: NswPassivationDbData.h:28
python.xAODType.dummy
dummy
Definition: xAODType.py:4
NswPassivationDbData::setData
void setData(const Identifier &chnlId, const int pcb, const float indiv, const float extra, const std::string &position)
Definition: NswPassivationDbData.cxx:11
CaloCondBlobAlgs_fillNoiseFromASCII.channelId
channelId
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:122
python.handimod.extra
int extra
Definition: handimod.py:522
NswPassivationDbData::m_mmIdHelper
const MmIdHelper & m_mmIdHelper
ID helpers.
Definition: NswPassivationDbData.h:43
NswPassivationDbData::PCBPassivation::top
double top
Definition: NswPassivationDbData.h:27
Identifier::get_compact
value_type get_compact(void) const
Get the compact id.
MmIdHelper
Definition: MmIdHelper.h:54
NswPassivationDbData::PCBPassivation::right
double right
Definition: NswPassivationDbData.h:26
MmIdHelper::pcbID
Identifier pcbID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int pcb) const
Definition: MmIdHelper.cxx:303
NswPassivationDbData::getChannelIds
std::vector< Identifier > getChannelIds() const
Definition: NswPassivationDbData.cxx:38
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
NswPassivationDbData::m_data
PassivationMap m_data
Definition: NswPassivationDbData.h:46
NswPassivationDbData::PCBPassivation::left
double left
Definition: NswPassivationDbData.h:25