|
ATLAS Offline Software
|
Go to the documentation of this file.
8 #include <unordered_set>
13 for (
const std::string hitColl : {
"truthMdtHits",
"truthRpcHits",
"truthTgcHits",
"truthCscHits"}) {
47 return StatusCode::SUCCESS;
55 return StatusCode::SUCCESS;
61 const EventContext & context = Gaudi::Hive::currentContext();
66 if(!houghSecVec.isValid()){
67 ATH_MSG_FATAL(
"Failed to retrieve Hough data per sector vector");
68 return StatusCode::FAILURE;
71 std::vector<HitTruthMatching> truthMuons{};
75 if(!truthMuonContainer.
isValid()){
77 return StatusCode::FAILURE;
80 truthMuons.emplace_back(truth_mu);
83 if(!truthSegContainer.
isValid()){
85 return StatusCode::FAILURE;
87 ATH_MSG_DEBUG(
"Houghidipuff retrieved all input collections! Start puffing...");
90 for(
unsigned int sec_i=0; sec_i<houghSecVec->vec.size(); ++sec_i){
93 for (
const std::vector<std::shared_ptr<MuonHough::MuonLayerHough::Maximum>>& maxvec :
94 houghSecVec->vec[sec_i].maxVec){
96 for(
const std::shared_ptr<MuonHough::MuonLayerHough::Maximum>&
max : maxvec){
101 bool firstHit =
true;
104 for (
const std::shared_ptr<MuonHough::Hit>& hit :
max->hits){
157 bool matched = std::find_if(truthMuons.begin(), truthMuons.end(),
159 return hit.assocHits.count(prd->identify());
160 }) != truthMuons.end();
170 for (
const std::vector<std::shared_ptr<MuonHough::MuonPhiLayerHough::Maximum>>& phimaxvec :
171 houghSecVec->vec[sec_i].phiMaxVec){
173 for(
const std::shared_ptr<MuonHough::MuonPhiLayerHough::Maximum>&
max : phimaxvec){
176 bool firstHit =
true;
178 int phiHit_index = 0;
179 for (
const std::shared_ptr<MuonHough::PhiHit>& phi_hit :
max->hits){
233 bool matched = std::find_if(truthMuons.begin(), truthMuons.end(),
235 return hit.assocHits.count(prd->identify());
236 }) != truthMuons.end();
258 if(!truthMuLink.
isAvailable(*truthSeg)) {
continue; }
261 if(truthParticle!=truthMu) {
continue; }
268 int nTriggerHits = truthSeg->nPhiLayers() + truthSeg->nTrigEtaLayers();
275 return StatusCode::SUCCESS;
MuonVal::ScalarBranch< float > & m_maxHit_z0
MuonVal::ScalarBranch< float > & m_maxHit_theta
MuonVal::ScalarBranch< float > & m_maxPhiHit_z0
MuonVal::ThreeVectorBranch m_hit_global
MuonVal::ScalarBranch< int > & m_maxHit_stationIndex
void push_back(const Identifier &id) override final
std::unordered_set< Identifier > assocHits
float ymin
global hit position (x=r in barrel, x=z in endcap)
MuonVal::ScalarBranch< float > & m_maxHit_sector
MuonVal::VectorBranch< int > & m_hit_tgcIndex
StatusCode init(OWNER *instance)
Initialize method.
MuonVal::VectorBranch< int > & m_truth_seg_nPrecisionHits
MuonVal::VectorBranch< int > & m_phiHit_tgcIndex
const HitDebugInfo * debugInfo() const
weight of the hit
float w
maximum value of the hit in the precision coordinate (y=z in barrel, y=r in endcap)
MuonVal::TwoVectorBranch m_hit_local
float r
layer identifier (packed word containing technology/sublayer)
void push_back(const Identifier &id) override final
const xAOD::TruthParticle * truthPart
MuonVal::VectorBranch< float > & m_hit_w
struct containing additional debug information on the hits that is not needed for the actual alg but ...
MuonVal::CscIdentifierBranch m_hit_cscId
MuonVal::TgcIdentifierBranch m_hit_mmId
MuonVal::ThreeVectorBranch m_truth_seg_p
MuonVal::MuonTesterTree m_phi_hit_tree
Class describing a MuonSegment.
virtual StatusCode execute() override
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_truthMuonKey
void push_back(const Identifier &id) override final
MuonVal::ScalarBranch< float > & m_truth_eta
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Helper class to provide constant type-safe access to aux data.
MuonVal::ScalarBranch< int > & m_maxPhiHit_stationIndex
MuonVal::TgcIdentifierBranch m_hit_stgcId
MuonVal::ScalarBranch< int > & m_maxHit_stationEta
MuonVal::VectorBranch< float > & m_phiHit_x
MuonVal::TgcIdentifierBranch m_phiHit_tgcId
SG::ReadHandleKey< Muon::HoughDataPerSectorVec > m_houghDataPerSectorVecKey
MuonVal::VectorBranch< int > & m_truth_seg_nTriggerHits
virtual ~MuonHoughDataNtuple() override
void push_back(const Amg::Vector3D &vec)
interface using the Amg::Vector3D
MuonVal::ScalarBranch< int > & m_truth_barcode
float w
maximum value of the hit in the precision coordinate (y=z in barrel, y=r in endcap)
void push_back(const Identifier &id) override final
MuonVal::ScalarBranch< float > & m_truth_phi
float phimax
minimum value of the hit in the precision coordinate (y=z in barrel, y=r in endcap)
void push_back(const Amg::Vector2D &vec)
interface using the Amg::Vector3D
MuonVal::VectorBranch< int > & m_phiHit_tech
MuonVal::RpcIdentifierBranch m_hit_rpcId
MuonVal::TwoVectorBranch m_phiHit_local
::StatusCode StatusCode
StatusCode definition for legacy code.
MuonVal::ScalarBranch< int > & m_maxPhiHit_stationPhi
Class describing a truth particle in the MC record.
float x
layer identifier (packed word containing technology/sublayer)
MuonVal::VectorBranch< int > & m_hit_rpcIndex
MuonVal::VectorBranch< int > & m_hit_stgcIndex
MuonVal::VectorBranch< float > & m_hit_ymax
MuonVal::ScalarBranch< float > & m_maxPhiHit_sector
MuonVal::MuonTesterTree m_truth_tree
MuonVal::VectorBranch< int > & m_phiHit_mdtIndex
MuonVal::VectorBranch< float > & m_hit_ymin
MuonVal::TgcIdentifierBranch m_phiHit_mmId
MuonVal::VectorBranch< int > & m_hit_cscIndex
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
MuonVal::VectorBranch< int > & m_phiHit_stgcIndex
MuonVal::ScalarBranch< int > & m_maxPhiHit_stationEta
SG::ReadHandleKey< xAOD::MuonSegmentContainer > m_truthSegmentsKey
MuonHoughDataNtuple(const std::string &name, ISvcLocator *pSvcLocator)
MuonVal::TgcIdentifierBranch m_hit_tgcId
virtual bool isValid() override final
Can the handle be successfully dereferenced?
void push_back(const T &value)
Adds a new element at the end of the vector.
ElementLink implementation for ROOT usage.
MuonVal::VectorBranch< int > & m_phiHit_rpcIndex
Identifier identify() const
return the identifier
const Trk::PrepRawData * prd
access to assiciated hit, either the prd or the tgc pointer is set in athena
HitTruthMatching(const xAOD::TruthParticle *_truthPart)
MuonVal::VectorBranch< float > & m_phiHit_ymax
const Amg::Vector2D & localPosition() const
return the local position reference
MuonVal::VectorBranch< int > & m_hit_tech
Class to represent measurements from the Monitored Drift Tubes.
MuonVal::VectorBranch< int > & m_truth_seg_sector
virtual StatusCode initialize() override
MuonVal::VectorBranch< int > & m_hit_mdtIndex
MuonVal::CscIdentifierBranch m_phiHit_cscId
MuonVal::ScalarBranch< int > & m_truth_pdgId
MuonVal::ScalarBranch< float > & m_truth_pt
MuonVal::RpcIdentifierBranch m_phiHit_rpcId
MuonVal::TgcIdentifierBranch m_phiHit_stgcId
MuonVal::VectorBranch< int > & m_hit_mmIndex
MuonVal::ScalarBranch< int > & m_maxHit_region
MuonVal::VectorBranch< float > & m_phiHit_ymin
MuonVal::ScalarBranch< int > & m_maxHit_stationPhi
float phimin
global hit position (x=r in barrel, x=z in endcap)
bool fill(const EventContext &ctx)
Fills the tree per call.
StatusCode write()
Finally write the TTree objects.
const Trk::PrepRawData * prd
access to assiciated hit, either the prd or the tgc pointer is set in athena
MuonVal::ThreeVectorBranch m_phiHit_global
MuonVal::MuonTesterTree m_eta_hit_tree
MuonVal::VectorBranch< bool > & m_hit_truthMatched
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
MuonVal::VectorBranch< int > & m_phiHit_mmIndex
Class representing clusters in the muon system.
float ymax
minimum value of the hit in the precision coordinate (y=z in barrel, y=r in endcap)
virtual StatusCode finalize() override
MuonVal::ThreeVectorBranch m_truth_seg_pos
const HitDebugInfo * debugInfo() const
weight of the hit
MuonVal::VectorBranch< float > & m_hit_x
MuonVal::VectorBranch< int > & m_phiHit_cscIndex
MuonVal::MdtIdentifierBranch m_hit_mdtId
MuonVal::VectorBranch< float > & m_phiHit_w
MuonVal::VectorBranch< bool > & m_phiHit_truthMatched
bool addBranch(std::shared_ptr< IMuonTesterBranch > branch)
Branch is added to the tree without transferring the ownership.
MuonVal::MdtIdentifierBranch m_phiHit_mdtId