ATLAS Offline Software
Loading...
Searching...
No Matches
SCT_PrepDataToxAOD.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
6// SCT_PrepDataToxAOD.cxx
7// Implementation file for class SCT_PrepDataToxAOD
9
10#include "SCT_PrepDataToxAOD.h"
11
12#include "Identifier/Identifier.h"
15#include "InDetSimEvent/SiHit.h"
19
21
22#include "CLHEP/Geometry/Point3D.h"
23
24#include <cmath>
25
26#define AUXDATA(OBJ, TYP, NAME) \
27 static const SG::AuxElement::Accessor<TYP> acc_##NAME (#NAME); acc_##NAME(*(OBJ))
28
30//
31// Constructor with parameters:
32//
34SCT_PrepDataToxAOD::SCT_PrepDataToxAOD(const std::string& name, ISvcLocator* pSvcLocator) :
35 AthReentrantAlgorithm(name, pSvcLocator)
36{
37}
38
40//
41// Initialize method:
42//
45{
46 ATH_CHECK(detStore()->retrieve(m_SCTHelper, "SCT_ID"));
47
48 //make sure we don't write what we don't have
49 if (not m_useTruthInfo) {
50 m_writeSDOs.set(false);
51 m_writeSiHits.set(false);
52 }
53
54 ATH_CHECK(m_clustercontainer.initialize());
59 ATH_CHECK(m_xAodContainer.initialize());
60 ATH_CHECK(m_xAodOffset.initialize());
62
63 ATH_CHECK(m_SCTDetEleCollKey.initialize());
64
65 return StatusCode::SUCCESS;
66}
67
69//
70// Execute method:
71//
73StatusCode SCT_PrepDataToxAOD::execute(const EventContext& ctx) const
74{
75 // the cluster ambiguity map
76 std::map<Identifier, const SCT_RDORawData*> idToRAWDataMap;
79 if (rdoContainer.isValid()) {
80 // get all the RIO_Collections in the container
81 for (const auto collection: *rdoContainer) {
82 //get all the RDOs in the collection
83 for (const auto rdo : *collection) {
84 if (rdo==nullptr) {
85 ATH_MSG_WARNING("Null SCT RDO. Skipping it");
86 continue;
87 }
88 Identifier rdoId{rdo->identify()};
89 idToRAWDataMap.insert(std::pair<Identifier, const SCT_RDORawData*>{rdoId, rdo});
90 } // collection
91 } // Have container;
92 } else if (m_firstEventWarnings) {
93 ATH_MSG_WARNING("Failed to retrieve SCT RDO container");
94 }
95 }
96 ATH_MSG_DEBUG("Size of RDO map is " << idToRAWDataMap.size());
97
98 const PRD_MultiTruthCollection* prdmtColl{nullptr};
99 const xAODTruthParticleLinkVector *truth_particle_links{nullptr};
100 if (m_useTruthInfo) {
102 if (prdmtCollHandle.isValid()) {
103 prdmtColl = &*prdmtCollHandle;
104 }
105 if (!m_truthParticleLinks.empty()) {
107 if (truthParticleLinksHandle.isValid()) {
108 truth_particle_links = truthParticleLinksHandle.cptr();
109 }
110 }
111 }
112
113 const InDetSimDataCollection* sdoCollection{nullptr};
114 if (m_writeSDOs) {
116 if (sdoCollectionHandle.isValid()) {
117 sdoCollection = &*sdoCollectionHandle;
118 }
119 }
120
121 std::vector<std::vector<const SiHit*>> siHits(m_SCTHelper->wafer_hash_max());
122 if (m_writeSiHits) {
124 if (sihitCollection.isValid()) {
125 for (const SiHit& siHit: *sihitCollection) {
126 // Check if it is an SCT hit
127 if (not siHit.isSCT()) continue;
128
129 Identifier wafer_id{m_SCTHelper->wafer_id(siHit.getBarrelEndcap(),
130 siHit.getLayerDisk(),
131 siHit.getPhiModule(),
132 siHit.getEtaModule(),
133 siHit.getSide())};
134 IdentifierHash wafer_hash{m_SCTHelper->wafer_hash(wafer_id)};
135 siHits[wafer_hash].push_back(&siHit);
136 }
137 }
138 }
139
140 // Mandatory. This is needed and required if this algorithm is scheduled.
142 if (not sctClusterContainer.isValid()) {
143 ATH_MSG_FATAL("Cannot retrieve SCT PrepDataContainer " << m_clustercontainer.key());
144 return StatusCode::FAILURE;
145 }
146
147 // Create the xAOD container and its auxiliary store:
149 ATH_CHECK(xaod.record(std::make_unique<xAOD::TrackMeasurementValidationContainer>(),
150 std::make_unique<xAOD::TrackMeasurementValidationAuxContainer>()));
151
153 ATH_CHECK(offsets.record(std::make_unique<std::vector<unsigned int>>(m_SCTHelper->wafer_hash_max(), 0)));
154
155 unsigned int have_truth_link=0u;
156 unsigned int missing_truth_particle=0u;
157 unsigned int missing_parent_particle=0u;
158 // Loop over the container
159 unsigned int counter{0};
160 for (const auto clusterCollection: *sctClusterContainer) {
161 //Fill Offset container
162 (*offsets)[clusterCollection->identifyHash()] = counter;
163
164 // skip empty collections
165 if (clusterCollection->empty()) continue;
166
167 xaod->resize(counter + clusterCollection->size());
168 // loop over collection and convert to xAOD
169 for (const InDet::SCT_Cluster* prd: *clusterCollection) {
170 Identifier clusterId{prd->identify()};
171 if (not clusterId.is_valid()) {
172 ATH_MSG_WARNING("SCT cluster identifier is not valid!");
173 }
174
175 // create and add xAOD object
177 xaod->at(counter) = xprd;
178 ++counter;
179
180 //Set Identifier
181 xprd->setIdentifier(clusterId.get_compact());
182
183 //Set Global Position
184 Amg::Vector3D gpos{prd->globalPosition()};
185 xprd->setGlobalPosition(gpos.x(), gpos.y(), gpos.z());
186
187 //Set Local Position
188 const Amg::Vector2D& locpos{prd->localPosition()};
189 float locY{0.};
190 float locX{static_cast<float>(locpos.x())};
191 if ((not std::isinf(locpos.y()) or std::isnan(locpos.y()))) {
192 if (locpos.y()>=1e-07) locY = locpos.y();
193 } else {
194 locY = -9999.;
195 }
196
197 // Set local error matrix
198 xprd->setLocalPosition(locX, locY);
199
200 const Amg::MatrixX& localCov{prd->localCovariance()};
201 if (localCov.size() == 1) {
202 xprd->setLocalPositionError(localCov(0, 0), 0., 0.);
203 } else if (localCov.size() == 4) {
204 xprd->setLocalPositionError(localCov(0, 0), localCov(1, 1), localCov(0, 1));
205 } else {
206 xprd->setLocalPositionError(0., 0., 0.);
207 }
208
209 // Set vector of hit identifiers
210 std::vector<uint64_t> rdoIdentifierList;
211 rdoIdentifierList.reserve(prd->rdoList().size());
212 for (const auto& hitIdentifier: prd->rdoList()) {
213 rdoIdentifierList.push_back(hitIdentifier.get_compact());
214 }
215 xprd->setRdoIdentifierList(rdoIdentifierList);
216
217 //Add SCT specific information
218 const InDet::SiWidth cw{prd->width()};
219 AUXDATA(xprd, int, SiWidth) = static_cast<int>(cw.colRow()[0]);
220 AUXDATA(xprd, int, hitsInThirdTimeBin) = static_cast<int>(prd->hitsInThirdTimeBin());
221
222 AUXDATA(xprd, int, bec) = m_SCTHelper->barrel_ec(clusterId);
223 AUXDATA(xprd, int, layer) = m_SCTHelper->layer_disk(clusterId);
224 AUXDATA(xprd, int, phi_module) = m_SCTHelper->phi_module(clusterId);
225 AUXDATA(xprd, int, eta_module) = m_SCTHelper->eta_module(clusterId);
226 AUXDATA(xprd, int, side) = m_SCTHelper->side(clusterId);
227
228 // Add the Detector element ID -- not sure if needed as we have the informations above
229 const InDetDD::SiDetectorElement* de{prd->detectorElement()};
230 uint64_t detElementId{0};
231 if (de) {
232 Identifier detId{de->identify()};
233 if (detId.is_valid()) {
234 detElementId = detId.get_compact();
235 }
236 }
237 AUXDATA(xprd, uint64_t, detectorElementID) = detElementId;
238
239 //Add details about the individual hits
241 addRDOInformation(xprd, prd, idToRAWDataMap);
242 }
243
244 // Use the MultiTruth Collection to get a list of all true particle contributing to the cluster
245 if (m_useTruthInfo) {
246 if (prdmtColl) {
247 auto range{prdmtColl->equal_range(clusterId)};
248 if (truth_particle_links) {
249 std::vector<unsigned int> tp_indices;
250 for (auto i{range.first}; i!=range.second; ++i) {
251 ElementLink<xAOD::TruthParticleContainer> a_truth_particle_link = truth_particle_links->find(i->second);
252 if (a_truth_particle_link) {
253 const xAOD::TruthParticle *truth_particle = *a_truth_particle_link;
254 if (truth_particle) {
255 ++have_truth_link;
256 tp_indices.push_back(static_cast<int>(truth_particle->index()));
257 }
258 else {
259 ++missing_parent_particle;
260 }
261 }
262 else {
263 tp_indices.push_back(std::numeric_limits<unsigned int>::max());
264 ++missing_truth_particle;
265 }
266 }
267 // @TODO provide possibility to move tp_indices to its final destination
268 AUXDATA(xprd, std::vector<unsigned int>, truth_index) = tp_indices;
269 }
270 std::vector<int> uniqueIDs;
271 for (auto& i{range.first}; i!=range.second; ++i) {
272 uniqueIDs.push_back(HepMC::uniqueID(i->second));
273 }
274 // @TODO move vector
275 AUXDATA(xprd, std::vector<int>, truth_barcode) = uniqueIDs; // TODO rename variable to be consistent?
276 }
277 }
278
279 // Use the SDO Collection to get a list of all true particle contributing to the cluster per readout element
280 // Also get the energy deposited by each true particle per readout element
281 if (m_writeSDOs) {
282 if (sdoCollection) {
283 addSDOInformation(xprd, prd, sdoCollection);
284 }
285 }
286
287 // Now Get the most detailed truth from the SiHits
288 // Note that this could get really slow if there are a lot of hits and clusters
289 if (m_writeSiHits) {
290 addSiHitInformation(xprd, prd, &siHits[prd->detectorElement()->identifyHash()]);
291 }
292 }
293 }
294 ATH_MSG_DEBUG(" recorded SCT_PrepData objects: size " << xaod->size());
295
296 m_haveTruthLink += have_truth_link;
297 m_missingTruthParticle += missing_truth_particle;
298 m_missingParentParticle += missing_parent_particle;
299 m_firstEventWarnings = false; //disable one-time warnings
300
301 return StatusCode::SUCCESS;
302}
303
305 const InDet::SCT_Cluster* prd,
306 const InDetSimDataCollection* sdoCollection) const
307{
308 std::vector<int> sdo_word;
309 std::vector<std::vector<int>> sdo_depositsUniqueID;
310 std::vector<std::vector<float>> sdo_depositsEnergy;
311 // find hit
312 for (const auto& hitIdentifier: prd->rdoList()) {
313 auto pos{sdoCollection->find(hitIdentifier)};
314 if (pos == sdoCollection->end()) continue;
315 sdo_word.push_back(pos->second.word());
316 std::vector<int> sdoDepUniqueID(pos->second.getdeposits().size(), HepMC::INVALID_PARTICLE_ID);
317 std::vector<float> sdoDepEnergy(pos->second.getdeposits().size());
318 unsigned int nDepos{0};
319 for (auto& deposit: pos->second.getdeposits()) {
320 if (deposit.first) sdoDepUniqueID[nDepos] = HepMC::uniqueID(deposit.first);
321 ATH_MSG_DEBUG(" SDO Energy Deposit " << deposit.second);
322 sdoDepEnergy[nDepos] = deposit.second;
323 nDepos++;
324 }
325 sdo_depositsUniqueID.push_back(sdoDepUniqueID);
326 sdo_depositsEnergy.push_back(sdoDepEnergy);
327 }
328 AUXDATA(xprd, std::vector<int>, sdo_words) = sdo_word;
329 AUXDATA(xprd, std::vector<std::vector<int>>, sdo_depositsBarcode) = sdo_depositsUniqueID; // TODO rename variable to be consistent?
330 AUXDATA(xprd, std::vector<std::vector<float>>, sdo_depositsEnergy) = sdo_depositsEnergy;
331}
332
333
335 const InDet::SCT_Cluster* prd,
336 const std::vector<const SiHit*>* siHits) const
337{
338 std::vector<SiHit> matchingHits;
339 findAllHitsCompatibleWithCluster(prd, siHits, matchingHits);
340
341 long unsigned int numHits{matchingHits.size()};
342
343 std::vector<float> sihit_energyDeposit(numHits, 0.);
344 std::vector<float> sihit_meanTime(numHits, 0.);
345 std::vector<int> sihit_uniqueID(numHits, HepMC::UNDEFINED_ID);
346
347 std::vector<float> sihit_startPosX(numHits, 0.);
348 std::vector<float> sihit_startPosY(numHits, 0.);
349 std::vector<float> sihit_startPosZ(numHits, 0.);
350
351 std::vector<float> sihit_endPosX(numHits, 0);
352 std::vector<float> sihit_endPosY(numHits, 0);
353 std::vector<float> sihit_endPosZ(numHits, 0);
354
355 int hitNumber{0};
357 if (de) {
358 for (const SiHit& sihit : matchingHits) {
359 sihit_energyDeposit[hitNumber] = sihit.energyLoss();
360 sihit_meanTime[hitNumber] = sihit.meanTime();
361 sihit_uniqueID[hitNumber] = HepMC::uniqueID(sihit.particleLink());
362
363 // Convert Simulation frame into reco frame
364 const HepGeom::Point3D<double>& startPos{sihit.localStartPosition()};
365
366 Amg::Vector2D pos{de->hitLocalToLocal(startPos.z(), startPos.y())};
367 sihit_startPosX[hitNumber] = pos[0];
368 sihit_startPosY[hitNumber] = pos[1];
369 sihit_startPosZ[hitNumber] = startPos.x();
370
371 const HepGeom::Point3D<double>& endPos{sihit.localEndPosition()};
372 pos= de->hitLocalToLocal(endPos.z(), endPos.y());
373 sihit_endPosX[hitNumber] = pos[0];
374 sihit_endPosY[hitNumber] = pos[1];
375 sihit_endPosZ[hitNumber] = endPos.x();
376 ++hitNumber;
377 }
378 }
379
380 AUXDATA(xprd, std::vector<float>, sihit_energyDeposit) = sihit_energyDeposit;
381 AUXDATA(xprd, std::vector<float>, sihit_meanTime) = sihit_meanTime;
382 AUXDATA(xprd, std::vector<int>, sihit_barcode) = sihit_uniqueID; // TODO rename variable to be consistent?
383
384 AUXDATA(xprd, std::vector<float>, sihit_startPosX) = sihit_startPosX;
385 AUXDATA(xprd, std::vector<float>, sihit_startPosY) = sihit_startPosY;
386 AUXDATA(xprd, std::vector<float>, sihit_startPosZ) = sihit_startPosZ;
387
388 AUXDATA(xprd, std::vector<float>, sihit_endPosX) = sihit_endPosX;
389 AUXDATA(xprd, std::vector<float>, sihit_endPosY) = sihit_endPosY;
390 AUXDATA(xprd, std::vector<float>, sihit_endPosZ) = sihit_endPosZ;
391}
392
394 const std::vector<const SiHit*>* siHits,
395 std::vector<SiHit>& matchingHits) const
396{
397 ATH_MSG_VERBOSE("Got " << siHits->size() << " SiHits to look through");
398
399 // Check if we have detector element -- needed to find the local position of the SiHits
401 if (de==nullptr) return;
402
403 std::vector<const SiHit*> multiMatchingHits;
404
405 for (const SiHit* siHit: *siHits) {
406 // Now we have all hits in the module that match lets check to see if they match the cluster
407 // Must be within +/- 1 hits of any hit in the cluster to be included
408
409 HepGeom::Point3D<double> averagePosition{siHit->localStartPosition() + siHit->localEndPosition()};
410 averagePosition *= 0.5;
411 Amg::Vector2D pos{de->hitLocalToLocal(averagePosition.z(), averagePosition.y())};
412 InDetDD::SiCellId diode{de->cellIdOfPosition(pos)};
413
414 for (const auto& hitIdentifier: prd->rdoList()) {
415 ATH_MSG_DEBUG("Truth Strip " << diode.phiIndex() << " Cluster Strip " << m_SCTHelper->strip(hitIdentifier));
416
417 if (std::abs(static_cast<int>(diode.phiIndex()) - m_SCTHelper->strip(hitIdentifier))<=1) {
418 multiMatchingHits.push_back(siHit);
419 break;
420 }
421 }
422 }
423
424 matchingHits.reserve(multiMatchingHits.size());
425 //Now we will now make 1 SiHit for each true particle if the SiHits "touch" other
426 std::vector<const SiHit*>::iterator siHitIter{multiMatchingHits.begin()};
427 std::vector<const SiHit*>::iterator siHitIter2{multiMatchingHits.begin()};
428 ATH_MSG_DEBUG("Found " << multiMatchingHits.size() << " SiHit ");
429 for (; siHitIter != multiMatchingHits.end(); ++siHitIter) {
430 const SiHit* lowestXPos{*siHitIter};
431 const SiHit* highestXPos{*siHitIter};
432
433 // We will merge these hits
434 std::vector<const SiHit*> ajoiningHits;
435 ajoiningHits.push_back(*siHitIter);
436
437 siHitIter2 = siHitIter+1;
438 auto uniqueID = HepMC::uniqueID((*siHitIter)->particleLink());
439 while (siHitIter2 != multiMatchingHits.end()) {
440 // Need to come from the same truth particle
441 if ( uniqueID != HepMC::uniqueID((*siHitIter2)->particleLink())) {
442 ++siHitIter2;
443 continue;
444 }
445
446 constexpr double maxDiff = 0.00005;
447 // Check to see if the SiHits are compatible with each other.
448 if (std::abs((highestXPos->localEndPosition().x()-(*siHitIter2)->localStartPosition().x()))<maxDiff and
449 std::abs((highestXPos->localEndPosition().y()-(*siHitIter2)->localStartPosition().y()))<maxDiff and
450 std::abs((highestXPos->localEndPosition().z()-(*siHitIter2)->localStartPosition().z()))<maxDiff) {
451 highestXPos = *siHitIter2;
452 ajoiningHits.push_back(*siHitIter2);
453 // Dont use hit more than once
454 siHitIter2 = multiMatchingHits.erase(siHitIter2);
455 } else if (std::abs((lowestXPos->localStartPosition().x()-(*siHitIter2)->localEndPosition().x()))<maxDiff and
456 std::abs((lowestXPos->localStartPosition().y()-(*siHitIter2)->localEndPosition().y()))<maxDiff and
457 std::abs((lowestXPos->localStartPosition().z()-(*siHitIter2)->localEndPosition().z()))<maxDiff) {
458 lowestXPos = *siHitIter2;
459 ajoiningHits.push_back(*siHitIter2);
460 // Dont use hit more than once
461 siHitIter2 = multiMatchingHits.erase(siHitIter2);
462 } else {
463 ++siHitIter2;
464 }
465 }
466
467 if (ajoiningHits.size()==0) {
468 ATH_MSG_ERROR("This should really never happen");
469 continue;
470 } else if (ajoiningHits.size()==1) {
471 // Copy Si Hit ready to return
472 matchingHits.emplace_back(*ajoiningHits[0]);
473 continue;
474 } else {
475 // Build new SiHit and merge information together.
476 ATH_MSG_DEBUG("Merging " << ajoiningHits.size() << " SiHits together.");
477 float energyDep{0.};
478 float time{0.};
479 for (auto& siHit: ajoiningHits) {
480 energyDep += siHit->energyLoss();
481 time += siHit->meanTime();
482 }
483 time /= static_cast<float>(ajoiningHits.size());
484 matchingHits.emplace_back(lowestXPos->localStartPosition(),
485 highestXPos->localEndPosition(),
486 energyDep,
487 time,
488 (*siHitIter)->particleLink(),
489 1, // 0 for pixel 1 for SCT
490 (*siHitIter)->getBarrelEndcap(),
491 (*siHitIter)->getLayerDisk(),
492 (*siHitIter)->getEtaModule(),
493 (*siHitIter)->getPhiModule(),
494 (*siHitIter)->getSide());
495 }
496 }
497}
498
500 const InDet::SCT_Cluster* prd,
501 const std::map<Identifier, const SCT_RDORawData*>& idToRAWDataMap) const {
502 std::vector<int> strip(prd->rdoList().size(), -1);
503 std::vector<int> timebin(prd->rdoList().size(), -1);
504 std::vector<int> groupsize(prd->rdoList().size(), -1);
505
506 unsigned int nRDOs{0};
507 for (const auto& hitIdentifier: prd->rdoList()) {
508 auto result{idToRAWDataMap.find(hitIdentifier)};
509 if (result != idToRAWDataMap.end()) {
510 const SCT_RDORawData* sctRdo{result->second};
511 strip[nRDOs] = m_SCTHelper->strip(sctRdo->identify());
512 const SCT3_RawData* rdo3{dynamic_cast<const SCT3_RawData*>(sctRdo)};
513 if (rdo3) {
514 timebin[nRDOs] = rdo3->getTimeBin();
515 groupsize[nRDOs] = rdo3->getGroupSize();
516 }
517 }
518 nRDOs++;
519 }
520
521 AUXDATA(xprd, std::vector<int>, rdo_strip) = strip;
522 AUXDATA(xprd, std::vector<int>, rdo_timebin) = timebin;
523 AUXDATA(xprd, std::vector<int>, rdo_groupsize) = groupsize;
524}
525
527//
528// Finalize method:
529//
532{
533 if (m_useTruthInfo && !m_truthParticleLinks.empty()) {
534 ATH_MSG_INFO("Missing truth particles " << m_missingTruthParticle << " missing parent: " << m_missingParentParticle
535 << " have " << m_haveTruthLink);
536 }
537 return StatusCode::SUCCESS;
538}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_FATAL(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
#define AUXDATA(OBJ, TYP, NAME)
This is an Identifier helper class for the SCT subdetector.
Handle class for reading from StoreGate.
Handle class for recording to StoreGate.
const ServiceHandle< StoreGateSvc > & detStore() const
An algorithm that can be simultaneously executed in multiple threads.
This is a "hash" representation of an Identifier.
bool is_valid() const
Check if id is in a valid state.
value_type get_compact() const
Get the compact id.
Identifier for the strip or pixel cell.
Definition SiCellId.h:29
int phiIndex() const
Get phi index. Equivalent to strip().
Definition SiCellId.h:122
Class to hold geometrical description of a silicon detector element.
SiCellId cellIdOfPosition(const Amg::Vector2D &localPos) const
As in previous method but returns SiCellId.
virtual Identifier identify() const override final
identifier of this detector element (inline)
Amg::Vector2D hitLocalToLocal(double xEta, double xPhi) const
Simulation/Hit local frame to reconstruction local frame.
virtual Identifier identify() const override final
virtual const InDetDD::SiDetectorElement * detectorElement() const override final
return the detector element corresponding to this PRD The pointer will be zero if the det el is not d...
const Amg::Vector2D & colRow() const
Definition SiWidth.h:115
A PRD is mapped onto all contributing particles.
int getTimeBin() const
virtual int getGroupSize() const override final
void addSiHitInformation(xAOD::TrackMeasurementValidation *xprd, const InDet::SCT_Cluster *prd, const std::vector< const SiHit * > *siHits) const
std::atomic< unsigned int > m_missingParentParticle
void addSDOInformation(xAOD::TrackMeasurementValidation *xprd, const InDet::SCT_Cluster *prd, const InDetSimDataCollection *sdoCollection) const
SG::ReadHandleKey< SiHitCollection > m_sihitContainer
SG::ReadHandleKey< PRD_MultiTruthCollection > m_multiTruth
SG::ReadHandleKey< SCT_RDO_Container > m_rdoContainer
BooleanProperty m_writeSDOs
SG::ReadHandleKey< InDetSimDataCollection > m_SDOcontainer
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_SCTDetEleCollKey
virtual StatusCode execute(const EventContext &ctx) const override
std::atomic_bool m_firstEventWarnings
BooleanProperty m_writeSiHits
SG::WriteHandleKey< xAOD::TrackMeasurementValidationContainer > m_xAodContainer
virtual StatusCode finalize() override
SG::WriteHandleKey< std::vector< unsigned int > > m_xAodOffset
SCT_PrepDataToxAOD(const std::string &name, ISvcLocator *pSvcLocator)
BooleanProperty m_writeRDOinformation
const SCT_ID * m_SCTHelper
SG::ReadHandleKey< xAODTruthParticleLinkVector > m_truthParticleLinks
std::atomic< unsigned int > m_missingTruthParticle
void findAllHitsCompatibleWithCluster(const InDet::SCT_Cluster *prd, const std::vector< const SiHit * > *siHits, std::vector< SiHit > &matchingHits) const
SG::ReadHandleKey< InDet::SCT_ClusterContainer > m_clustercontainer
void addRDOInformation(xAOD::TrackMeasurementValidation *, const InDet::SCT_Cluster *, const std::map< Identifier, const SCT_RDORawData * > &idToRAWDataMap) const
std::atomic< unsigned int > m_haveTruthLink
BooleanProperty m_useTruthInfo
virtual StatusCode initialize() override
size_t index() const
Return the index of this element within its container.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const_pointer_type cptr()
Dereference the pointer.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
Definition SiHit.h:19
HepGeom::Point3D< double > localStartPosition() const
Definition SiHit.cxx:146
HepGeom::Point3D< double > localEndPosition() const
Definition SiHit.cxx:153
const std::vector< Identifier > & rdoList() const
return the List of rdo identifiers (pointers)
ElementLink< xAOD::TruthParticleContainer > find(const HepMcParticleLink &hepMCLink) const
void setRdoIdentifierList(const std::vector< uint64_t > &rdoIdentifierList)
Sets the list of RDO identifiers.
void setLocalPositionError(float localXError, float localYError, float localXYCorrelation)
Sets the local position error.
void setLocalPosition(float localX, float localY)
Sets the local position.
void setIdentifier(uint64_t identifier)
Sets the identifier.
void setGlobalPosition(float globalX, float globalY, float globalZ)
Sets the global position.
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Eigen::Matrix< double, 2, 1 > Vector2D
Eigen::Matrix< double, 3, 1 > Vector3D
constexpr int INVALID_PARTICLE_ID
int uniqueID(const T &p)
constexpr int UNDEFINED_ID
TrackMeasurementValidation_v1 TrackMeasurementValidation
Reference the current persistent version:
TruthParticle_v1 TruthParticle
Typedef to implementation.