ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
xAODContainerMaker Class Reference

#include <xAODContainerMaker.h>

Inheritance diagram for xAODContainerMaker:
Collaboration diagram for xAODContainerMaker:

Public Member Functions

StatusCode initialize () override
 
StatusCode makeStripClusterContainer (const int numClusters, const EFTrackingDataFormats::StripClusterAuxInput &scAux, const EFTrackingDataFormats::Metadata *meta, const EventContext &ctx) const
 Create xAOD::StripClusterContainer by creating xAOD::StripCluster objects one by one. More...
 
StatusCode makePixelClusterContainer (const int numClusters, const EFTrackingDataFormats::PixelClusterAuxInput &pxAux, const EFTrackingDataFormats::Metadata *meta, const EventContext &ctx) const
 Create xAOD::PixelClusterContainer by creating xAOD::PixelCluster objects one by one. More...
 
StatusCode makePixelSpacePointContainer (const int numPixelSpacePoints, const EFTrackingDataFormats::SpacePointAuxInput &psAux, const std::vector< std::vector< const xAOD::UncalibratedMeasurement * >> pixelsp_meas, const EventContext &ctx) const
 Create xAOD::SpacePointContainer by creating xAOD::SpacePoint for Pixel SpacePoint objects one by one. More...
 
StatusCode makeStripSpacePointContainer (const int numStripSpacePoints, const EFTrackingDataFormats::SpacePointAuxInput &sspAux, const std::vector< std::vector< const xAOD::UncalibratedMeasurement * >> stripsp_meas, const EventContext &ctx) const
 Create xAOD::SpacePointContainer by creating xAOD::SpacePoint for Strip SpacePoint objects one by one. More...
 

Private Attributes

SG::WriteHandleKey< xAOD::PixelClusterContainerm_pixelClustersKey
 Key for the pixel cluster container. More...
 
SG::WriteHandleKey< xAOD::StripClusterContainerm_stripClustersKey
 Key for the strip cluster container. More...
 
SG::WriteHandleKey< xAOD::SpacePointContainerm_pixelSpacePointsKey
 Key for the Pixel SpacePoint container. More...
 
SG::WriteHandleKey< xAOD::SpacePointContainerm_stripSpacePointsKey
 Key for the Strip SpacePoint container. More...
 

Detailed Description

Definition at line 24 of file xAODContainerMaker.h.

Member Function Documentation

◆ initialize()

StatusCode xAODContainerMaker::initialize ( )
override

Definition at line 20 of file xAODContainerMaker.cxx.

20  {
21  ATH_MSG_INFO("Initializing xAODContainerMaker tool");
22 
23  ATH_CHECK(m_pixelClustersKey.initialize());
24  ATH_CHECK(m_stripClustersKey.initialize());
25  ATH_CHECK(m_stripSpacePointsKey.initialize());
26  ATH_CHECK(m_pixelSpacePointsKey.initialize());
27 
28  return StatusCode::SUCCESS;
29 }

◆ makePixelClusterContainer()

StatusCode xAODContainerMaker::makePixelClusterContainer ( const int  numClusters,
const EFTrackingDataFormats::PixelClusterAuxInput pxAux,
const EFTrackingDataFormats::Metadata meta,
const EventContext &  ctx 
) const

Create xAOD::PixelClusterContainer by creating xAOD::PixelCluster objects one by one.

Definition at line 83 of file xAODContainerMaker.cxx.

87  {
88  ATH_MSG_DEBUG("Making xAOD::PixelClusterContainer");
89 
91  m_pixelClustersKey, ctx};
92 
93  ATH_CHECK(pixelClustersHandle.record(
94  std::make_unique<xAOD::PixelClusterContainer>(),
95  std::make_unique<xAOD::PixelClusterAuxContainer>()));
96 
97  ATH_CHECK(pixelClustersHandle.isValid());
98  ATH_MSG_DEBUG("Container '" << m_pixelClustersKey << "' initialised");
99 
100  int rdoIndex_counter = 0;
101  int totListIndex_counter = 0;
102  int chargeListIndex_counter = 0;
103 
104  for (int i = 0; i < numClusters; i++) {
105  // Puch back numClusters of PixelCluster
106  auto pixelCl =
107  pixelClustersHandle->push_back(std::make_unique<xAOD::PixelCluster>());
108 
109  Eigen::Matrix<float, 2, 1> localPosition(pxAux.localPosition.at(i * 2),
110  pxAux.localPosition.at(i * 2 + 1));
111  Eigen::Matrix<float, 2, 2> localCovariance;
112  localCovariance.setZero();
113  localCovariance(0, 0) = pxAux.localCovariance.at(i * 2);
114  localCovariance(1, 1) = pxAux.localCovariance.at(i * 2 + 1);
115  Eigen::Matrix<float, 3, 1> globalPosition(
116  pxAux.globalPosition.at(i * 3), pxAux.globalPosition.at(i * 3 + 1),
117  pxAux.globalPosition.at(i * 3 + 2));
118 
119  std::vector<Identifier> RDOs;
120  RDOs.reserve(meta->pcRdoIndex[i]);
121  // Cover RDO
122  for (int j = 0; j < meta->pcRdoIndex[i]; ++j) {
123  RDOs.push_back(Identifier(pxAux.rdoList.at(rdoIndex_counter + j)));
124  }
125 
126  std::vector<int> vec_totList;
127  vec_totList.reserve(meta->pcTotIndex[i]);
128  for (int j = 0; j < meta->pcTotIndex[i]; ++j) {
129  vec_totList.push_back(pxAux.totList.at(totListIndex_counter + j));
130  }
131 
132  std::vector<float> vec_chargeList;
133  vec_chargeList.reserve(meta->pcChargeIndex[i]);
134  for (int k = 0; k < meta->pcChargeIndex[i]; ++k) {
135  vec_chargeList.push_back(pxAux.totList.at(chargeListIndex_counter + k));
136  }
137 
138  rdoIndex_counter += meta->pcRdoIndex[i];
139  totListIndex_counter += meta->pcTotIndex[i];
140  chargeListIndex_counter += meta->pcChargeIndex[i];
141 
142  pixelCl->setMeasurement<2>(pxAux.idHash.at(i), localPosition,
143  localCovariance);
144  pixelCl->setIdentifier(pxAux.id.at(i));
145  pixelCl->setRDOlist(RDOs);
146  pixelCl->globalPosition() = globalPosition;
147  pixelCl->setToTlist(vec_totList);
148  pixelCl->setTotalToT(pxAux.totalToT.at(i));
149  pixelCl->setChargelist(vec_chargeList);
150  pixelCl->setTotalCharge(pxAux.totalCharge.at(i));
151  pixelCl->setLVL1A(pxAux.lvl1a.at(i));
152  pixelCl->setChannelsInPhiEta(pxAux.channelsInPhi.at(i),
153  pxAux.channelsInEta.at(i));
154  pixelCl->setWidthInEta(pxAux.widthInEta.at(i));
155  pixelCl->setOmegas(pxAux.omegaX.at(i), pxAux.omegaY.at(i));
156  pixelCl->setIsSplit(pxAux.isSplit.at(i));
157  pixelCl->setSplitProbabilities(pxAux.splitProbability1.at(i),
158  pxAux.splitProbability2.at(i));
159  }
160  return StatusCode::SUCCESS;
161 }

◆ makePixelSpacePointContainer()

StatusCode xAODContainerMaker::makePixelSpacePointContainer ( const int  numPixelSpacePoints,
const EFTrackingDataFormats::SpacePointAuxInput psAux,
const std::vector< std::vector< const xAOD::UncalibratedMeasurement * >>  pixelsp_meas,
const EventContext &  ctx 
) const

Create xAOD::SpacePointContainer by creating xAOD::SpacePoint for Pixel SpacePoint objects one by one.

Definition at line 163 of file xAODContainerMaker.cxx.

168  {
169  ATH_MSG_DEBUG("Making xAOD::SpacePointContainer");
170 
171  SG::WriteHandle<xAOD::SpacePointContainer> pixelSpacePointsHandle{
172  m_pixelSpacePointsKey, ctx};
173 
174  ATH_CHECK(pixelSpacePointsHandle.record(
175  std::make_unique<xAOD::SpacePointContainer>(),
176  std::make_unique<xAOD::SpacePointAuxContainer>()));
177 
178  ATH_CHECK(pixelSpacePointsHandle.isValid());
179  ATH_MSG_DEBUG("Container '" << m_pixelSpacePointsKey << "' initialised");
180 
181  for (int i = 0; i < numPixelSpacePoints; i++) {
182  // Puch back numPixelSpacePoints of SpacePoint
183  auto pxsp =
184  pixelSpacePointsHandle->push_back(std::make_unique<xAOD::SpacePoint>());
185  Eigen::Matrix<float, 3, 1> globalPosition(
186  psAux.globalPosition.at(i * 3), psAux.globalPosition.at(i * 3 + 1),
187  psAux.globalPosition.at(i * 3 + 2));
188 
189  std::vector<const xAOD::UncalibratedMeasurement *> pixel_meas(
190  pixelsp_meas.at(i).size());
191  std::copy(pixelsp_meas.at(i).begin(), pixelsp_meas.at(i).end(),
192  pixel_meas.begin());
193 
194  pxsp->setSpacePoint(psAux.elementIdList.at(i), globalPosition,
195  psAux.varianceR.at(i), psAux.varianceZ.at(i),
196  pixel_meas);
197  }
198  return StatusCode::SUCCESS;
199 }

◆ makeStripClusterContainer()

StatusCode xAODContainerMaker::makeStripClusterContainer ( const int  numClusters,
const EFTrackingDataFormats::StripClusterAuxInput scAux,
const EFTrackingDataFormats::Metadata meta,
const EventContext &  ctx 
) const

Create xAOD::StripClusterContainer by creating xAOD::StripCluster objects one by one.

Definition at line 31 of file xAODContainerMaker.cxx.

35  {
36  ATH_MSG_DEBUG("Making xAOD::StripClusterContainer");
37 
39  m_stripClustersKey, ctx};
40 
41  ATH_CHECK(stripClustersHandle.record(
42  std::make_unique<xAOD::StripClusterContainer>(),
43  std::make_unique<xAOD::StripClusterAuxContainer>()));
44 
45  int rdoIndex_counter = 0;
46 
47  for (int i = 0; i < numClusters; i++) {
48  // Puch back numClusters of StripCluster
49  auto stripCl =
50  stripClustersHandle->push_back(std::make_unique<xAOD::StripCluster>());
51 
52  // Build Matrix
53  Eigen::Matrix<float, 1, 1> localPosition;
54  Eigen::Matrix<float, 1, 1> localCovariance;
55 
56  localPosition(0, 0) = scAux.localPosition.at(i);
57  localCovariance(0, 0) = scAux.localCovariance.at(i);
58 
59  Eigen::Matrix<float, 3, 1> globalPosition(
60  scAux.globalPosition.at(i * 3), scAux.globalPosition.at(i * 3 + 1),
61  scAux.globalPosition.at(i * 3 + 2));
62 
63  std::vector<Identifier> RDOs;
64  RDOs.reserve(meta->scRdoIndex[i]);
65  // Cover RDO
66  for (int j = 0; j < meta->scRdoIndex[i]; ++j) {
67  RDOs.push_back(Identifier(scAux.rdoList.at(rdoIndex_counter + j)));
68  }
69 
70  rdoIndex_counter += meta->scRdoIndex[i];
71 
72  stripCl->setMeasurement<1>(scAux.idHash.at(i), localPosition,
73  localCovariance);
74  stripCl->setIdentifier(scAux.id.at(i));
75  stripCl->setRDOlist(RDOs);
76  stripCl->globalPosition() = globalPosition;
77  stripCl->setChannelsInPhi(scAux.channelsInPhi.at(i));
78  }
79 
80  return StatusCode::SUCCESS;
81 }

◆ makeStripSpacePointContainer()

StatusCode xAODContainerMaker::makeStripSpacePointContainer ( const int  numStripSpacePoints,
const EFTrackingDataFormats::SpacePointAuxInput sspAux,
const std::vector< std::vector< const xAOD::UncalibratedMeasurement * >>  stripsp_meas,
const EventContext &  ctx 
) const

Create xAOD::SpacePointContainer by creating xAOD::SpacePoint for Strip SpacePoint objects one by one.

Definition at line 201 of file xAODContainerMaker.cxx.

206  {
207  ATH_MSG_DEBUG("Making xAOD::SpacePointContainer");
208 
209  SG::WriteHandle<xAOD::SpacePointContainer> stripSpacePointsHandle{
210  m_stripSpacePointsKey, ctx};
211 
212  ATH_CHECK(stripSpacePointsHandle.record(
213  std::make_unique<xAOD::SpacePointContainer>(),
214  std::make_unique<xAOD::SpacePointAuxContainer>()));
215 
216  ATH_CHECK(stripSpacePointsHandle.isValid());
217  ATH_MSG_DEBUG("Container '" << m_stripSpacePointsKey << "' initialised");
218 
219  for (int i = 0; i < numStripSpacePoints; i++) {
220  // Puch back numStripSpacePoints of SpacePoint
221  auto ssp =
222  stripSpacePointsHandle->push_back(std::make_unique<xAOD::SpacePoint>());
223 
224  Eigen::Matrix<float, 3, 1> globalPosition(
225  sspAux.globalPosition.at(i * 3), sspAux.globalPosition.at(i * 3 + 1),
226  sspAux.globalPosition.at(i * 3 + 2));
227 
228  std::vector<const xAOD::UncalibratedMeasurement *> strip_meas(
229  stripsp_meas.at(i).size());
230  std::copy(stripsp_meas.at(i).begin(), stripsp_meas.at(i).end(),
231  strip_meas.begin());
232 
233  float topHalfStripLength = sspAux.topHalfStripLength.at(i);
234  float bottomHalfStripLength = sspAux.bottomHalfStripLength.at(i);
235  Eigen::Matrix<float, 3, 1> topStripDirection(
236  sspAux.topStripDirection.at(i * 3),
237  sspAux.topStripDirection.at(i * 3 + 1),
238  sspAux.topStripDirection.at(i * 3 + 2));
239  Eigen::Matrix<float, 3, 1> bottomStripDirection(
240  sspAux.bottomStripDirection.at(i * 3),
241  sspAux.bottomStripDirection.at(i * 3 + 1),
242  sspAux.bottomStripDirection.at(i * 3 + 2));
243  Eigen::Matrix<float, 3, 1> stripCenterDistance(
244  sspAux.topStripCenter.at(i * 3), sspAux.topStripCenter.at(i * 3 + 1),
245  sspAux.topStripCenter.at(i * 3 + 2));
246  Eigen::Matrix<float, 3, 1> topStripCenter(
247  sspAux.topStripCenter.at(i * 3), sspAux.topStripCenter.at(i * 3 + 1),
248  sspAux.topStripCenter.at(i * 3 + 2));
249  ssp->setSpacePoint(
250  {sspAux.elementIdList.at(i), sspAux.elementIdList.at(i + 1)},
251  globalPosition, sspAux.varianceR.at(i), sspAux.varianceZ.at(i),
252  strip_meas, topHalfStripLength, bottomHalfStripLength,
253  topStripDirection, bottomStripDirection, stripCenterDistance,
254  topStripCenter);
255  }
256  return StatusCode::SUCCESS;
257 }

Member Data Documentation

◆ m_pixelClustersKey

SG::WriteHandleKey<xAOD::PixelClusterContainer> xAODContainerMaker::m_pixelClustersKey
private
Initial value:
{
this, "OutputPixelName", "fpgaPixelClusters",
"Output container name"}

Key for the pixel cluster container.

Definition at line 74 of file xAODContainerMaker.h.

◆ m_pixelSpacePointsKey

SG::WriteHandleKey<xAOD::SpacePointContainer> xAODContainerMaker::m_pixelSpacePointsKey
private
Initial value:
{
this, "OutputPixelSpacePointName", "fpgaPixelSpacePoints",
"Output container name"}

Key for the Pixel SpacePoint container.

Definition at line 80 of file xAODContainerMaker.h.

◆ m_stripClustersKey

SG::WriteHandleKey<xAOD::StripClusterContainer> xAODContainerMaker::m_stripClustersKey
private
Initial value:
{
this, "OutputStripName", "fpgaStripClusters",
"Output container name"}

Key for the strip cluster container.

Definition at line 77 of file xAODContainerMaker.h.

◆ m_stripSpacePointsKey

SG::WriteHandleKey<xAOD::SpacePointContainer> xAODContainerMaker::m_stripSpacePointsKey
private
Initial value:
{
this, "OutputStripSpacePointName", "fpgaStripSpacePoints",
"Output container name"}

Key for the Strip SpacePoint container.

Definition at line 83 of file xAODContainerMaker.h.


The documentation for this class was generated from the following files:
EFTrackingDataFormats::PixelClusterAuxInput::localCovariance
std::vector< float > localCovariance
Definition: EFTrackingDataFormats.h:204
EFTrackingDataFormats::StripClusterAuxInput::localPosition
std::vector< float > localPosition
Definition: EFTrackingDataFormats.h:187
EFTrackingDataFormats::StripClusterAuxInput::globalPosition
std::vector< float > globalPosition
Definition: EFTrackingDataFormats.h:191
EFTrackingDataFormats::SpacePointAuxInput::varianceR
std::vector< float > varianceR
Definition: EFTrackingDataFormats.h:233
EFTrackingDataFormats::Metadata::pcChargeIndex
int pcChargeIndex[1000]
Definition: EFTrackingDataFormats.h:110
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
EFTrackingDataFormats::SpacePointAuxInput::varianceZ
std::vector< float > varianceZ
Definition: EFTrackingDataFormats.h:234
EFTrackingDataFormats::PixelClusterAuxInput::localPosition
std::vector< float > localPosition
Definition: EFTrackingDataFormats.h:203
EFTrackingDataFormats::PixelClusterAuxInput::idHash
std::vector< unsigned int > idHash
Definition: EFTrackingDataFormats.h:202
EFTrackingDataFormats::PixelClusterAuxInput::totalCharge
std::vector< float > totalCharge
Definition: EFTrackingDataFormats.h:215
EFTrackingDataFormats::PixelClusterAuxInput::splitProbability2
std::vector< float > splitProbability2
Definition: EFTrackingDataFormats.h:219
EFTrackingDataFormats::StripClusterAuxInput::localCovariance
std::vector< float > localCovariance
Definition: EFTrackingDataFormats.h:188
EFTrackingDataFormats::SpacePointAuxInput::topHalfStripLength
std::vector< float > topHalfStripLength
Definition: EFTrackingDataFormats.h:235
xAODContainerMaker::m_stripSpacePointsKey
SG::WriteHandleKey< xAOD::SpacePointContainer > m_stripSpacePointsKey
Key for the Strip SpacePoint container.
Definition: xAODContainerMaker.h:83
EFTrackingDataFormats::PixelClusterAuxInput::channelsInPhi
std::vector< int > channelsInPhi
Definition: EFTrackingDataFormats.h:207
xAODContainerMaker::m_pixelSpacePointsKey
SG::WriteHandleKey< xAOD::SpacePointContainer > m_pixelSpacePointsKey
Key for the Pixel SpacePoint container.
Definition: xAODContainerMaker.h:80
EFTrackingDataFormats::Metadata::pcTotIndex
int pcTotIndex[1000]
Definition: EFTrackingDataFormats.h:109
EFTrackingDataFormats::PixelClusterAuxInput::isSplit
std::vector< char > isSplit
Definition: EFTrackingDataFormats.h:217
xAODContainerMaker::m_stripClustersKey
SG::WriteHandleKey< xAOD::StripClusterContainer > m_stripClustersKey
Key for the strip cluster container.
Definition: xAODContainerMaker.h:77
EFTrackingDataFormats::StripClusterAuxInput::id
std::vector< long unsigned int > id
Definition: EFTrackingDataFormats.h:190
EFTrackingDataFormats::PixelClusterAuxInput::globalPosition
std::vector< float > globalPosition
Definition: EFTrackingDataFormats.h:205
EFTrackingDataFormats::PixelClusterAuxInput::rdoList
std::vector< unsigned long long > rdoList
Definition: EFTrackingDataFormats.h:206
EFTrackingDataFormats::PixelClusterAuxInput::omegaY
std::vector< float > omegaY
Definition: EFTrackingDataFormats.h:211
EFTrackingDataFormats::PixelClusterAuxInput::omegaX
std::vector< float > omegaX
Definition: EFTrackingDataFormats.h:210
lumiFormat.i
int i
Definition: lumiFormat.py:85
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
EFTrackingDataFormats::SpacePointAuxInput::bottomHalfStripLength
std::vector< float > bottomHalfStripLength
Definition: EFTrackingDataFormats.h:236
EFTrackingDataFormats::SpacePointAuxInput::globalPosition
std::vector< float > globalPosition
Definition: EFTrackingDataFormats.h:231
EFTrackingDataFormats::Metadata::pcRdoIndex
int pcRdoIndex[1000]
Definition: EFTrackingDataFormats.h:108
EFTrackingDataFormats::PixelClusterAuxInput::channelsInEta
std::vector< int > channelsInEta
Definition: EFTrackingDataFormats.h:208
EFTrackingDataFormats::StripClusterAuxInput::rdoList
std::vector< unsigned long long > rdoList
Definition: EFTrackingDataFormats.h:192
EFTrackingDataFormats::PixelClusterAuxInput::totList
std::vector< int > totList
Definition: EFTrackingDataFormats.h:212
EFTrackingDataFormats::SpacePointAuxInput::topStripCenter
std::vector< float > topStripCenter
Definition: EFTrackingDataFormats.h:240
EFTrackingDataFormats::Metadata::scRdoIndex
int scRdoIndex[1000]
Definition: EFTrackingDataFormats.h:107
EFTrackingDataFormats::PixelClusterAuxInput::id
std::vector< long unsigned int > id
Definition: EFTrackingDataFormats.h:201
EFTrackingDataFormats::PixelClusterAuxInput::lvl1a
std::vector< int > lvl1a
Definition: EFTrackingDataFormats.h:220
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
EFTrackingDataFormats::SpacePointAuxInput::bottomStripDirection
std::vector< float > bottomStripDirection
Definition: EFTrackingDataFormats.h:238
EFTrackingDataFormats::StripClusterAuxInput::channelsInPhi
std::vector< int > channelsInPhi
Definition: EFTrackingDataFormats.h:193
EFTrackingDataFormats::SpacePointAuxInput::elementIdList
std::vector< unsigned int > elementIdList
Definition: EFTrackingDataFormats.h:230
EFTrackingDataFormats::PixelClusterAuxInput::splitProbability1
std::vector< float > splitProbability1
Definition: EFTrackingDataFormats.h:218
xAODContainerMaker::m_pixelClustersKey
SG::WriteHandleKey< xAOD::PixelClusterContainer > m_pixelClustersKey
Key for the pixel cluster container.
Definition: xAODContainerMaker.h:74
EFTrackingDataFormats::PixelClusterAuxInput::widthInEta
std::vector< float > widthInEta
Definition: EFTrackingDataFormats.h:209
calibdata.copy
bool copy
Definition: calibdata.py:27
EFTrackingDataFormats::PixelClusterAuxInput::totalToT
std::vector< int > totalToT
Definition: EFTrackingDataFormats.h:213
EFTrackingDataFormats::StripClusterAuxInput::idHash
std::vector< unsigned int > idHash
Definition: EFTrackingDataFormats.h:189
fitman.k
k
Definition: fitman.py:528
EFTrackingDataFormats::SpacePointAuxInput::topStripDirection
std::vector< float > topStripDirection
Definition: EFTrackingDataFormats.h:237
Identifier
Definition: IdentifierFieldParser.cxx:14