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 EFTrackingDataFormats::StripClusterAuxInput &scAux, const EFTrackingDataFormats::Metadata *metadata, const EventContext &ctx) const
 Create xAOD::StripClusterContainer by creating xAOD::StripCluster objects one by one. More...
 
StatusCode makePixelClusterContainer (const EFTrackingDataFormats::PixelClusterAuxInput &pxAux, const EFTrackingDataFormats::Metadata *metadata, const EventContext &ctx) const
 Create xAOD::PixelClusterContainer by creating xAOD::PixelCluster objects one by one. More...
 
StatusCode makePixelSpacePointContainer (const EFTrackingDataFormats::SpacePointAuxInput &psAux, const std::vector< std::vector< const xAOD::UncalibratedMeasurement * >> pixelsp_meas, const EFTrackingDataFormats::Metadata *metadata, const EventContext &ctx) const
 Create xAOD::SpacePointContainer by creating xAOD::SpacePoint for Pixel SpacePoint objects one by one. More...
 
StatusCode makeStripSpacePointContainer (const EFTrackingDataFormats::SpacePointAuxInput &sspAux, const std::vector< std::vector< const xAOD::UncalibratedMeasurement * >> stripsp_meas, const EFTrackingDataFormats::Metadata *metadata, 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 EFTrackingDataFormats::PixelClusterAuxInput pxAux,
const EFTrackingDataFormats::Metadata metadata,
const EventContext &  ctx 
) const

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

Definition at line 82 of file xAODContainerMaker.cxx.

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

◆ makePixelSpacePointContainer()

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

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

Definition at line 161 of file xAODContainerMaker.cxx.

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

◆ makeStripClusterContainer()

StatusCode xAODContainerMaker::makeStripClusterContainer ( const EFTrackingDataFormats::StripClusterAuxInput scAux,
const EFTrackingDataFormats::Metadata metadata,
const EventContext &  ctx 
) const

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

Definition at line 31 of file xAODContainerMaker.cxx.

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

◆ makeStripSpacePointContainer()

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

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

Definition at line 199 of file xAODContainerMaker.cxx.

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

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 73 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 79 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 76 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 82 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
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:82
python.checkMetadata.metadata
metadata
Definition: checkMetadata.py:175
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:79
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:76
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::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::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:73
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