27 return StatusCode::SUCCESS;
32 return StatusCode::SUCCESS;
40 auto output = std::make_unique<xAOD::BaseContainer>();
41 auto outputAux = std::make_unique<xAOD::AuxContainerBase>();
42 output->setStore(outputAux.get());
45 for (
auto coll: *pixelSPContainer ) {
46 pixSize += coll->size();
49 for (
auto coll: *SCTSPContainer ) {
50 SCTSize += coll->size();
53 auto goodNumberOfSpacePoints = [
this, SCTSize, pixSize](){
59 auto goodNumberOfTracks = [
this, &context]() {
64 if ( goodNumberOfSpacePoints() and goodNumberOfTracks() ) {
74 const PixelID *pixelID =
nullptr;
75 const SCT_ID *stripID =
nullptr;
81 for (
auto coll: *pixelSPContainer ) {
82 for (
auto sp: *coll ) {
84 output->push_back( item );
85 x(*item) = float(
sp->globalPosition().x());
86 y(*item) = float(
sp->globalPosition().y());
87 z(*item) = float(
sp->globalPosition().z());
89 tot(*item) = float(cluster->
totalToT());
90 csize(*item) = short(cluster->
totList().size());
91 auto[hashId1, hashId2] =
sp->elementIdList();
92 module1(*item) = hashId1;
93 module2(*item) = hashId2;
99 for (
auto coll: *SCTSPContainer ) {
100 for (
auto sp: *coll ) {
102 output->push_back( item );
103 x(*item) = float(
sp->globalPosition().x());
104 y(*item) = float(
sp->globalPosition().y());
105 z(*item) = float(
sp->globalPosition().z());
109 auto[hashId1, hashId2] =
sp->elementIdList();
110 module1(*item) = hashId1;
111 module2(*item) = hashId2;
114 for (
size_t i = 0; i < std::min(10ul, output->size()); ++i ) {
119 <<
" " << yAcc(*output->at(i))
120 <<
" " << zAcc(*output->at(i)) );
126 ATH_CHECK( outputHandle.record(std::move(output), std::move(outputAux)));
128 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
Helper class to provide constant type-safe access to aux data.
Helper class to provide type-safe access to aux data.
This is an Identifier helper class for the Pixel subdetector.
This is an Identifier helper class for the SCT subdetector.
const ServiceHandle< StoreGateSvc > & detStore() const
An algorithm that can be simultaneously executed in multiple threads.
const std::vector< int > & totList() const
This is an Identifier helper class for the Pixel subdetector.
This is an Identifier helper class for the SCT subdetector.
Base class for elements of a container that can have aux data.
Helper class to provide constant type-safe access to aux data.
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_tracksKey
virtual StatusCode execute(const EventContext &context) const override
SpacePointCopier(const std::string &name, ISvcLocator *pSvcLocator)
Gaudi::Property< size_t > m_maxTracks
SG::WriteHandleKey< xAOD::BaseContainer > m_outputKey
Gaudi::Property< size_t > m_maxPixSP
Gaudi::Property< size_t > m_maxTotalSP
virtual ~SpacePointCopier() override
virtual StatusCode finalize() override
SG::ReadHandleKey< SpacePointContainer > m_pixelSPKey
Gaudi::Property< size_t > m_maxSCTSP
SG::ReadHandleKey< SpacePointContainer > m_SCTSPKey
virtual StatusCode initialize() override
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())