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