Skip to content
Snippets Groups Projects
Commit 3a55475c authored by Vakhtang Tsulaia's avatar Vakhtang Tsulaia
Browse files

Merge branch 'master-ATLASRECTS-4575-InDetPrepRawDataToxAOD' into 'master'

Cleanup of SCT_RawDataToxAOD and SCT_PrepDataToxAOD (ATLASRECTS-4575)

See merge request atlas/athena!16692

Former-commit-id: 275bff90
parents 120e55a4 d52e485e
No related branches found
No related tags found
No related merge requests found
/* /*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
*/ */
/////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////
...@@ -25,11 +25,11 @@ ...@@ -25,11 +25,11 @@
#include "StoreGate/ReadHandleKey.h" #include "StoreGate/ReadHandleKey.h"
#include "StoreGate/WriteHandleKey.h" #include "StoreGate/WriteHandleKey.h"
#include <atomic>
#include <string> #include <string>
class SCT_ID; class SCT_ID;
class SiHit; class SiHit;
class InDetSimDataCollection;
class SCT_RDORawData; class SCT_RDORawData;
class Identifier; class Identifier;
...@@ -70,26 +70,25 @@ private: ...@@ -70,26 +70,25 @@ private:
const SCT_ID *m_SCTHelper; const SCT_ID *m_SCTHelper;
SG::ReadHandleKey<InDet::SCT_ClusterContainer> m_clustercontainer; SG::ReadHandleKey<InDet::SCT_ClusterContainer> m_clustercontainer{this, "SiClusterContainer", "SCT_Clusters"};
SG::ReadHandleKey<InDetSimDataCollection> m_SDOcontainer; SG::ReadHandleKey<InDetSimDataCollection> m_SDOcontainer{this, "MC_SDOs", "SCT_SDO_Map"};
SG::ReadHandleKey<SiHitCollection> m_sihitContainer; SG::ReadHandleKey<SiHitCollection> m_sihitContainer{this, "MC_Hits", "SCT_Hits"};
SG::ReadHandleKey<PRD_MultiTruthCollection> m_multiTruth; SG::ReadHandleKey<PRD_MultiTruthCollection> m_multiTruth{this, "PRD_MultiTruth", "PRD_MultiTruthSCT"};
SG::ReadHandleKey<SCT_RDO_Container> m_rdoContainer; SG::ReadHandleKey<SCT_RDO_Container> m_rdoContainer{this, "SctRdoContainer", "SCT_RDOs"};
SG::WriteHandleKey<xAOD::TrackMeasurementValidationContainer> m_xAodContainer; SG::WriteHandleKey<xAOD::TrackMeasurementValidationContainer> m_xAodContainer{this, "SctxAodContainer", "SCT_Clusters"};
SG::WriteHandleKey<std::vector<unsigned int> > m_xAodOffset; SG::WriteHandleKey<std::vector<unsigned int> > m_xAodOffset{this, "SctxAodOffset", "SCT_ClustersOffsets"};
// For P->T converter of SCT_Clusters // For P->T converter of SCT_Clusters
SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> m_SCTDetEleCollKey{this, "SCTDetEleCollKey", "SCT_DetectorElementCollection", "Key of SiDetectorElementCollection for SCT"}; SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> m_SCTDetEleCollKey{this, "SCTDetEleCollKey", "SCT_DetectorElementCollection", "Key of SiDetectorElementCollection for SCT"};
bool m_useTruthInfo; BooleanProperty m_useTruthInfo{this, "UseTruthInfo", false};
bool m_writeRDOinformation; BooleanProperty m_writeRDOinformation{this, "WriteRDOinformation", true};
bool m_writeSDOs; BooleanProperty m_writeSDOs{this, "WriteSDOs", true};
bool m_writeSiHits; BooleanProperty m_writeSiHits{this, "WriteSiHits", true};
// --- private members // --- private members
bool m_firstEventWarnings; std::atomic_bool m_firstEventWarnings;
}; };
#endif // SCT_PREPDATATOXAOD_H
#endif
/* /*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
*/ */
/////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////
...@@ -9,26 +9,21 @@ ...@@ -9,26 +9,21 @@
#include "SCT_RawDataToxAOD.h" #include "SCT_RawDataToxAOD.h"
#include "GaudiKernel/ServiceHandle.h" #include "InDetIdentifier/SCT_ID.h"
#include "StoreGate/ReadHandle.h" #include "StoreGate/ReadHandle.h"
#include "StoreGate/WriteHandle.h" #include "StoreGate/WriteHandle.h"
#include "InDetIdentifier/SCT_ID.h"
// xAOD container type // xAOD container type
#include "xAODTracking/SCTRawHitValidationAuxContainer.h" #include "xAODTracking/SCTRawHitValidationAuxContainer.h"
SCT_RawDataToxAOD::SCT_RawDataToxAOD(const std::string &name, SCT_RawDataToxAOD::SCT_RawDataToxAOD(const std::string &name,
ISvcLocator *pSvcLocator) ISvcLocator *pSvcLocator)
: AthAlgorithm(name, pSvcLocator), : AthAlgorithm(name, pSvcLocator),
m_SCTHelper(0) m_SCTHelper{nullptr}
{ {
declareProperty("SctRdoContainer", m_rdoContainerName = std::string("SCT_RDOs"));
declareProperty("SctxAodRawHitContainer", m_xAodRawHitContainerName = std::string("SCT_RawHits"));
} }
StatusCode SCT_RawDataToxAOD::initialize() { StatusCode SCT_RawDataToxAOD::initialize() {
CHECK(detStore()->retrieve(m_SCTHelper, "SCT_ID")); ATH_CHECK(detStore()->retrieve(m_SCTHelper, "SCT_ID"));
ATH_CHECK(m_rdoContainerName.initialize()); ATH_CHECK(m_rdoContainerName.initialize());
ATH_CHECK(m_xAodRawHitContainerName.initialize()); ATH_CHECK(m_xAodRawHitContainerName.initialize());
return StatusCode::SUCCESS; return StatusCode::SUCCESS;
...@@ -47,8 +42,8 @@ StatusCode SCT_RawDataToxAOD::execute() { ...@@ -47,8 +42,8 @@ StatusCode SCT_RawDataToxAOD::execute() {
// Create the output xAOD container and its auxiliary store: // Create the output xAOD container and its auxiliary store:
SG::WriteHandle<xAOD::SCTRawHitValidationContainer> xaod(m_xAodRawHitContainerName); SG::WriteHandle<xAOD::SCTRawHitValidationContainer> xaod(m_xAodRawHitContainerName);
ATH_CHECK( xaod.record(std::make_unique<xAOD::SCTRawHitValidationContainer>(), ATH_CHECK(xaod.record(std::make_unique<xAOD::SCTRawHitValidationContainer>(),
std::make_unique<xAOD::SCTRawHitValidationAuxContainer>()) ); std::make_unique<xAOD::SCTRawHitValidationAuxContainer>()));
/// loop over input RDOs /// loop over input RDOs
for (const SCT_RDO_Collection* collection : *rdoContainer) { for (const SCT_RDO_Collection* collection : *rdoContainer) {
...@@ -62,7 +57,7 @@ StatusCode SCT_RawDataToxAOD::execute() { ...@@ -62,7 +57,7 @@ StatusCode SCT_RawDataToxAOD::execute() {
xrdo->setWord(rdo->getWord()); xrdo->setWord(rdo->getWord());
// setting additional decorations based on identifier // setting additional decorations based on identifier
bec_acc(*xrdo) = m_SCTHelper->barrel_ec(id); bec_acc(*xrdo) = m_SCTHelper->barrel_ec(id);
layer_acc(*xrdo) = m_SCTHelper->layer_disk(id); layer_acc(*xrdo) = m_SCTHelper->layer_disk(id);
phi_module_acc(*xrdo) = m_SCTHelper->phi_module(id); phi_module_acc(*xrdo) = m_SCTHelper->phi_module(id);
eta_module_acc(*xrdo) = m_SCTHelper->eta_module(id); eta_module_acc(*xrdo) = m_SCTHelper->eta_module(id);
side_acc(*xrdo) = m_SCTHelper->side(id); side_acc(*xrdo) = m_SCTHelper->side(id);
......
// -*- C++ -*- // -*- C++ -*-
/* /*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
*/ */
#ifndef SCT_RAWDATATOXAOD_H #ifndef SCT_RAWDATATOXAOD_H
#define SCT_RAWDATATOXAOD_H #define SCT_RAWDATATOXAOD_H
#include <string>
#include "AthenaBaseComps/AthAlgorithm.h" #include "AthenaBaseComps/AthAlgorithm.h"
// StoreGate Data Handle Key // StoreGate Data Handle Key
...@@ -19,6 +17,8 @@ ...@@ -19,6 +17,8 @@
// xAOD container type // xAOD container type
#include "xAODTracking/SCTRawHitValidationContainer.h" #include "xAODTracking/SCTRawHitValidationContainer.h"
#include <string>
class ISvcLocator; class ISvcLocator;
class SCT_ID; class SCT_ID;
...@@ -35,9 +35,8 @@ public: ...@@ -35,9 +35,8 @@ public:
private: private:
const SCT_ID* m_SCTHelper; const SCT_ID* m_SCTHelper;
std::string m_clustercontainer; SG::ReadHandleKey<SCT_RDO_Container> m_rdoContainerName{this, "SctRdoContainer", "SCT_RDOs"};
SG::ReadHandleKey<SCT_RDO_Container> m_rdoContainerName; SG::WriteHandleKey<xAOD::SCTRawHitValidationContainer> m_xAodRawHitContainerName{this, "SctxAodRawHitContainer", "SCT_RawHits"};
SG::WriteHandleKey<xAOD::SCTRawHitValidationContainer> m_xAodRawHitContainerName;
}; };
#endif #endif // SCT_RAWDATATOXAOD_H
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment