diff --git a/Tracker/TrackerEventCnv/TrackerEventAthenaPool/CMakeLists.txt b/Tracker/TrackerEventCnv/TrackerEventAthenaPool/CMakeLists.txt index a6ff20cdab5cb61d20b97b17290b0224ee6192fc..87b41d357f9aeeae0a538a1601109cafa103a7fa 100644 --- a/Tracker/TrackerEventCnv/TrackerEventAthenaPool/CMakeLists.txt +++ b/Tracker/TrackerEventCnv/TrackerEventAthenaPool/CMakeLists.txt @@ -16,18 +16,19 @@ atlas_add_library( TrackerEventAthenaPool AthenaBaseComps AthenaKernel SGTools StoreGateLib AthenaPoolCnvSvcLib AthenaPoolUtilities AtlasSealCLHEP GaudiKernel TrackerIdentifier TrackerReadoutGeometry TrackerEventTPCnv TrackerRawData TrackerSimData - TrackerPrepRawData TrkTrack ) + TrackerPrepRawData TrackerSpacePoint TrkTrack ) atlas_add_poolcnv_library( TrackerEventAthenaPoolPoolCnv FILES TrackerRawData/FaserSCT_RDO_Container.h TrackerPrepRawData/FaserSCT_ClusterContainer.h + TrackerSpacePoint/FaserSCT_SpacePointContainer.h src/TrackerTrack.h TrackerSimData/TrackerSimDataCollection.h LINK_LIBRARIES Identifier GeneratorObjectsTPCnv AthAllocators AthContainers AthenaBaseComps AthenaKernel SGTools StoreGateLib AthenaPoolCnvSvcLib AthenaPoolUtilities AtlasSealCLHEP GaudiKernel TrackerIdentifier TrackerReadoutGeometry TrackerEventTPCnv TrackerRawData TrackerSimData - TrackerPrepRawData TrkTrack TrackerEventAthenaPool ) + TrackerPrepRawData TrackerSpacePoint TrkTrack TrackerEventAthenaPool ) atlas_add_dictionary( TrackerEventAthenaPoolCnvDict TrackerEventAthenaPool/TrackerEventAthenaPoolCnvDict.h diff --git a/Tracker/TrackerEventCnv/TrackerEventAthenaPool/src/FaserSCT_SpacePointContainerCnv.h b/Tracker/TrackerEventCnv/TrackerEventAthenaPool/src/FaserSCT_SpacePointContainerCnv.h index bb1706fd1212aa7cae5690c84bde2b06b3f68d87..704a24e1fece5b07dda40941cde41623ba4d87a4 100644 --- a/Tracker/TrackerEventCnv/TrackerEventAthenaPool/src/FaserSCT_SpacePointContainerCnv.h +++ b/Tracker/TrackerEventCnv/TrackerEventAthenaPool/src/FaserSCT_SpacePointContainerCnv.h @@ -21,7 +21,7 @@ class FaserSCT_SpacePointContainerCnv : public FaserSCT_SpacePointContainerCnvBa friend class CnvFactory<FaserSCT_SpacePointContainerCnv>; public: - FaserSCT_SpacePointContainerCnv (ISvcLocator* svcloc) : FaserSCT_SpacePointContainerCnvBase(svcloc) {} + FaserSCT_SpacePointContainerCnv (ISvcLocator* svcloc) : FaserSCT_SpacePointContainerCnvBase(svcloc, "FaserSCT_SpacePointContainerCnv") {} protected: virtual FaserSCT_SpacePointContainer_PERS* createPersistent (FaserSCT_SpacePointContainer* transObj); diff --git a/Tracker/TrackerEventCnv/TrackerEventAthenaPool/src/SpacePointContainerCnv.cxx b/Tracker/TrackerEventCnv/TrackerEventAthenaPool/src/SpacePointContainerCnv.cxx deleted file mode 100644 index 4ea69f69454c3e5683f3202e17b844dde7fb4208..0000000000000000000000000000000000000000 --- a/Tracker/TrackerEventCnv/TrackerEventAthenaPool/src/SpacePointContainerCnv.cxx +++ /dev/null @@ -1,35 +0,0 @@ -/* - Copyright (C) 2021 CERN for the benefit of the FASER collaboration -*/ - -#include "SpacePointContainerCnv.h" - -SpacePointContainer_PERS* -SpacePointContainerCnv::createPersistent (SpacePointContainer* transObj) { - ATH_MSG_INFO("SpacePointContainerCnv::createPersistent()"); - - SpacePointContainerCnv_PERS converter; - - SpacePointContainer_PERS* persObj(nullptr); - persObj = converter.createPersistent(transObj, msg()); - return persObj; -} - - -SpacePointContainer* -SpacePointContainerCnv::createTransient() { - ATH_MSG_INFO("SpacePointContainerCnv::createTransient()"); - - static const pool::Guid p0_guid("DB0397F9-A163-496F-BC17-C7E507A1FA50"); - SpacePointContainer* transObj(nullptr); - - if (compareClassGuid(p0_guid)) { - std::unique_ptr<SpacePointContainer_PERS> col_vect(poolReadObject<SpacePointContainer_PERS>()); - SpacePointContainerCnv_PERS converter; - transObj = converter.createTransient( col_vect.get(), msg()); - } else { - throw std::runtime_error("Unsupported persistent version of SpacePointContainer"); - } - - return transObj; -} diff --git a/Tracker/TrackerEventCnv/TrackerEventAthenaPool/src/SpacePointContainerCnv.h b/Tracker/TrackerEventCnv/TrackerEventAthenaPool/src/SpacePointContainerCnv.h deleted file mode 100644 index 9537ce3aad9f6327535b90dfef7bda79e9c313c3..0000000000000000000000000000000000000000 --- a/Tracker/TrackerEventCnv/TrackerEventAthenaPool/src/SpacePointContainerCnv.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - Copyright 2021 CERN for the benefit of the FASER collaboration -*/ - -#ifndef SPACEPOINTCONTAINERCNV_H -#define SPACEPOINTCONTAINERCNV_H - -#include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" - -#include "TrackerEventTPCnv/SpacePointContainerCnv_p0.h" - -#include "TrkSpacePoint/SpacePointContainer.h" -#include "TrackerEventTPCnv/SpacePointContainer_p0.h" - -typedef SpacePointContainer_p0 SpacePointContainer_PERS; -typedef SpacePointContainerCnv_p0 SpacePointContainerCnv_PERS; - -typedef T_AthenaPoolCustomCnv<SpacePointContainer, SpacePointContainer_PERS> SpacePointContainerCnvBase; - -class SpacePointContainerCnv : public SpacePointContainerCnvBase { - friend class CnvFactory<SpacePointContainerCnv>; - - public: - SpacePointContainerCnv (ISvcLocator* svcloc) : SpacePointContainerCnvBase(svcloc) {} - - protected: - virtual SpacePointContainer_PERS* createPersistent (SpacePointContainer* transObj); - virtual SpacePointContainer* createTransient (); -}; - -#endif // SPACEPOINTCONTAINERCNV_H diff --git a/Tracker/TrackerEventCnv/TrackerEventTPCnv/TrackerEventTPCnv/FaserSCT_SpacePointCnv_p0.h b/Tracker/TrackerEventCnv/TrackerEventTPCnv/TrackerEventTPCnv/FaserSCT_SpacePointCnv_p0.h index b6cd339eefbdc7684329726b1624d927d841bb7f..a9822809eb2078a3dc57e0cb9d362b960c7ffca6 100644 --- a/Tracker/TrackerEventCnv/TrackerEventTPCnv/TrackerEventTPCnv/FaserSCT_SpacePointCnv_p0.h +++ b/Tracker/TrackerEventCnv/TrackerEventTPCnv/TrackerEventTPCnv/FaserSCT_SpacePointCnv_p0.h @@ -9,6 +9,10 @@ #include "TrackerEventTPCnv/FaserSCT_SpacePoint_p0.h" #include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h" +#include "DataModelAthenaPool/ElementLinkCnv_p1.h" +#include "AthLinks/ElementLink.h" +#include "TrackerPrepRawData/FaserSCT_Cluster.h" +#include "TrackerPrepRawData/FaserSCT_ClusterContainer.h" class FaserSCT_SpacePointCnv_p0 : public T_AthenaPoolTPCnvBase<Tracker::FaserSCT_SpacePoint, FaserSCT_SpacePoint_p0> { public: @@ -21,6 +25,8 @@ class FaserSCT_SpacePointCnv_p0 : public T_AthenaPoolTPCnvBase<Tracker::FaserSCT virtual void transToPers(const Tracker::FaserSCT_SpacePoint* transObj, FaserSCT_SpacePoint_p0* persObj, MsgStream& log); + + ElementLinkCnv_p1<ElementLink<Tracker::FaserSCT_ClusterContainer>> m_elCnv; }; #endif // SPACEPOINTCNV_P0_H diff --git a/Tracker/TrackerEventCnv/TrackerEventTPCnv/TrackerEventTPCnv/FaserSCT_SpacePointCollection_p0.h b/Tracker/TrackerEventCnv/TrackerEventTPCnv/TrackerEventTPCnv/FaserSCT_SpacePointCollection_p0.h index e7dce840afcb55c65eeb18ffbdb1e0a1e25fa14d..a8ce9a2c0d9ee6b6c37020d302b505602646b4b0 100644 --- a/Tracker/TrackerEventCnv/TrackerEventTPCnv/TrackerEventTPCnv/FaserSCT_SpacePointCollection_p0.h +++ b/Tracker/TrackerEventCnv/TrackerEventTPCnv/TrackerEventTPCnv/FaserSCT_SpacePointCollection_p0.h @@ -12,7 +12,10 @@ class FaserSCT_SpacePointCollection_p0 { FaserSCT_SpacePointCollection_p0(); friend class FaserSCT_SpacePointClusterCnv_p0; - unsigned short m_idHash; + unsigned int m_idHash; + unsigned int m_id; + unsigned int m_begin; + unsigned int m_end; unsigned short m_size; }; diff --git a/Tracker/TrackerEventCnv/TrackerEventTPCnv/TrackerEventTPCnv/FaserSCT_SpacePointContainerCnv_p0.h b/Tracker/TrackerEventCnv/TrackerEventTPCnv/TrackerEventTPCnv/FaserSCT_SpacePointContainerCnv_p0.h index ec1c9619a330a77d8ac016d4f8496aeae6a16701..5c1b5738d2777f4c38309409b4335444ec76c535 100644 --- a/Tracker/TrackerEventCnv/TrackerEventTPCnv/TrackerEventTPCnv/FaserSCT_SpacePointContainerCnv_p0.h +++ b/Tracker/TrackerEventCnv/TrackerEventTPCnv/TrackerEventTPCnv/FaserSCT_SpacePointContainerCnv_p0.h @@ -21,6 +21,8 @@ class FaserSCT_SpacePointContainerCnv_p0 : public T_AthenaPoolTPCnvBase<FaserSCT virtual void transToPers(const FaserSCT_SpacePointContainer* transObj, FaserSCT_SpacePointContainer_p0* persObj, MsgStream& log); + FaserSCT_SpacePointContainer* createTransient(FaserSCT_SpacePointContainer_p0* persObj, MsgStream& log){ + FaserSCT_SpacePointContainer* trans=new FaserSCT_SpacePointContainer(1000); persToTrans(persObj,trans,log);return trans;}; }; #endif // SPACEPOINTCONTAINERCNV_P0_H diff --git a/Tracker/TrackerEventCnv/TrackerEventTPCnv/TrackerEventTPCnv/FaserSCT_SpacePoint_p0.h b/Tracker/TrackerEventCnv/TrackerEventTPCnv/TrackerEventTPCnv/FaserSCT_SpacePoint_p0.h index 638a2e16ae120ee54223588e4475fd52517727f5..3c9d0660d971a0c29aa52fa27655f1dabdb1026c 100644 --- a/Tracker/TrackerEventCnv/TrackerEventTPCnv/TrackerEventTPCnv/FaserSCT_SpacePoint_p0.h +++ b/Tracker/TrackerEventCnv/TrackerEventTPCnv/TrackerEventTPCnv/FaserSCT_SpacePoint_p0.h @@ -4,6 +4,8 @@ #ifndef FASERSCT_SPACEPOINT_P0_H #define FASERSCT_SPACEPOINT_P0_H +#include "Identifier/IdentifierHash.h" +#include "DataModelAthenaPool/ElementLink_p1.h" class FaserSCT_SpacePoint_p0 { public: @@ -24,6 +26,8 @@ class FaserSCT_SpacePoint_p0 { float m_cov11; float m_cov12; float m_cov22; + ElementLinkInt_p1 m_link1; + ElementLinkInt_p1 m_link2; }; inline diff --git a/Tracker/TrackerEventCnv/TrackerEventTPCnv/TrackerEventTPCnv/SpacePointCnv_p0.h b/Tracker/TrackerEventCnv/TrackerEventTPCnv/TrackerEventTPCnv/SpacePointCnv_p0.h deleted file mode 100644 index 10c3090e3c98fa4a2cfb14afaa0a81b22cdb6900..0000000000000000000000000000000000000000 --- a/Tracker/TrackerEventCnv/TrackerEventTPCnv/TrackerEventTPCnv/SpacePointCnv_p0.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - Copyright (C) 2021 CERN for the benefit of the FASER collaboration -*/ - -#ifndef SPACEPOINTCNV_P0_H -#define SPACEPOINTCNV_P0_H - -#include "TrackerSpacePoint/FaserSCT_SpacePoint.h" -#include "TrackerEventTPCnv/SpacePoint_p0.h" - -#include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h" - -class SpacePointCnv_p0 : public T_AthenaPoolTPCnvBase<Tracker::FaserSCT_SpacePoint, SpacePoint_p0> { - public: - SpacePointCnv_p0() {}; - - virtual void persToTrans(const SpacePoint_p0* persObj, - Tracker::FaserSCT_SpacePoint* transObj, - MsgStream& log); - - virtual void transToPers(const Tracker::FaserSCT_SpacePoint* transObj, - SpacePoint_p0* persObj, - MsgStream& log); -}; - -#endif // SPACEPOINTCNV_P0_H diff --git a/Tracker/TrackerEventCnv/TrackerEventTPCnv/TrackerEventTPCnv/SpacePointCollection_p0.h b/Tracker/TrackerEventCnv/TrackerEventTPCnv/TrackerEventTPCnv/SpacePointCollection_p0.h deleted file mode 100644 index 3d71dcf8f1f15bd0bb5628a743f3af614f354e7a..0000000000000000000000000000000000000000 --- a/Tracker/TrackerEventCnv/TrackerEventTPCnv/TrackerEventTPCnv/SpacePointCollection_p0.h +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright 2021 CERN for the benefit of the FASER collaboration -*/ - -#ifndef SPACEPOINTCOLLECTION_P0_H -#define SPACEPOINTCOLLECTION_P0_H - -#include <vector> - -class SpacePointCollection_p0 { - public: - SpacePointCollection_p0(); - friend class SpacePointClusterCnv_p0; - - unsigned short m_idHash; - unsigned short m_size; -}; - -inline -SpacePointCollection_p0::SpacePointCollection_p0() : m_idHash(0) { } - -#endif // SPACEPOINTCOLLECTION_P0_H diff --git a/Tracker/TrackerEventCnv/TrackerEventTPCnv/TrackerEventTPCnv/SpacePointContainerCnv_p0.h b/Tracker/TrackerEventCnv/TrackerEventTPCnv/TrackerEventTPCnv/SpacePointContainerCnv_p0.h deleted file mode 100644 index 2da19a3ce5880820fcf39fab7cac0a40ce3ffa4a..0000000000000000000000000000000000000000 --- a/Tracker/TrackerEventCnv/TrackerEventTPCnv/TrackerEventTPCnv/SpacePointContainerCnv_p0.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - Copyright 2021 CERN for the benefit of the FASER collaboration -*/ - -#ifndef SPACEPOINTCONTAINERCNV_P0_H -#define SPACEPOINTCONTAINERCNV_P0_H - -#include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h" - -#include "TrkSpacePoint/SpacePointContainer.h" -#include "TrackerEventTPCnv/SpacePointContainer_p0.h" - -class SpacePointContainerCnv_p0 : public T_AthenaPoolTPCnvBase<SpacePointContainer, SpacePointContainer_p0> { - public: - SpacePointContainerCnv_p0() {}; - - virtual void persToTrans(const SpacePointContainer_p0* persObj, - SpacePointContainer* transObj, - MsgStream& log); - - virtual void transToPers(const SpacePointContainer* transObj, - SpacePointContainer_p0* persObj, - MsgStream& log); -}; - -#endif // SPACEPOINTCONTAINERCNV_P0_H diff --git a/Tracker/TrackerEventCnv/TrackerEventTPCnv/TrackerEventTPCnv/SpacePointContainer_p0.h b/Tracker/TrackerEventCnv/TrackerEventTPCnv/TrackerEventTPCnv/SpacePointContainer_p0.h deleted file mode 100644 index 0a9cdbe4d8da94c47e96797a486649073ff02ebf..0000000000000000000000000000000000000000 --- a/Tracker/TrackerEventCnv/TrackerEventTPCnv/TrackerEventTPCnv/SpacePointContainer_p0.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - Copyright (C) 2021 CERN for the benefit of the FASER collaboration -*/ - -#ifndef SPACEPOINTCONTAINER_P0_H -#define SPACEPOINTCONTAINER_P0_H - -#include <vector> -#include "TrackerEventTPCnv/SpacePoint_p0.h" -#include "TrackerEventTPCnv/SpacePointCollection_p0.h" - -class SpacePointContainer_p0 { - public: - SpacePointContainer_p0(); - friend class SpacePointContainerCnv_p0; - private: - std::vector<SpacePoint_p0> m_spacepoints; - std::vector<SpacePointCollection_p0> m_spacepoint_collections; -}; - -inline SpacePointContainer_p0::SpacePointContainer_p0() { - m_spacepoints.clear(); - m_spacepoint_collections.clear(); -} - -#endif // SPACEPOINTCONTAINER_P0_H diff --git a/Tracker/TrackerEventCnv/TrackerEventTPCnv/TrackerEventTPCnv/SpacePoint_p0.h b/Tracker/TrackerEventCnv/TrackerEventTPCnv/TrackerEventTPCnv/SpacePoint_p0.h deleted file mode 100644 index 4a648fa58dd681f52f59f91ecac25635b16b7f30..0000000000000000000000000000000000000000 --- a/Tracker/TrackerEventCnv/TrackerEventTPCnv/TrackerEventTPCnv/SpacePoint_p0.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - Copyright 2021 CERN for the benefit of the FASER collaboration -*/ - -#ifndef SPACEPOINT_P0_H -#define SPACEPOINT_P0_H - -class SpacePoint_p0 { - public: - SpacePoint_p0(); - friend class SpacePointCnv_p0; - - private: - unsigned int m_idHash0; - unsigned int m_idHash1; - - float m_pos_x; - float m_pos_y; - float m_pos_z; - - float m_cov00; - float m_cov01; - float m_cov02; - float m_cov11; - float m_cov12; - float m_cov22; -}; - -inline -SpacePoint_p0::SpacePoint_p0() : - m_idHash0(0), - m_idHash1(0), - m_pos_x(0), - m_pos_y(0), - m_pos_z(0), - m_cov00(0), - m_cov01(0), - m_cov02(0), - m_cov11(0), - m_cov12(0), - m_cov22(0) -{} - -#endif // SPACEPOINT_P0_H diff --git a/Tracker/TrackerEventCnv/TrackerEventTPCnv/src/SpacePointCnv_p0.cxx b/Tracker/TrackerEventCnv/TrackerEventTPCnv/src/SpacePointCnv_p0.cxx deleted file mode 100644 index 63dba18507be95fe780a27de401cc6ac01a57027..0000000000000000000000000000000000000000 --- a/Tracker/TrackerEventCnv/TrackerEventTPCnv/src/SpacePointCnv_p0.cxx +++ /dev/null @@ -1,33 +0,0 @@ -/* - Copyright (C) 2021 CERN for the benefit of the FASER collaboration -*/ - -#include "TrackerEventTPCnv/SpacePointCnv_p0.h" - -void -SpacePointCnv_p0::persToTrans(const SpacePoint_p0* persObj, Tracker::FaserSCT_SpacePoint* transObj, MsgStream& /*log*/) { - - // TODO - -} - -void -SpacePointCnv_p0::transToPers(const Tracker::FaserSCT_SpacePoint* transObj, SpacePoint_p0* persObj, MsgStream& /*log*/) { - - auto idHashs = transObj->elementIdList(); - persObj->m_idHash0 = idHashs.first; - persObj->m_idHash1 = idHashs.second; - - auto globalPosition = transObj->globalPosition(); - persObj->m_pos_x = globalPosition.x(); - persObj->m_pos_y = globalPosition.y(); - persObj->m_pos_z = globalPosition.z(); - - auto cov = transObj->globCovariance(); - persObj->m_cov00 = cov(0,0); - persObj->m_cov01 = cov(0,1); - persObj->m_cov02 = cov(0,2); - persObj->m_cov11 = cov(1,1); - persObj->m_cov12 = cov(2,2); - persObj->m_cov22 = cov(2,2); -} diff --git a/Tracker/TrackerEventCnv/TrackerEventTPCnv/src/SpacePointContainerCnv_p0.cxx b/Tracker/TrackerEventCnv/TrackerEventTPCnv/src/SpacePointContainerCnv_p0.cxx deleted file mode 100644 index 88c0f0b220c45bac9322484e027707ada331bc27..0000000000000000000000000000000000000000 --- a/Tracker/TrackerEventCnv/TrackerEventTPCnv/src/SpacePointContainerCnv_p0.cxx +++ /dev/null @@ -1,56 +0,0 @@ -/* - Copyright (C) 2021 CERN for the benefit of the FASER collaboration -*/ - -#include "TrackerEventTPCnv/SpacePointContainerCnv_p0.h" - -#include "TrackerEventTPCnv/SpacePoint_p0.h" -#include "TrackerEventTPCnv/SpacePointCollection_p0.h" -#include "TrackerEventTPCnv/SpacePointCnv_p0.h" - -void SpacePointContainerCnv_p0::persToTrans(const SpacePointContainer_p0* /*persObj*/, SpacePointContainer* /*transObj*/, MsgStream& /*log*/) { - - // TODO - -} - -void SpacePointContainerCnv_p0::transToPers(const SpacePointContainer* transObj, SpacePointContainer_p0* persObj, MsgStream& log) { - log << MSG::INFO << "SpacePointContainerCnv_p0::transToPers()" << endmsg; - - SpacePointCnv_p0 spCnv; - typedef SpacePointContainer TRANS; - - TRANS::const_iterator spColl; - TRANS::const_iterator spCollEnd = transObj->end(); - unsigned int spCollId; - unsigned int spId = 0; - unsigned int nextSpId = 0; - unsigned int lastIdHash = 0; - - // resize data vectors - persObj->m_spacepoint_collections.resize(transObj->numberOfCollections()); - int n_spacepoints = 0; - for (spColl = transObj->begin(); spColl != spCollEnd; spColl++) { - n_spacepoints += (*spColl)->size(); - } - persObj->m_spacepoints.resize(n_spacepoints); - - for (spColl = transObj->begin(), spCollId = 0; spColl != spCollEnd; ++spCollId, ++spColl) { - // create persitent representation of SpacePointCollections - const SpacePointCollection& collection = **spColl; - SpacePointCollection_p0& pcollection = persObj->m_spacepoint_collections[spCollId]; - pcollection.m_size = collection.size(); - pcollection.m_idHash = collection.identifyHash() - lastIdHash; - lastIdHash = collection.identifyHash(); - - spId = nextSpId; - nextSpId += collection.size(); - - // create persitent representation of SpacePoints - for (std::size_t i = 0; i < collection.size(); ++i) { - SpacePoint_p0* persSP = &(persObj->m_spacepoints[i + spId]); - const Tracker::FaserSCT_SpacePoint* transSP = dynamic_cast<const Tracker::FaserSCT_SpacePoint*>(collection[i]); - spCnv.transToPers(transSP, persSP, log); - } - } -} diff --git a/Tracker/TrackerRecAlgs/TrackerPrepRawDataFormation/src/FaserSCT_Clusterization.cxx b/Tracker/TrackerRecAlgs/TrackerPrepRawDataFormation/src/FaserSCT_Clusterization.cxx index 04568b0e9f0c277ba54c7faf068d0c3107b58b5d..5985cbe4870e13abfb5b343569f963395df0eab2 100644 --- a/Tracker/TrackerRecAlgs/TrackerPrepRawDataFormation/src/FaserSCT_Clusterization.cxx +++ b/Tracker/TrackerRecAlgs/TrackerPrepRawDataFormation/src/FaserSCT_Clusterization.cxx @@ -113,6 +113,8 @@ StatusCode FaserSCT_Clusterization::execute(const EventContext& ctx) const { if (not dontDoClusterization) { for (; rdoCollections != rdoCollectionsEnd; ++rdoCollections) { ++m_numberOfRDOCollection; + for (const FaserSCT_RDORawData* rdo: **rdoCollections) { + } const TrackerRawDataCollection<FaserSCT_RDORawData>* rd{*rdoCollections}; ATH_MSG_DEBUG("RDO collection size=" << rd->size() << ", Hash=" << rd->identifyHash()); Tracker::FaserSCT_ClusterContainer::IDC_WriteHandle lock{clusterContainer->getWriteHandle(rdoCollections.hashId())}; @@ -184,4 +186,4 @@ StatusCode FaserSCT_Clusterization::finalize() return StatusCode::SUCCESS; } -} \ No newline at end of file +} diff --git a/Tracker/TrackerRecAlgs/TrackerSeedFinder/src/TrackerSeedFinder.cxx b/Tracker/TrackerRecAlgs/TrackerSeedFinder/src/TrackerSeedFinder.cxx index 51dc13911c25b21eaab453aa08f8a7a9cf0355cb..96dbd3269a1a20e7ebdf884069ef08b9ab4693de 100755 --- a/Tracker/TrackerRecAlgs/TrackerSeedFinder/src/TrackerSeedFinder.cxx +++ b/Tracker/TrackerRecAlgs/TrackerSeedFinder/src/TrackerSeedFinder.cxx @@ -56,9 +56,9 @@ namespace Tracker , m_hist_station(0) , m_hist_x_z(0) , m_hist_y_z(0) - , m_hist_sp_plane (0) - , m_hist_sp_layer (0) - , m_hist_sp_station (0) + , m_hist_sp_plane(0) + , m_hist_sp_layer(0) + , m_hist_sp_station(0) , m_hist_nseed(0) , m_hist_nsp1(0) , m_hist_nsp2(0) @@ -110,7 +110,7 @@ namespace Tracker m_hist_nseed=new TH1D("sp_nseed","n track seeds",1000,0,1000); m_hist_nsp1=new TH1D("sp_nsp1","n triplets in first station",100,0,100); m_hist_nsp2=new TH1D("sp_nsp2","n triplets in second station",100,0,100); - m_hist_sp_plane=new TH1D("sp_all_plane","sp_station",100,-10,10); + m_hist_sp_plane=new TH1D("sp_all_plane","sp_station",10,0,10); m_hist_sp_layer=new TH1D("sp_all_layer","sp_station",100,-10,10); m_hist_x_z=new TH2D("sp_x_z","sp_x_z",100,-200,200,3500,0,3500); m_hist_y_z=new TH2D("sp_y_z","sp_y_z",100,-200,200,3500,0,3500); @@ -231,7 +231,7 @@ namespace Tracker SG::WriteHandle<TrackerSeedCollection> seedContainer(m_trackerSeedContainerKey, ctx); ATH_CHECK(seedContainer.record( std::make_unique<TrackerSeedCollection>() ) ); - ATH_MSG_INFO("Created track seed container " << m_trackerSeedContainerKey.key()); + ATH_MSG_DEBUG("Created track seed container " << m_trackerSeedContainerKey.key()); int i=0; vector<vector<const FaserSCT_SpacePoint*> > vsp1(3); @@ -284,6 +284,10 @@ namespace Tracker vsp3.at(plane).push_back(sp); } + m_hist_sp_plane->Fill((station-1)*3+plane); + m_hist_sp_station->Fill(station); + m_hist_sp_layer->Fill(plane); + if (station==1 && plane==0) {N_1_0++;} if (station==1 && plane==1) {N_1_1++;} if (station==1 && plane==2) {N_1_2++;} if (station==2 && plane==0) {N_2_0++;} if (station==2 && plane==1) {N_2_1++;} if (station==2 && plane==2) {N_2_2++;} if (station==3 && plane==0) {N_3_0++;} if (station==3 && plane==1) {N_3_1++;} if (station==3 && plane==2) {N_3_2++;} @@ -360,7 +364,7 @@ namespace Tracker m_hist_nsp1->Fill(nsp1); m_hist_nsp2->Fill(nsp2); m_hist_nseed->Fill(nseed); - ATH_MSG_INFO("Saved " << nseed << " seeds in container"); + ATH_MSG_DEBUG("Saved " << nseed << " seeds in container"); return StatusCode::SUCCESS; } diff --git a/Tracker/TrackerRecAlgs/TrackerSeedFinder/src/TrackerSeedFinder.h b/Tracker/TrackerRecAlgs/TrackerSeedFinder/src/TrackerSeedFinder.h deleted file mode 100755 index 92d50ef97cbe685330fc49d31b7879c843ed3ff9..0000000000000000000000000000000000000000 --- a/Tracker/TrackerRecAlgs/TrackerSeedFinder/src/TrackerSeedFinder.h +++ /dev/null @@ -1,135 +0,0 @@ -/* - Copyright (C) 2021 CERN for the benefit of the FASER collaboration - */ - -/** @file TrackSeedFinder.h - * an algorithm for finding track seeds - * @author Andrea Coccaro - * @date May 2021 - */ - - -#ifndef TRACKERSEEDFINDER_TRACKERSEEDFINDER_H -#define TRACKERSEEDFINDER_TRACKERSEEDFINDER_H - -#include "StoreGate/ReadCondHandleKey.h" -#include "AthenaBaseComps/AthReentrantAlgorithm.h" -#include "Identifier/Identifier.h" - -#include "GeneratorObjects/McEventCollection.h" -#include "TrackerPrepRawData/FaserSCT_ClusterCollection.h" -#include "TrackerPrepRawData/FaserSCT_ClusterContainer.h" -#include "TrackerPrepRawData/TrackerClusterContainer.h" -#include "TrackerReadoutGeometry/SiDetectorElementCollection.h" -#include "TrackerSpacePoint/FaserSCT_SpacePoint.h" -#include "TrackerSpacePoint/FaserSCT_SpacePointContainer.h" -#include "TrackerSpacePoint/FaserSCT_SpacePointOverlapCollection.h" -#include "TrackerSpacePoint/SpacePointForSeedCollection.h" - -#include "TrackerSpacePoint/TrackerSeedCollection.h" -#include "TrackerSpacePoint/TrackerSeed.h" -#include "TrackerSimEvent/FaserSiHitCollection.h" -#include "TrackerRawData/FaserSCT_RDO_Container.h" -#include "TrackerSimData/TrackerSimDataCollection.h" - - -#include "GaudiKernel/ServiceHandle.h" -#include "GaudiKernel/ITHistSvc.h" -#include "GaudiKernel/ToolHandle.h" - -#include <string> -#include <vector> -#include "TH1.h" -#include "TH2.h" - -#include <string> - -using namespace std; - -class FaserSCT_ID; - -namespace Tracker { - - class TrackerSeedFinder:public AthReentrantAlgorithm { - - public: - - TrackerSeedFinder(const std::string& name, ISvcLocator* pSvcLocator); - - virtual ~TrackerSeedFinder() = default; - - virtual StatusCode initialize() override; - - virtual StatusCode execute (const EventContext& ctx) const override; - - virtual StatusCode finalize() override; - - private: - - struct seed { - vector<const FaserSCT_SpacePoint*> vsp; - double axz, bxz, ayz, byz; - double chi2_xz, chi2_yz; - string station; - int num; - - void add_sp(const FaserSCT_SpacePoint* sp) { - vsp.push_back(sp); - } - - void add_vsp(vector<const FaserSCT_SpacePoint*> v) { - for (vector<const FaserSCT_SpacePoint*>::iterator it = v.begin(); it != v.end(); ++it) { - vsp.push_back((*it)); - } - } - }; - - StatusCode make_triplets(vector< vector<const FaserSCT_SpacePoint*> >&, vector<seed>&, string) const; - - TrackerSeedFinder() = delete; - TrackerSeedFinder(const TrackerSeedFinder&) =delete; - TrackerSeedFinder &operator=(const TrackerSeedFinder&) = delete; - SG::ReadHandleKey<FaserSCT_SpacePointContainer> m_Sct_spcontainerKey{this, "SpacePointsSCTName", "SCT spContainer"}; - - SG::WriteHandleKey<SpacePointForSeedCollection> m_seed_spcontainerKey{this, "FaserSpacePointsSeedsName", "SpacePointForSeedCollection", "SpacePointForSeedCollection"}; - SG::WriteHandleKey<Tracker::TrackerSeedCollection> m_trackerSeedContainerKey{this, "FaserTrackerSeedName", "FaserTrackerSeedCollection", "FaserTrackerSeedCollection"}; - - SG::ReadCondHandleKey<TrackerDD::SiDetectorElementCollection> m_SCTDetEleCollKey{this, "SCTDetEleCollKey", "SCT_DetectorElementCollection", "Key of SiDetectorElementCollection for SCT"}; - - const FaserSCT_ID* m_idHelper{nullptr}; - mutable std::atomic<int> m_numberOfEvents{0}; - mutable std::atomic<int> m_numberOfSPCollection{0}; - mutable std::atomic<int> m_numberOfEmptySPCollection{0}; - mutable std::atomic<int> m_numberOfSP{0}; - - TH1* m_hist_n; - TH1* m_hist_x; - TH1* m_hist_y; - TH1* m_hist_z; - TH1* m_hist_r; - TH1* m_hist_phi; - TH1* m_hist_eta; - TH1* m_hist_layer; - TH1* m_hist_strip; - TH1* m_hist_station; - TH2* m_hist_x_z; - TH2* m_hist_y_z; - TH1* m_hist_sp_plane; - TH1* m_hist_sp_layer; - TH1* m_hist_sp_station; - TH1* m_hist_dx; - TH1* m_hist_dy; - TH1* m_hist_dx_slope; - TH1* m_hist_dy_slope; - TH1* m_hist_dx_intercept; - TH1* m_hist_dx_intercept_after; - TH1* m_hist_line; - - ServiceHandle<ITHistSvc> m_thistSvc; - - mutable int N_1_0=0, N_1_1=0, N_1_2=0, N_2_0=0, N_2_1=0, N_2_2=0, N_3_0=0, N_3_1=0, N_3_2=0; - - }; - -} -#endif // TRACKERSEEDFINDER_TRACKERSEEDFINDER_H diff --git a/Tracker/TrackerRecAlgs/TrackerSpacePointFormation/python/TrackerSpacePointFormationConfig.py b/Tracker/TrackerRecAlgs/TrackerSpacePointFormation/python/TrackerSpacePointFormationConfig.py index de8355dedc7b23a05ec50fe6757fcba0d00f759b..4bd7402d130957407bdf9d3ca3a660b18530060a 100644 --- a/Tracker/TrackerRecAlgs/TrackerSpacePointFormation/python/TrackerSpacePointFormationConfig.py +++ b/Tracker/TrackerRecAlgs/TrackerSpacePointFormation/python/TrackerSpacePointFormationConfig.py @@ -49,13 +49,14 @@ def StatisticsBasicCfg(flags, **kwargs): acc = ComponentAccumulator() acc.popToolsAndMerge(TrackerSpacePointMakerToolCfg(flags)) kwargs.setdefault("SpacePointsSCTName", "SCT_SpacePointContainer") + kwargs.setdefault("SCT_ClustersName", "SCT_ClusterContainer") acc.addEventAlgo(Tracker__StatisticsAlg(**kwargs)) return acc def TrackerSpacePointFinder_OutputCfg(flags): """Return ComponentAccumulator with Output for SCT. Not standalone.""" acc = ComponentAccumulator() - itemList = [ "SpacePointContainer#*"] + itemList = [ "FaserSCT_SpacePointContainer#*"] acc.merge(OutputStreamCfg(flags, "ESD", itemList)) ostream = acc.getEventAlgo("OutputStreamESD") ostream.TakeItemsFromInput = True @@ -66,7 +67,7 @@ def TrackerSpacePointFinderCfg(flags, **kwargs): """Return ComponentAccumulator for SCT SpacePoints and Output""" acc=TrackerDDSiElementPropertiesTableCondAlgCfg(flags) acc.merge(TrackerSpacePointFinderBasicCfg(flags, **kwargs)) - # acc.merge(TrackerSpacePointFinder_OutputCfg(flags)) + acc.merge(TrackerSpacePointFinder_OutputCfg(flags)) return acc def StatisticsCfg(flags, **kwargs): diff --git a/Tracker/TrackerRecAlgs/TrackerSpacePointFormation/src/StatisticsAlg.cxx b/Tracker/TrackerRecAlgs/TrackerSpacePointFormation/src/StatisticsAlg.cxx index bd10f323523bfa0e5156e8bf578935a4e9e9cb50..2c6386a389183a90c2b93f4cbfa9621a3feba21e 100755 --- a/Tracker/TrackerRecAlgs/TrackerSpacePointFormation/src/StatisticsAlg.cxx +++ b/Tracker/TrackerRecAlgs/TrackerSpacePointFormation/src/StatisticsAlg.cxx @@ -64,6 +64,11 @@ StatusCode StatisticsAlg::initialize() ATH_MSG_DEBUG( "StatisticsAlg::initialize()" ); CHECK(m_thistSvc.retrieve()); + if(m_Sct_clcontainerKey.key().empty()){ + ATH_MSG_FATAL( "SCTs selected and no name set for SCT clusters"); + return StatusCode::FAILURE; + } + ATH_CHECK( m_Sct_clcontainerKey.initialize() ); // Check that clusters, space points and ids have names if ( m_Sct_spcontainerKey.key().empty()){ ATH_MSG_FATAL( "SCTs selected and no name set for SCT clusters"); @@ -137,6 +142,13 @@ StatusCode StatisticsAlg::execute (const EventContext& ctx) const // register the IdentifiableContainer into StoreGate + //retrieve SCT cluster container + SG::ReadHandle<Tracker::FaserSCT_ClusterContainer> sct_clcontainer( m_Sct_clcontainerKey, ctx ); + if (!sct_clcontainer.isValid()){ + msg(MSG:: FATAL) << "Could not find the data object "<< sct_clcontainer.name() << " !" << endmsg; + return StatusCode::RECOVERABLE; + } + // retrieve SCT cluster container SG::ReadHandle<FaserSCT_SpacePointContainer> sct_spcontainer( m_Sct_spcontainerKey, ctx ); @@ -176,6 +188,7 @@ StatusCode StatisticsAlg::execute (const EventContext& ctx) const m_hist_phi->Fill(sp->phi()); Amg::Vector3D gloPos=sp->globalPosition(); m_hist_x->Fill(gloPos.x()); + ATH_MSG_DEBUG( "SCT spacepoint positions in container : " << gloPos.x()<<" "<<gloPos.y()<<" "<<gloPos.z() ); m_hist_y->Fill(gloPos.y()); m_hist_z->Fill(gloPos.z()); if ( ((istation-1)*3+ilayer) == 0 ) m_hist_x_y_plane0->Fill(gloPos.x(),gloPos.y()); diff --git a/Tracker/TrackerRecAlgs/TrackerSpacePointFormation/src/StatisticsAlg.h b/Tracker/TrackerRecAlgs/TrackerSpacePointFormation/src/StatisticsAlg.h index 7c67a4004c95a9deeb7e6796308b46c878ad42db..26add4b59a62d9c5a6819ec695396b56bcbbf987 100755 --- a/Tracker/TrackerRecAlgs/TrackerSpacePointFormation/src/StatisticsAlg.h +++ b/Tracker/TrackerRecAlgs/TrackerSpacePointFormation/src/StatisticsAlg.h @@ -61,6 +61,7 @@ namespace Tracker SG::ReadHandleKey<FaserSCT_SpacePointContainer> m_Sct_spcontainerKey{this, "SpacePointsSCTName", "SCT spContainer"}; //@} + SG::ReadHandleKey<Tracker::FaserSCT_ClusterContainer> m_Sct_clcontainerKey{this, "SCT_ClustersName", "SCT clContainer"}; SG::ReadCondHandleKey<TrackerDD::SiDetectorElementCollection> m_SCTDetEleCollKey{this, "SCTDetEleCollKey", "SCT_DetectorElementCollection", "Key of SiDetectorElementCollection for SCT"}; //@} diff --git a/Tracker/TrackerRecAlgs/TrackerSpacePointFormation/src/TrackerSpacePointFinder.cxx b/Tracker/TrackerRecAlgs/TrackerSpacePointFormation/src/TrackerSpacePointFinder.cxx index 47c3aaeb78da501791329edd42e210cd9472093a..4ccfe875bc7a7145520463997ee21fbe51e6749e 100755 --- a/Tracker/TrackerRecAlgs/TrackerSpacePointFormation/src/TrackerSpacePointFinder.cxx +++ b/Tracker/TrackerRecAlgs/TrackerSpacePointFormation/src/TrackerSpacePointFinder.cxx @@ -198,6 +198,7 @@ StatusCode TrackerSpacePointFinder::execute (const EventContext& ctx) const auto spacepointCollection = std::make_unique<FaserSCT_SpacePointCollection>(idHash); spacepointCollection->setIdentifier(elementID); + ATH_MSG_DEBUG( "SCT cluster collection size "<<colNext->size() ); if ( colNext->size() != 0){ addSCT_SpacePoints(colNext, properties, elements, spacepointCollection.get(), spacepointoverlapCollection.ptr(), r_cache); @@ -273,7 +274,6 @@ addSCT_SpacePoints(const Tracker::FaserSCT_ClusterCollection* next, FaserSCT_SpacePointCollection* spacepointCollection, FaserSCT_SpacePointOverlapCollection* spacepointOverlapCollection, SPFCache &r_cache) const { - // Do nothing unless this is a side 1 detector (strips of const phi). IdentifierHash thisHash(next->identifyHash()); // if it is not the stereo side diff --git a/Tracker/TrackerRecAlgs/TrackerSpacePointFormation/test/StatisticsDbg.py b/Tracker/TrackerRecAlgs/TrackerSpacePointFormation/test/StatisticsDbg.py index 55d4ee20812ac529068a8f233524a18a035ab3c8..5ad2fc49b5bbae6d3bf17bfd9b9e77708bc5e96c 100644 --- a/Tracker/TrackerRecAlgs/TrackerSpacePointFormation/test/StatisticsDbg.py +++ b/Tracker/TrackerRecAlgs/TrackerSpacePointFormation/test/StatisticsDbg.py @@ -48,10 +48,10 @@ acc.merge(StatisticsCfg(ConfigFlags)) # Dump config # logging.getLogger('forcomps').setLevel(VERBOSE) -# acc.foreach_component("*").OutputLevel = VERBOSE -# acc.foreach_component("*ClassID*").OutputLevel = INFO -# acc.getCondAlgo("FaserSCT_AlignCondAlg").OutputLevel = VERBOSE -# acc.getCondAlgo("FaserSCT_DetectorElementCondAlg").OutputLevel = VERBOSE +acc.foreach_component("*").OutputLevel = VERBOSE +acc.foreach_component("*ClassID*").OutputLevel = INFO +acc.getCondAlgo("FaserSCT_AlignCondAlg").OutputLevel = VERBOSE +acc.getCondAlgo("FaserSCT_DetectorElementCondAlg").OutputLevel = VERBOSE # acc.getService("StoreGateSvc").Dump = True # acc.getService("ConditionStore").Dump = True # acc.printConfig(withDetails=True) diff --git a/Tracker/TrackerRecEvent/TrackerPrepRawData/TrackerPrepRawData/FaserSCT_ClusterContainer.h b/Tracker/TrackerRecEvent/TrackerPrepRawData/TrackerPrepRawData/FaserSCT_ClusterContainer.h index 80768c29db91f4b66498dcac8826f0e9c046face..153646cdd2081be60bc57500deffb209f22c008c 100755 --- a/Tracker/TrackerRecEvent/TrackerPrepRawData/TrackerPrepRawData/FaserSCT_ClusterContainer.h +++ b/Tracker/TrackerRecEvent/TrackerPrepRawData/TrackerPrepRawData/FaserSCT_ClusterContainer.h @@ -13,8 +13,8 @@ // Version 1.0 25/09/2002 Veronique Boisvert /////////////////////////////////////////////////////////////////// -#ifndef SCT_CLUSTERCONTAINER_H -#define SCT_CLUSTERCONTAINER_H +#ifndef FASERSCT_CLUSTERCONTAINER_H +#define FASERSCT_CLUSTERCONTAINER_H #include "AthenaKernel/CLASS_DEF.h" #include "TrkPrepRawData/PrepRawDataContainer.h" diff --git a/Tracker/TrackerRecEvent/TrackerPrepRawData/TrackerPrepRawData/TrackerSeed.h b/Tracker/TrackerRecEvent/TrackerPrepRawData/TrackerPrepRawData/TrackerSeed.h deleted file mode 100755 index 02d6a193aa081bbd2188288131a98a6bb2708096..0000000000000000000000000000000000000000 --- a/Tracker/TrackerRecEvent/TrackerPrepRawData/TrackerPrepRawData/TrackerSeed.h +++ /dev/null @@ -1,50 +0,0 @@ -#ifndef TRACKERRAWDATA_TRACKERSEED_H -#define TRACKERRAWDATA_TRACKERSEED_H - -#include "TrkSpacePoint/SpacePoint.h" - -#include <vector> - -using namespace std; - -class MsgStream; - -namespace Tracker { - - class TrackerSeed { - - public: - - enum StrategyId{NULLID=0, TRIPLET_SP_FIRSTSTATION=1}; - - TrackerSeed(); - TrackerSeed(const StrategyId, const TrackerSeed &); - virtual ~TrackerSeed(); - - TrackerSeed(const StrategyId, vector<const Trk::SpacePoint*> seed); - - void set_id(const StrategyId id) { m_strategyId = id; } - StrategyId id() const { return m_strategyId; } - - void add(vector<const Trk::SpacePoint*> seed); - - int size() const; - - TrackerSeed &operator=(const TrackerSeed &); - - virtual MsgStream& dump(MsgStream& stream) const; - virtual ostream& dump(ostream& stream) const; - - private: - - StrategyId m_strategyId; - vector<const Trk::SpacePoint*> m_seed; - - }; - - MsgStream& operator << (MsgStream& stream, const TrackerSeed& prd); - ostream& operator << (ostream& stream, const TrackerSeed& prd); - -} -#endif // TRACKERRAWDATA_TRACKERSEED_H - diff --git a/Tracker/TrackerRecEvent/TrackerPrepRawData/TrackerPrepRawData/TrackerSeedCollection.h b/Tracker/TrackerRecEvent/TrackerPrepRawData/TrackerPrepRawData/TrackerSeedCollection.h deleted file mode 100755 index a90dedca94ed8580d9fe74dac784fc9c0ee70e69..0000000000000000000000000000000000000000 --- a/Tracker/TrackerRecEvent/TrackerPrepRawData/TrackerPrepRawData/TrackerSeedCollection.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef TRACKERSEEDCOLLECTION_H -#define TRACKERSEEDCOLLECTION_H - -#include "AthenaKernel/CLASS_DEF.h" -#include "AthContainers/DataVector.h" -#include "GaudiKernel/DataObject.h" -#include "TrackerPrepRawData/TrackerSeed.h" - -namespace Tracker { - typedef DataVector<TrackerSeed> TrackerSeedCollection; -} - -CLASS_DEF(Tracker::TrackerSeedCollection, 1139531114, 1) - -#endif // TRACKERSEEDCOLLECTION_H - diff --git a/Tracker/TrackerRecEvent/TrackerPrepRawData/src/TrackerSeed.cxx b/Tracker/TrackerRecEvent/TrackerPrepRawData/src/TrackerSeed.cxx deleted file mode 100755 index bd217ec892f499994db0f6eb5d557669357a6ef7..0000000000000000000000000000000000000000 --- a/Tracker/TrackerRecEvent/TrackerPrepRawData/src/TrackerSeed.cxx +++ /dev/null @@ -1,44 +0,0 @@ -#include "TrackerPrepRawData/TrackerSeed.h" - -namespace Tracker { - - TrackerSeed::TrackerSeed() : m_strategyId(NULLID) {} - - TrackerSeed::TrackerSeed(const StrategyId id, const TrackerSeed& trackerSeed) : m_strategyId(id), m_seed(trackerSeed.m_seed) {} - - TrackerSeed::~TrackerSeed() {} - - TrackerSeed::TrackerSeed(const StrategyId id, vector<const Trk::SpacePoint*> seed) { m_strategyId = id; m_seed = seed; } - - void TrackerSeed::add(vector<const Trk::SpacePoint*> seed) { m_seed = seed; } - - int TrackerSeed::size() const { return m_seed.size(); } - - TrackerSeed& TrackerSeed::operator=(const TrackerSeed& trackSeed){ - if(&trackSeed != this) { - TrackerSeed::operator=(trackSeed); - m_seed = trackSeed.m_seed; - } - return *this; - } - - MsgStream& TrackerSeed::dump(MsgStream& stream) const { - stream << "TrackerSeed object" << endl; - this->TrackerSeed::dump(stream); - return stream; - } - - ostream& TrackerSeed::dump(ostream& stream) const { - stream << "TrackerSeed object" << endl; - this->TrackerSeed::dump(stream); - return stream; - } - - MsgStream& operator << (MsgStream& stream, const TrackerSeed& trackSeed) { - return trackSeed.dump(stream); - } - - ostream& operator << (ostream& stream, const TrackerSeed& trackSeed) { - return trackSeed.dump(stream); - } -} diff --git a/Tracker/TrackerRecEvent/TrackerSpacePoint/CMakeLists.txt b/Tracker/TrackerRecEvent/TrackerSpacePoint/CMakeLists.txt index f6db26cf0ee432398195ceee621a5d9f31d2490b..bd83f9e974868a8e42bcf1f21562bd527df687c2 100644 --- a/Tracker/TrackerRecEvent/TrackerSpacePoint/CMakeLists.txt +++ b/Tracker/TrackerRecEvent/TrackerSpacePoint/CMakeLists.txt @@ -10,9 +10,14 @@ find_package( Eigen ) # Component(s) in the package: atlas_add_library( TrackerSpacePoint - src/*.cxx src/*.h + src/*.cxx src/*.h PUBLIC_HEADERS TrackerSpacePoint PRIVATE_INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS} - LINK_LIBRARIES Identifier TrkDetElementBase TrkSpacePoint - PRIVATE_LINK_LIBRARIES ${EIGEN_LIBRARIES} GeoPrimitives EventPrimitives TrkSurfaces TrkEventPrimitives TrkPrepRawData TrackerPrepRawData ) + LINK_LIBRARIES Identifier TrkDetElementBase TrkSpacePoint AthLinks TrackerPrepRawData + PRIVATE_LINK_LIBRARIES ${EIGEN_LIBRARIES} GeoPrimitives EventPrimitives TrkSurfaces TrkEventPrimitives TrkPrepRawData ) + +atlas_add_dictionary( TrackerSpacePointDict + TrackerSpacePoint/TrackerSpacePointDict.h + TrackerSpacePoint/selection.xml + LINK_LIBRARIES TrackerSpacePoint) diff --git a/Tracker/TrackerRecEvent/TrackerSpacePoint/TrackerSpacePoint/FaserSCT_SpacePoint.h b/Tracker/TrackerRecEvent/TrackerSpacePoint/TrackerSpacePoint/FaserSCT_SpacePoint.h index 84d788f65c35ffc83a6d791167db785665b38e94..d3ad87a299c9c21f68fee6b2dd1ff7b8e9d8118c 100755 --- a/Tracker/TrackerRecEvent/TrackerSpacePoint/TrackerSpacePoint/FaserSCT_SpacePoint.h +++ b/Tracker/TrackerRecEvent/TrackerSpacePoint/TrackerSpacePoint/FaserSCT_SpacePoint.h @@ -13,15 +13,20 @@ #ifndef TRACKERSPACEPOINT_SCTSPACEPOINT_H #define TRACKERSPACEPOINT_SCTSPACEPOINT_H +#include "AthLinks/ElementLink.h" #include "Identifier/IdentifierHash.h" #include "TrkEventPrimitives/LocalParameters.h" #include "TrkSurfaces/Surface.h" #include "TrackerPrepRawData/FaserSCT_Cluster.h" +#include "TrackerPrepRawData/FaserSCT_ClusterContainer.h" + +class FaserSCT_SpacePointContainerCnv; +class FaserSCT_SpacePointContainerCnv_p0; +class FaserSCT_SpacePointCnv_p0; namespace Tracker { class TrackerCluster; - class FaserSCT_Cluster; } namespace Trk{ @@ -39,6 +44,9 @@ namespace Tracker class FaserSCT_SpacePoint { + friend class FaserSCT_SpacePointContainerCnv; + friend class FaserSCT_SpacePointContainerCnv_p0; + friend class FaserSCT_SpacePointCnv_p0; /////////////////////////////`////////////////////////////////////// // Public methods: @@ -72,6 +80,9 @@ namespace Tracker const Amg::Vector3D& position, const Amg::MatrixX& loccov,//assumes ownership of loccov const std::pair<const FaserSCT_Cluster*, const FaserSCT_Cluster*>* clusList) ; + FaserSCT_SpacePoint(const std::pair<IdentifierHash, IdentifierHash>& elementIdList, + const Amg::Vector3D* position, + const ElementLink<Tracker::FaserSCT_ClusterContainer>& link1, const ElementLink<Tracker::FaserSCT_ClusterContainer>& link2) ; //@} /** Copy Constructor */ @@ -132,6 +143,14 @@ namespace Tracker FaserSCT_SpacePoint& operator=(const FaserSCT_SpacePoint&); FaserSCT_SpacePoint& operator=(FaserSCT_SpacePoint&&) noexcept = default; + //Element link to FaserSCT_Cluster + ElementLink<Tracker::FaserSCT_ClusterContainer>* getElementLink1(){return (&m_elelink1);} + ElementLink<Tracker::FaserSCT_ClusterContainer>* getElementLink2(){return (&m_elelink2);} + const ElementLink<Tracker::FaserSCT_ClusterContainer>* getElementLink1()const {return (&m_elelink1);} + const ElementLink<Tracker::FaserSCT_ClusterContainer>* getElementLink2()const {return (&m_elelink2);} + const Tracker::FaserSCT_Cluster* cluster1() const{if(m_elelink1.isValid())return m_elelink1.cachedElement();else return 0;} + const Tracker::FaserSCT_Cluster* cluster2() const{if(m_elelink2.isValid())return m_elelink2.cachedElement();else return 0;} + protected: Trk::LocalParameters m_localParams; @@ -144,7 +163,8 @@ namespace Tracker private: - void setupGlobalFromLocalCovariance(); + ElementLink<Tracker::FaserSCT_ClusterContainer> m_elelink1, m_elelink2; + void setupGlobalFromLocalCovariance(); /** method to set up the local Covariance Matrix. */ void setupLocalCovarianceSCT() ; diff --git a/Tracker/TrackerRecEvent/TrackerSpacePoint/TrackerSpacePoint/TrackerSpacePointDict.h b/Tracker/TrackerRecEvent/TrackerSpacePoint/TrackerSpacePoint/TrackerSpacePointDict.h new file mode 100644 index 0000000000000000000000000000000000000000..07b3407c20c2c2d33a8cf54fa37e147d3cfcc39e --- /dev/null +++ b/Tracker/TrackerRecEvent/TrackerSpacePoint/TrackerSpacePoint/TrackerSpacePointDict.h @@ -0,0 +1,13 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS and FASER collaborations +*/ + +#ifndef TRACKERSPACEPOINTDICT_H +#define TRACKERSPACEPOINTDICT_H + +#include "TrackerSpacePoint/FaserSCT_SpacePoint.h" +#include "TrackerSpacePoint/FaserSCT_SpacePointCollection.h" +#include "TrackerSpacePoint/FaserSCT_SpacePointOverlapCollection.h" +#include "TrackerSpacePoint/FaserSCT_SpacePointContainer.h" + +#endif diff --git a/Tracker/TrackerRecEvent/TrackerSpacePoint/TrackerSpacePoint/selection.xml b/Tracker/TrackerRecEvent/TrackerSpacePoint/TrackerSpacePoint/selection.xml new file mode 100644 index 0000000000000000000000000000000000000000..e94170445195d4267bcbd1ab99b657a1691f7b52 --- /dev/null +++ b/Tracker/TrackerRecEvent/TrackerSpacePoint/TrackerSpacePoint/selection.xml @@ -0,0 +1,6 @@ +<lcgdict> + <class name="Tracker::FaserSCT_SpacePoint" > + </class> + <class name="FaserSCT_SpacePointCollection<Tracker::FaserSCT_SpacePoint>" id="B1069307-0EEF-48D8-B545-A47D2DFFD8FC" /> + <class name="FaserSCT_SpacePointContainer" /> + </lcgdict> diff --git a/Tracker/TrackerRecEvent/TrackerSpacePoint/src/FaserSCT_SpacePoint.cxx b/Tracker/TrackerRecEvent/TrackerSpacePoint/src/FaserSCT_SpacePoint.cxx index 8f35c38643ae01bd8fccab9e7a2cef689a510afe..068c0ab890bd6526ea5fba3bd6d927133c535b67 100755 --- a/Tracker/TrackerRecEvent/TrackerSpacePoint/src/FaserSCT_SpacePoint.cxx +++ b/Tracker/TrackerRecEvent/TrackerSpacePoint/src/FaserSCT_SpacePoint.cxx @@ -5,6 +5,7 @@ #include "TrkPrepRawData/PrepRawData.h" #include "TrackerSpacePoint/FaserSCT_SpacePoint.h" #include "TrackerPrepRawData/FaserSCT_Cluster.h" +#include "TrackerPrepRawData/FaserSCT_ClusterContainer.h" #include "TrkEventPrimitives/LocalParameters.h" #include "TrkSurfaces/Surface.h" #include "EventPrimitives/EventPrimitivesToStringConverter.h" @@ -26,6 +27,23 @@ namespace Tracker setup(elementIdList,*position,clusList); setupLocalCovarianceSCT(); setupGlobalFromLocalCovariance(); + m_elelink1.setElement(clusList->first); + m_elelink2.setElement(clusList->second); + delete position; + } + + //------------------------------------------------------------- + + FaserSCT_SpacePoint::FaserSCT_SpacePoint(const std::pair<IdentifierHash, IdentifierHash>& elementIdList, + const Amg::Vector3D* position, + const ElementLink<Tracker::FaserSCT_ClusterContainer>& link1, const ElementLink<Tracker::FaserSCT_ClusterContainer>& link2): m_elelink1(link1),m_elelink2(link2) + { + const FaserSCT_Cluster* clus1=link1.cachedElement(); + const FaserSCT_Cluster* clus2=link2.cachedElement(); + const std::pair<const FaserSCT_Cluster*, const FaserSCT_Cluster*> clusList(clus1,clus2); + setup(elementIdList,*position,&clusList); + setupLocalCovarianceSCT(); + setupGlobalFromLocalCovariance(); delete position; } @@ -39,6 +57,8 @@ namespace Tracker m_localCovariance = *loccov; setup(elementIdList,*position,clusList); setupGlobalFromLocalCovariance(); + m_elelink1.setElement(clusList->first); + m_elelink2.setElement(clusList->second); delete loccov; delete position; } @@ -50,6 +70,8 @@ namespace Tracker setup(elementIdList,position,clusList); setupLocalCovarianceSCT(); setupGlobalFromLocalCovariance(); + m_elelink1.setElement(clusList->first); + m_elelink2.setElement(clusList->second); } //------------------------------------------------------------- @@ -62,6 +84,8 @@ namespace Tracker m_localCovariance = loccov; setup(elementIdList,position,clusList); setupGlobalFromLocalCovariance(); + m_elelink1.setElement(clusList->first); + m_elelink2.setElement(clusList->second); }