ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
Muon::TgcPrepDataReplicationToolAllBCto3BC Class Reference

#include <TgcPrepDataReplicationToolAllBCto3BC.h>

Inheritance diagram for Muon::TgcPrepDataReplicationToolAllBCto3BC:
Collaboration diagram for Muon::TgcPrepDataReplicationToolAllBCto3BC:

Public Member Functions

 TgcPrepDataReplicationToolAllBCto3BC (const std::string &t, const std::string &n, const IInterface *p)
 Constructor. More...
 
virtual ~TgcPrepDataReplicationToolAllBCto3BC ()=default
 Destructor. More...
 
virtual StatusCode initialize () override
 
virtual StatusCode replicate (const EventContext &ctx) const override
 

Static Public Member Functions

static TgcPrepDatamakeTgcPrepData (const TgcPrepData *to_copy, uint16_t bcBitMap)
 Make new TgcPrepData. More...
 

Private Types

enum  {
  BC_PREVIOUS =0, BC_CURRENT, BC_NEXT, BC_ALL,
  BC_NUM
}
 

Private Member Functions

StatusCode convertAllBCto3BC (const EventContext &ctx) const
 

Private Attributes

ServiceHandle< Muon::IMuonIdHelperSvcm_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
 
SG::WriteHandleKeyArray< TgcPrepDataContainerm_3BCKeys {this, "BC3Keys", {"dummy","dummy","dummy"}}
 
SG::ReadHandleKey< TgcPrepDataContainerm_AllBCKey {this, "AllBCKey", "TGC_MeasurementsAllBCs"}
 

Detailed Description

Definition at line 18 of file TgcPrepDataReplicationToolAllBCto3BC.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
BC_PREVIOUS 
BC_CURRENT 
BC_NEXT 
BC_ALL 
BC_NUM 

Definition at line 37 of file TgcPrepDataReplicationToolAllBCto3BC.h.

Constructor & Destructor Documentation

◆ TgcPrepDataReplicationToolAllBCto3BC()

Muon::TgcPrepDataReplicationToolAllBCto3BC::TgcPrepDataReplicationToolAllBCto3BC ( const std::string &  t,
const std::string &  n,
const IInterface *  p 
)

Constructor.

Definition at line 14 of file TgcPrepDataReplicationToolAllBCto3BC.cxx.

16  : base_class(t, n, p) {}

◆ ~TgcPrepDataReplicationToolAllBCto3BC()

virtual Muon::TgcPrepDataReplicationToolAllBCto3BC::~TgcPrepDataReplicationToolAllBCto3BC ( )
virtualdefault

Destructor.

Member Function Documentation

◆ convertAllBCto3BC()

StatusCode Muon::TgcPrepDataReplicationToolAllBCto3BC::convertAllBCto3BC ( const EventContext &  ctx) const
private

Definition at line 41 of file TgcPrepDataReplicationToolAllBCto3BC.cxx.

41  {
42 
44 
45  if(!tgcAll.isValid()) {
46  ATH_MSG_FATAL("Cannot retrieve TGC_MeasurementsAllBCs");
47  return StatusCode::FAILURE;
48  }
49 
50 
51  // convert
52  auto tgc3BCHandles = m_3BCKeys.makeHandles(ctx);
53  for (int ibc = 0; ibc < BC_ALL; ibc++){
54  tgc3BCHandles.at(ibc) = std::make_unique<TgcPrepDataContainer>(m_idHelperSvc->tgcIdHelper().module_hash_max());
55  }
56 
57  for (const Muon::TgcPrepDataCollection * coll : *tgcAll) {
58  for (const Muon::TgcPrepData* to_copy : *coll) {
59 
60  uint16_t bcBitMap = to_copy->getBcBitMap();
61  std::array<uint16_t, BC_NUM> hasBC{0};
62  if (bcBitMap & TgcPrepData::BCBIT_PREVIOUS)
64  if (bcBitMap & TgcPrepData::BCBIT_CURRENT)
66  if (bcBitMap & TgcPrepData::BCBIT_NEXT)
68 
69  const Identifier channelId = to_copy->identify();
70  const Identifier elementId = m_idHelperSvc->tgcIdHelper().elementID(channelId);
71  std::array<Muon::TgcPrepDataCollection*, BC_ALL> collections{};
72  for (int ibc = 0; ibc < BC_ALL; ibc++) {
73  collections[ibc] = Muon::IDC_Helper::getCollection<TgcPrepDataContainer, TgcIdHelper>
74  (elementId, tgc3BCHandles[ibc].ptr(), m_idHelperSvc->tgcIdHelper(), msg());
75 
76  if (!hasBC[ibc]) continue;
77  Muon::TgcPrepData* newPrepData = makeTgcPrepData(to_copy, hasBC[ibc]);
78  newPrepData->setHashAndIndex(collections[ibc]->identifyHash(), collections[ibc]->size());
79  collections[ibc]->push_back(newPrepData);
80  }
81  }
82  }
83 
84 
85  return StatusCode::SUCCESS;
86 }

◆ initialize()

StatusCode Muon::TgcPrepDataReplicationToolAllBCto3BC::initialize ( )
overridevirtual

Definition at line 19 of file TgcPrepDataReplicationToolAllBCto3BC.cxx.

19  {
20  ATH_CHECK(m_idHelperSvc.retrieve());
21 
22  for(int ibc = 0; ibc < BC_ALL; ibc++) {
23  std::ostringstream location;
24  location << "TGC_Measurements"
25  << (ibc == BC_PREVIOUS ? "PriorBC" : "")
26  << (ibc == BC_NEXT ? "NextBC" : "");
27  m_3BCKeys.at(ibc) = location.str();
28  }
29 
30  ATH_CHECK(m_3BCKeys.initialize());
31  ATH_CHECK(m_AllBCKey.initialize());
32 
33  return StatusCode::SUCCESS;
34 }

◆ makeTgcPrepData()

Muon::TgcPrepData * Muon::TgcPrepDataReplicationToolAllBCto3BC::makeTgcPrepData ( const TgcPrepData to_copy,
uint16_t  bcBitMap 
)
static

Make new TgcPrepData.

Definition at line 90 of file TgcPrepDataReplicationToolAllBCto3BC.cxx.

91 {
92  Identifier channelId = to_copy->identify();
93  IdentifierHash tgcHashId = to_copy->collectionHash();
94  const std::vector<Identifier> &identifierList = to_copy->rdoList();
95  const Amg::MatrixX& newErrHitPos{to_copy->localCovariance()};
96  const MuonGM::TgcReadoutElement* descriptor = to_copy->detectorElement();
97  Muon::TgcPrepData* newPrepData = new TgcPrepData(channelId, tgcHashId, to_copy->localPosition(),
98  identifierList, newErrHitPos, descriptor);
99  newPrepData->setBcBitMap(bcBitMap);
100 
101  return newPrepData;
102 }

◆ replicate()

StatusCode Muon::TgcPrepDataReplicationToolAllBCto3BC::replicate ( const EventContext &  ctx) const
overridevirtual

Definition at line 36 of file TgcPrepDataReplicationToolAllBCto3BC.cxx.

37 {
38  return convertAllBCto3BC(ctx);
39 }

Member Data Documentation

◆ m_3BCKeys

SG::WriteHandleKeyArray<TgcPrepDataContainer> Muon::TgcPrepDataReplicationToolAllBCto3BC::m_3BCKeys {this, "BC3Keys", {"dummy","dummy","dummy"}}
private

Definition at line 41 of file TgcPrepDataReplicationToolAllBCto3BC.h.

◆ m_AllBCKey

SG::ReadHandleKey<TgcPrepDataContainer> Muon::TgcPrepDataReplicationToolAllBCto3BC::m_AllBCKey {this, "AllBCKey", "TGC_MeasurementsAllBCs"}
private

Definition at line 42 of file TgcPrepDataReplicationToolAllBCto3BC.h.

◆ m_idHelperSvc

ServiceHandle<Muon::IMuonIdHelperSvc> Muon::TgcPrepDataReplicationToolAllBCto3BC::m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
private

Definition at line 39 of file TgcPrepDataReplicationToolAllBCto3BC.h.


The documentation for this class was generated from the following files:
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition: EventPrimitives.h:29
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
Trk::PrepRawDataType::TgcPrepData
@ TgcPrepData
Muon::TgcPrepData::BCBIT_PREVIOUS
@ BCBIT_PREVIOUS
Definition: TgcPrepData.h:97
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
Muon::TgcPrepDataReplicationToolAllBCto3BC::m_AllBCKey
SG::ReadHandleKey< TgcPrepDataContainer > m_AllBCKey
Definition: TgcPrepDataReplicationToolAllBCto3BC.h:42
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
Muon::TgcPrepDataReplicationToolAllBCto3BC::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: TgcPrepDataReplicationToolAllBCto3BC.h:39
Muon::TgcPrepDataReplicationToolAllBCto3BC::convertAllBCto3BC
StatusCode convertAllBCto3BC(const EventContext &ctx) const
Definition: TgcPrepDataReplicationToolAllBCto3BC.cxx:41
Muon::TgcPrepData::BCBIT_CURRENT
@ BCBIT_CURRENT
Definition: TgcPrepData.h:97
Muon::TgcPrepDataReplicationToolAllBCto3BC::BC_NUM
@ BC_NUM
Definition: TgcPrepDataReplicationToolAllBCto3BC.h:37
Muon::TgcPrepDataReplicationToolAllBCto3BC::BC_PREVIOUS
@ BC_PREVIOUS
Definition: TgcPrepDataReplicationToolAllBCto3BC.h:37
Muon::TgcPrepDataReplicationToolAllBCto3BC::BC_ALL
@ BC_ALL
Definition: TgcPrepDataReplicationToolAllBCto3BC.h:37
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:88
Trk::PrepRawData::setHashAndIndex
void setHashAndIndex(unsigned short collHash, unsigned short objIndex)
TEMP for testing: might make some classes friends later ...
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
beamspotman.n
n
Definition: beamspotman.py:731
python.sizes.location
string location
Definition: sizes.py:11
MuonGM::TgcReadoutElement
A TgcReadoutElement corresponds to a single TGC chamber; therefore typically a TGC station contains s...
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/TgcReadoutElement.h:42
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
Muon::TgcPrepData::BCBIT_NEXT
@ BCBIT_NEXT
Definition: TgcPrepData.h:97
Muon::TgcPrepDataReplicationToolAllBCto3BC::BC_CURRENT
@ BC_CURRENT
Definition: TgcPrepDataReplicationToolAllBCto3BC.h:37
Muon::TgcPrepDataReplicationToolAllBCto3BC::BC_NEXT
@ BC_NEXT
Definition: TgcPrepDataReplicationToolAllBCto3BC.h:37
Muon::TgcPrepDataReplicationToolAllBCto3BC::m_3BCKeys
SG::WriteHandleKeyArray< TgcPrepDataContainer > m_3BCKeys
Definition: TgcPrepDataReplicationToolAllBCto3BC.h:41
Muon::MuonPrepDataCollection
Template to hold collections of MuonPrepRawData objects.
Definition: MuonPrepDataCollection.h:46
CaloCondBlobAlgs_fillNoiseFromASCII.channelId
channelId
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:122
Muon::TgcPrepData::setBcBitMap
void setBcBitMap(const uint16_t)
set the bcBitMap for this PRD
Definition: TgcPrepData.cxx:80
Muon::TgcPrepDataReplicationToolAllBCto3BC::makeTgcPrepData
static TgcPrepData * makeTgcPrepData(const TgcPrepData *to_copy, uint16_t bcBitMap)
Make new TgcPrepData.
Definition: TgcPrepDataReplicationToolAllBCto3BC.cxx:90
Muon::TgcPrepData
Class to represent TGC measurements.
Definition: TgcPrepData.h:32
IdentifierHash
Definition: IdentifierHash.h:38
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7