diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMSimHitVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMSimHitVariables.cxx index 9bc13a6f913519772d3c1ad27b3a75b2a6a6221d..60d1203c437e3d5e8fe1688f5b6ae43950d10737 100644 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMSimHitVariables.cxx +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMSimHitVariables.cxx @@ -173,7 +173,7 @@ StatusCode MMSimHitVariables::fillVariables(const MuonGM::MuonDetectorManager* M // int LastStripNumber = detEl->stripNumber(posOnTopSurf, offId); // perform bound check - if( !surf.insideBounds(posOnSurf) ) continue; + m_NSWMM_isInsideBounds->push_back( surf.insideBounds(posOnSurf) ); if( stripNumber == -1 ){ ATH_MSG_WARNING("MicroMegas validation: failed to obtain strip number " << m_MmIdHelper->print_to_string(offId) ); @@ -249,6 +249,7 @@ StatusCode MMSimHitVariables::clearVariables() m_NSWMM_nSimHits = 0; m_NSWMM_trackId->clear(); m_NSWMM_globalTime->clear(); + m_NSWMM_isInsideBounds->clear(); m_NSWMM_hitGlobalPositionX->clear(); m_NSWMM_hitGlobalPositionY->clear(); m_NSWMM_hitGlobalPositionZ->clear(); @@ -301,6 +302,7 @@ void MMSimHitVariables::deleteVariables() delete m_NSWMM_trackId; delete m_NSWMM_globalTime; + delete m_NSWMM_isInsideBounds; delete m_NSWMM_hitGlobalPositionX; delete m_NSWMM_hitGlobalPositionY; delete m_NSWMM_hitGlobalPositionZ; @@ -350,6 +352,7 @@ void MMSimHitVariables::deleteVariables() m_NSWMM_trackId = nullptr; m_NSWMM_globalTime = nullptr; + m_NSWMM_isInsideBounds = nullptr; m_NSWMM_hitGlobalPositionX = nullptr; m_NSWMM_hitGlobalPositionY = nullptr; m_NSWMM_hitGlobalPositionZ = nullptr; @@ -403,6 +406,7 @@ StatusCode MMSimHitVariables::initializeVariables() m_NSWMM_nSimHits = 0; m_NSWMM_trackId = new std::vector<int>; m_NSWMM_globalTime = new std::vector<double>; + m_NSWMM_isInsideBounds = new std::vector<bool>; m_NSWMM_hitGlobalPositionX = new std::vector<double>; m_NSWMM_hitGlobalPositionY = new std::vector<double>; m_NSWMM_hitGlobalPositionZ = new std::vector<double>; @@ -453,6 +457,7 @@ StatusCode MMSimHitVariables::initializeVariables() m_tree->Branch("Hits_MM_n", &m_NSWMM_nSimHits, "Hits_MM_n/i"); m_tree->Branch("Hits_MM_trackId", &m_NSWMM_trackId); m_tree->Branch("Hits_MM_globalTime", &m_NSWMM_globalTime); + m_tree->Branch("Hits_MM_isInsideBounds", &m_NSWMM_isInsideBounds); m_tree->Branch("Hits_MM_hitGlobalPositionX", &m_NSWMM_hitGlobalPositionX); m_tree->Branch("Hits_MM_hitGlobalPositionY", &m_NSWMM_hitGlobalPositionY); m_tree->Branch("Hits_MM_hitGlobalPositionZ", &m_NSWMM_hitGlobalPositionZ); diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMSimHitVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMSimHitVariables.h index f6cfe49f683e878a81a6c2fa8e129f0648d766bb..98ea96b56a757a7dd288af1952e88186906e28c9 100644 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMSimHitVariables.h +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MMSimHitVariables.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef MMSIMHITVARIABLES_H @@ -23,6 +23,7 @@ class MMSimHitVariables : public ValAlgVariables m_MmIdHelper(0), m_NSWMM_nSimHits(0), m_NSWMM_trackId(0), + m_NSWMM_isInsideBounds(0), m_NSWMM_globalTime(0), m_NSWMM_hitGlobalPositionX(0), m_NSWMM_hitGlobalPositionY(0), @@ -89,6 +90,7 @@ class MMSimHitVariables : public ValAlgVariables int m_NSWMM_nSimHits; std::vector<int> *m_NSWMM_trackId; + std::vector<bool> *m_NSWMM_isInsideBounds; std::vector<double> *m_NSWMM_globalTime; std::vector<double> *m_NSWMM_hitGlobalPositionX; std::vector<double> *m_NSWMM_hitGlobalPositionY; diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCDigitVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCDigitVariables.cxx index 00f169bc25497a69fd3335502444f5fee8862389..6f0548591b413a3007090493e9333b7bee1f1dd8 100644 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCDigitVariables.cxx +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCDigitVariables.cxx @@ -146,7 +146,6 @@ StatusCode sTGCDigitVariables::fillVariables(const MuonGM::MuonDetectorManager* return StatusCode::SUCCESS; } - /** ---------- clearing of variables */ /** ---------- to be called inside filling method before filling starts */ StatusCode sTGCDigitVariables::clearVariables() @@ -189,6 +188,9 @@ StatusCode sTGCDigitVariables::clearVariables() m_NSWsTGC_dig_globalPosX->clear(); m_NSWsTGC_dig_globalPosY->clear(); m_NSWsTGC_dig_globalPosZ->clear(); + m_NSWsTGC_dig_PadglobalCornerPosX->clear(); + m_NSWsTGC_dig_PadglobalCornerPosY->clear(); + m_NSWsTGC_dig_PadglobalCornerPosZ->clear(); return StatusCode::SUCCESS; } @@ -240,6 +242,9 @@ StatusCode sTGCDigitVariables::initializeVariables() m_NSWsTGC_dig_globalPosX = new std::vector<double>(); m_NSWsTGC_dig_globalPosY = new std::vector<double>(); m_NSWsTGC_dig_globalPosZ = new std::vector<double>(); + m_NSWsTGC_dig_PadglobalCornerPosX = new std::vector<double>(); + m_NSWsTGC_dig_PadglobalCornerPosY = new std::vector<double>(); + m_NSWsTGC_dig_PadglobalCornerPosZ = new std::vector<double>(); if(m_tree) { ATH_MSG_DEBUG("sTGC digit: init m_tree "); @@ -325,6 +330,9 @@ void sTGCDigitVariables::deleteVariables() delete m_NSWsTGC_dig_globalPosX; delete m_NSWsTGC_dig_globalPosY; delete m_NSWsTGC_dig_globalPosZ; + delete m_NSWsTGC_dig_PadglobalCornerPosX; + delete m_NSWsTGC_dig_PadglobalCornerPosY; + delete m_NSWsTGC_dig_PadglobalCornerPosZ; delete m_NSWsTGC_dig_time; delete m_NSWsTGC_dig_bctag; @@ -370,6 +378,9 @@ void sTGCDigitVariables::deleteVariables() m_NSWsTGC_dig_globalPosX = nullptr; m_NSWsTGC_dig_globalPosY = nullptr; m_NSWsTGC_dig_globalPosZ = nullptr; + m_NSWsTGC_dig_PadglobalCornerPosX = nullptr; + m_NSWsTGC_dig_PadglobalCornerPosY = nullptr; + m_NSWsTGC_dig_PadglobalCornerPosZ = nullptr; return; } diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCPRDVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCPRDVariables.cxx index 6ea6a8607c2ccbf0a7b83b659db69a7793052ee3..aa7ac9764eaf9b66326d13793fb5b080b997f13f 100644 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCPRDVariables.cxx +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCPRDVariables.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "sTGCPRDVariables.h" @@ -14,7 +14,6 @@ StatusCode sTGCPRDVariables::fillVariables(const MuonGM::MuonDetectorManager* Mu { ATH_MSG_DEBUG("do fillNSWsTGCPRDVariables()"); ATH_MSG_VERBOSE("MuonDetectorManager from Conditions Store accessed" << MuonDetMgr); - CHECK( this->clearVariables() ); const Muon::sTgcPrepDataContainer *nsw_sTgcPrepDataContainer = nullptr; @@ -35,6 +34,8 @@ StatusCode sTGCPRDVariables::fillVariables(const MuonGM::MuonDetectorManager* Mu int gas_gap = m_sTgcIdHelper->gasGap(Id); int channel_type = m_sTgcIdHelper->channelType(Id); int channel = m_sTgcIdHelper->channel(Id); + int charge = prd->charge(); + uint16_t bcTag = prd->getBcBitMap(); ATH_MSG_DEBUG( "sTGC PRD Offline id: Station Name [" << stName << "]" << " Station Eta [" << stationEta << "]" @@ -51,6 +52,8 @@ StatusCode sTGCPRDVariables::fillVariables(const MuonGM::MuonDetectorManager* Mu m_NSWsTGC_prd_gas_gap->push_back(gas_gap); m_NSWsTGC_prd_channel_type->push_back(channel_type); m_NSWsTGC_prd_channel->push_back(channel); + m_NSWsTGC_prd_charge->push_back(charge); + m_NSWsTGC_prd_bcTag->push_back(bcTag); const MuonGM::sTgcReadoutElement* det = prd->detectorElement(); Amg::Vector3D pos = prd->globalPosition(); @@ -92,6 +95,8 @@ void sTGCPRDVariables::deleteVariables() delete m_NSWsTGC_prd_gas_gap; delete m_NSWsTGC_prd_channel_type; delete m_NSWsTGC_prd_channel; + delete m_NSWsTGC_prd_charge; + delete m_NSWsTGC_prd_bcTag; delete m_NSWsTGC_prd_globalPosX; delete m_NSWsTGC_prd_globalPosY; @@ -110,6 +115,8 @@ void sTGCPRDVariables::deleteVariables() m_NSWsTGC_prd_gas_gap = nullptr; m_NSWsTGC_prd_channel_type = nullptr; m_NSWsTGC_prd_channel = nullptr; + m_NSWsTGC_prd_charge = nullptr; + m_NSWsTGC_prd_bcTag = nullptr; m_NSWsTGC_prd_globalPosX = nullptr; m_NSWsTGC_prd_globalPosY = nullptr; @@ -135,6 +142,8 @@ StatusCode sTGCPRDVariables::clearVariables() m_NSWsTGC_prd_gas_gap ->clear(); m_NSWsTGC_prd_channel_type->clear(); m_NSWsTGC_prd_channel ->clear(); + m_NSWsTGC_prd_charge ->clear(); + m_NSWsTGC_prd_bcTag ->clear(); m_NSWsTGC_prd_globalPosX ->clear(); m_NSWsTGC_prd_globalPosY ->clear(); @@ -159,6 +168,8 @@ StatusCode sTGCPRDVariables::initializeVariables() m_NSWsTGC_prd_gas_gap = new std::vector<int>; m_NSWsTGC_prd_channel_type = new std::vector<int>; m_NSWsTGC_prd_channel = new std::vector<int>; + m_NSWsTGC_prd_charge = new std::vector<int>; + m_NSWsTGC_prd_bcTag = new std::vector<uint16_t>; m_NSWsTGC_prd_globalPosX = new std::vector<double>; m_NSWsTGC_prd_globalPosY = new std::vector<double>; @@ -178,6 +189,8 @@ StatusCode sTGCPRDVariables::initializeVariables() m_tree->Branch("PRD_sTGC_gas_gap", &m_NSWsTGC_prd_gas_gap); m_tree->Branch("PRD_sTGC_channel_type",&m_NSWsTGC_prd_channel_type); m_tree->Branch("PRD_sTGC_channel", &m_NSWsTGC_prd_channel); + m_tree->Branch("PRD_sTGC_charge", &m_NSWsTGC_prd_charge); + m_tree->Branch("PRD_sTGC_bcTag", &m_NSWsTGC_prd_bcTag); m_tree->Branch("PRD_sTGC_globalPosX", &m_NSWsTGC_prd_globalPosX); m_tree->Branch("PRD_sTGC_globalPosY", &m_NSWsTGC_prd_globalPosY); diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCPRDVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCPRDVariables.h index b85697c089a0c3f4fafca2d019423347c072e6ff..18c0625ac93ff45b38babccfec7c85ca628215d7 100644 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCPRDVariables.h +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCPRDVariables.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef STGCPRDVARIABLES_H @@ -29,6 +29,8 @@ class sTGCPRDVariables : public ValAlgVariables m_NSWsTGC_prd_gas_gap(0), m_NSWsTGC_prd_channel_type(0), m_NSWsTGC_prd_channel(0), + m_NSWsTGC_prd_charge(0), + m_NSWsTGC_prd_bcTag(0), m_NSWsTGC_prd_globalPosX(0), m_NSWsTGC_prd_globalPosY(0), m_NSWsTGC_prd_globalPosZ(0), @@ -71,6 +73,8 @@ class sTGCPRDVariables : public ValAlgVariables std::vector<int> *m_NSWsTGC_prd_gas_gap; std::vector<int> *m_NSWsTGC_prd_channel_type; std::vector<int> *m_NSWsTGC_prd_channel; + std::vector<int> *m_NSWsTGC_prd_charge; + std::vector<uint16_t> *m_NSWsTGC_prd_bcTag; std::vector<double> *m_NSWsTGC_prd_globalPosX; std::vector<double> *m_NSWsTGC_prd_globalPosY; diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCRDOVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCRDOVariables.cxx index 7522921d80ba163fa99564e9a2b29e55f4e94d30..c5aeea59fa8a6b5d588552976aa99425ba77e117 100644 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCRDOVariables.cxx +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCRDOVariables.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "sTGCRDOVariables.h" @@ -150,7 +150,7 @@ StatusCode sTGCRDOVariables::initializeVariables() m_NSWsTGC_rdo_channel = new std::vector<int>(); m_NSWsTGC_rdo_channel_type= new std::vector<int>(); m_NSWsTGC_rdo_time = new std::vector<double>(); - m_NSWsTGC_rdo_charge = new std::vector<double>(); + m_NSWsTGC_rdo_charge = new std::vector<uint16_t>(); m_NSWsTGC_rdo_bcTag = new std::vector<uint16_t>(); m_NSWsTGC_rdo_isDead = new std::vector<bool>(); diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCRDOVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCRDOVariables.h index df2401f0983c988abed864e44d173dc2a8cbf8be..3d7065337d5a92d61ea3d00ed431045d90cf3c9a 100644 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCRDOVariables.h +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCRDOVariables.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef STGCRDOVARIABLES_H @@ -71,7 +71,7 @@ class sTGCRDOVariables : public ValAlgVariables std::vector<int> *m_NSWsTGC_rdo_channel; std::vector<int> *m_NSWsTGC_rdo_channel_type; std::vector<double> *m_NSWsTGC_rdo_time; - std::vector<double> *m_NSWsTGC_rdo_charge; + std::vector<uint16_t> *m_NSWsTGC_rdo_charge; std::vector<uint16_t> *m_NSWsTGC_rdo_bcTag; std::vector<bool> *m_NSWsTGC_rdo_isDead; diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCSDOVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCSDOVariables.cxx index 6bc00d607257badb12a2a4a54b3daec9ebfe31a6..7e0d06fc996145bcc3b01ca13d0c98116c4c6f7b 100644 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCSDOVariables.cxx +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCSDOVariables.cxx @@ -1,11 +1,12 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "sTGCSDOVariables.h" #include "AthenaBaseComps/AthAlgorithm.h" #include "MuonSimData/MuonSimDataCollection.h" +#include "MuonReadoutGeometry/sTgcReadoutElement.h" #include "TTree.h" @@ -69,18 +70,36 @@ StatusCode sTGCSDOVariables::fillVariables(const MuonGM::MuonDetectorManager* Mu double MuonMCdata_firstentry = deposits[0].second.firstEntry(); double MuonMCdata_secondentry = deposits[0].second.secondEntry(); - ATH_MSG_DEBUG("MicroMegas SDO barcode=" << barcode); - ATH_MSG_DEBUG("MicroMegas SDO localPosX=" << std::setw(9) << std::setprecision(2) << MuonMCdata_firstentry - << ", localPosY=" << std::setw(9) << std::setprecision(2) << MuonMCdata_secondentry); + ATH_MSG_DEBUG("sTGC SDO barcode=" << barcode); + ATH_MSG_DEBUG("sTGC SDO energy=" << std::setw(9) << std::setprecision(2) << MuonMCdata_firstentry + << ", tof=" << std::setw(9) << std::setprecision(2) << MuonMCdata_secondentry); m_NSWsTGC_sdo_barcode->push_back( barcode ); m_NSWsTGC_sdo_E->push_back( MuonMCdata_firstentry ); m_NSWsTGC_sdo_tof->push_back( MuonMCdata_secondentry ); + // Retrive the detector element and local SDO coordinates + bool isSmall = stName[2] == 'S'; + const MuonGM::sTgcReadoutElement* rdoEl = MuonDetMgr->getsTgcRElement_fromIdFields(isSmall, stationEta, stationPhi, multiplet ); + + if( !rdoEl ){ + ATH_MSG_WARNING("sTGC geometry, failed to retrieve detector element for: isSmall " << isSmall << " eta " << stationEta + << " phi " << stationPhi << " multiplet " << multiplet ); + } + + Amg::Vector2D loc_pos(0., 0.); + rdoEl->surface(Id).globalToLocal(hit_gpos, Amg::Vector3D(0., 0., 0.), loc_pos); + + ATH_MSG_DEBUG("sTGC SDO local position X=" << std::setw(9) << std::setprecision(2) << loc_pos[0] + << ", local position Y=" << std::setw(9) << std::setprecision(2) << loc_pos[1]); + + m_NSWsTGC_sdo_localPosX->push_back( loc_pos[0] ); + m_NSWsTGC_sdo_localPosY->push_back( loc_pos[1] ); + m_NSWsTGC_nsdo++; } - ATH_MSG_DEBUG("Processed " << m_NSWsTGC_nsdo << " MicroMegas SDOs"); + ATH_MSG_DEBUG("Processed " << m_NSWsTGC_nsdo << " sTGC SDOs"); return StatusCode::SUCCESS; } @@ -105,6 +124,9 @@ void sTGCSDOVariables::deleteVariables() delete m_NSWsTGC_sdo_E; delete m_NSWsTGC_sdo_tof; + delete m_NSWsTGC_sdo_localPosX; + delete m_NSWsTGC_sdo_localPosY; + m_NSWsTGC_nsdo = 0; m_NSWsTGC_sdo_stationName = nullptr; m_NSWsTGC_sdo_stationEta = nullptr; @@ -124,6 +146,9 @@ void sTGCSDOVariables::deleteVariables() m_NSWsTGC_sdo_E = nullptr; m_NSWsTGC_sdo_tof = nullptr; + m_NSWsTGC_sdo_localPosX = nullptr; + m_NSWsTGC_sdo_localPosY = nullptr; + return; } @@ -147,6 +172,8 @@ StatusCode sTGCSDOVariables::clearVariables() m_NSWsTGC_sdo_globaltime->clear(); m_NSWsTGC_sdo_E->clear(); m_NSWsTGC_sdo_tof->clear(); + m_NSWsTGC_sdo_localPosX->clear(); + m_NSWsTGC_sdo_localPosY->clear(); return StatusCode::SUCCESS; } @@ -173,6 +200,9 @@ StatusCode sTGCSDOVariables::initializeVariables() m_NSWsTGC_sdo_E = new std::vector<double>(); m_NSWsTGC_sdo_tof = new std::vector<double>(); + m_NSWsTGC_sdo_localPosX = new std::vector<double>; + m_NSWsTGC_sdo_localPosY = new std::vector<double>; + if(m_tree) { m_tree->Branch("SDO_sTGC", &m_NSWsTGC_nsdo, "SDOs_sTGC_n/i"); @@ -193,7 +223,10 @@ StatusCode sTGCSDOVariables::initializeVariables() m_tree->Branch("SDO_sTGC_Energy", &m_NSWsTGC_sdo_E); m_tree->Branch("SDO_sTGC_tof", &m_NSWsTGC_sdo_tof); + m_tree->Branch("SDO_sTGC_localPosX", &m_NSWsTGC_sdo_localPosX); + m_tree->Branch("SDO_sTGC_localPosY", &m_NSWsTGC_sdo_localPosY); + } return StatusCode::SUCCESS; -} +} \ No newline at end of file diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCSDOVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCSDOVariables.h index 6c849614fd9f132db3e2569e8d5303b862ad1146..c5f6bb1fc8e5e01ce7d69595e6d0cf81976541f0 100644 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCSDOVariables.h +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCSDOVariables.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef STGCSDOVARIABLES_H @@ -37,7 +37,9 @@ class sTGCSDOVariables : public ValAlgVariables m_NSWsTGC_sdo_globalPosZ(0), m_NSWsTGC_sdo_globaltime(0), m_NSWsTGC_sdo_E(0), - m_NSWsTGC_sdo_tof(0) + m_NSWsTGC_sdo_tof(0), + m_NSWsTGC_sdo_localPosX(0), + m_NSWsTGC_sdo_localPosY(0) { setHelper(idhelper); } @@ -84,6 +86,9 @@ class sTGCSDOVariables : public ValAlgVariables std::vector<double> *m_NSWsTGC_sdo_E; std::vector<double> *m_NSWsTGC_sdo_tof; + std::vector<double> *m_NSWsTGC_sdo_localPosX; + std::vector<double> *m_NSWsTGC_sdo_localPosY; + }; #endif // STGCSDOVARIABLE_H diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCSimHitVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCSimHitVariables.cxx index f177401cb02299505d14cbe1d5d5b09075fdf9fc..cbef17f2cdfdf2fd26d4010b7ae354fb290003d8 100644 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCSimHitVariables.cxx +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCSimHitVariables.cxx @@ -71,6 +71,7 @@ StatusCode sTGCSimHitVariables::fillVariables(const MuonGM::MuonDetectorManager* // convert simHit id to offline id; make sanity checks; retrieve the associated detector element. Identifier offId = simToOffline.convert(hit.sTGCId()); + std::string stName = m_sTgcIdHelper->stationNameString(m_sTgcIdHelper->stationName(offId)); int off_stationEta = m_sTgcIdHelper->stationEta(offId); int off_stationPhi = m_sTgcIdHelper->stationPhi(offId); @@ -82,8 +83,8 @@ StatusCode sTGCSimHitVariables::fillVariables(const MuonGM::MuonDetectorManager* int isSmall = stName[2] == 'S'; if( type == 2 && off_channel == 63) { - ATH_MSG_DEBUG("Found sTGC Wire Sim Hit with channel number 63 (dead region), skipping this hit"); - continue; + ATH_MSG_DEBUG("Found sTGC Wire Sim Hit with channel number 63 (dead region), skipping this hit"); + continue; } const MuonGM::sTgcReadoutElement* detEl = MuonDetMgr->getsTgcReadoutElement(offId); @@ -168,6 +169,9 @@ StatusCode sTGCSimHitVariables::fillVariables(const MuonGM::MuonDetectorManager* // hitOnSurface.x() will be susequent smeared to simulate the detector resolution, here we do not apply any smearing Amg::Vector2D posOnSurf(hitOnSurface.x(), rSurface_pos.y()); + // remember whether the given hit is inside the active volume (and produces a valid digit) + m_NSWsTGC_isInsideBounds->push_back( surf.insideBounds(posOnSurf) ); + int stripNumber = detEl->stripNumber(posOnSurf,newId); if( stripNumber == -1 ){ ATH_MSG_WARNING("sTGC validation: failed to obtain strip number " << m_sTgcIdHelper->print_to_string(offId) ); @@ -255,6 +259,8 @@ StatusCode sTGCSimHitVariables::clearVariables() m_NSWsTGC_nSimHits = 0; m_NSWsTGC_trackId->clear(); + m_NSWsTGC_isInsideBounds->clear(); + m_NSWsTGC_globalTime->clear(); m_NSWsTGC_hitGlobalPositionX->clear(); m_NSWsTGC_hitGlobalPositionY->clear(); @@ -368,6 +374,8 @@ void sTGCSimHitVariables::deleteVariables() m_NSWsTGC_nSimHits = 0; m_NSWsTGC_trackId = nullptr; + m_NSWsTGC_isInsideBounds = nullptr; + m_NSWsTGC_globalTime = nullptr; m_NSWsTGC_hitGlobalPositionX = nullptr; m_NSWsTGC_hitGlobalPositionY = nullptr; @@ -426,6 +434,8 @@ StatusCode sTGCSimHitVariables::initializeVariables() m_NSWsTGC_nSimHits = 0; m_NSWsTGC_trackId = new std::vector<int>(); + m_NSWsTGC_isInsideBounds = new std::vector<bool>; + m_NSWsTGC_globalTime = new std::vector<double>; m_NSWsTGC_hitGlobalPositionX = new std::vector<double>; m_NSWsTGC_hitGlobalPositionY = new std::vector<double>; @@ -481,6 +491,8 @@ StatusCode sTGCSimHitVariables::initializeVariables() m_tree->Branch("Hits_sTGC_n", &m_NSWsTGC_nSimHits, "Hits_sTGC_nSimHits/i"); m_tree->Branch("Hits_sTGC_trackId", &m_NSWsTGC_trackId); + m_tree->Branch("Hits_sTGC_isInsideBounds", &m_NSWsTGC_isInsideBounds); + m_tree->Branch("Hits_sTGC_globalTime", &m_NSWsTGC_globalTime); m_tree->Branch("Hits_sTGC_hitGlobalPositionX", &m_NSWsTGC_hitGlobalPositionX); m_tree->Branch("Hits_sTGC_hitGlobalPositionY", &m_NSWsTGC_hitGlobalPositionY); diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCSimHitVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCSimHitVariables.h index 594952fe0257695cdfe608e4983de2a61a298fde..8f099af6ad8da6b4e5041214fbd8037fb68c94e2 100644 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCSimHitVariables.h +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/sTGCSimHitVariables.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef STGCSIMHITVARIABLES_H @@ -23,6 +23,7 @@ class sTGCSimHitVariables : public ValAlgVariables m_sTgcIdHelper(0), m_NSWsTGC_nSimHits(0), m_NSWsTGC_trackId(0), + m_NSWsTGC_isInsideBounds(0), m_NSWsTGC_globalTime(0), m_NSWsTGC_hitGlobalPositionX(0), m_NSWsTGC_hitGlobalPositionY(0), @@ -96,6 +97,8 @@ class sTGCSimHitVariables : public ValAlgVariables int m_NSWsTGC_nSimHits; std::vector<int> *m_NSWsTGC_trackId; + std::vector<bool> *m_NSWsTGC_isInsideBounds; + std::vector<double> *m_NSWsTGC_globalTime; std::vector<double> *m_NSWsTGC_hitGlobalPositionX; std::vector<double> *m_NSWsTGC_hitGlobalPositionY;