8 #include "GaudiKernel/SystemOfUnits.h"
17 #include "Acts/Surfaces/Surface.hpp"
18 #include "Acts/Surfaces/SurfaceBounds.hpp"
25 ISvcLocator* pSvcLocator)
36 return StatusCode::SUCCESS;
39 const EventContext& ctx = Gaudi::Hive::currentContext();
43 std::vector<const MmReadoutElement*> micromegas =
m_detMgr->getAllMmReadoutElements();
47 10 *
mm->multilayer());
50 const Acts::Surface& plane{
mm->surface(
mm->layerHash(
hash))};
51 const double halfY = 2.*design.longHalfHeight();
52 const double halfX = 2.*design.halfWidth();
56 if (!
m_testActsSurf && !design.insideTrapezoid(locPos.block<2,1>(0,0))) {
58 }
else if (
m_testActsSurf && !plane.insideBounds(locPos.block<2,1>(0,0))) {
62 const Amg::Vector3D globPos = plane.transform(gctxHandle->context()) * locPos;
63 histo->Fill(globPos.x(), globPos.y());
69 std::vector<const sTgcReadoutElement*> sTgcs =
m_detMgr->getAllsTgcReadoutElements();
71 for (
int chanType : {chType::Strip, chType::Pad, chType::Wire}){
74 10 * sTgc->multilayer());
77 const StripDesign& design{ chanType == chType::Strip? sTgc->stripDesign(
hash) :
78 chanType == chType::Wire ?
static_cast<const StripDesign&
>(sTgc->wireDesign(
hash))
80 const Acts::Surface& plane{sTgc->surface(sTgc->layerHash(
hash))};
81 const double halfY = 2.*design.longHalfHeight();
82 const double halfX = 2.*design.halfWidth();
86 if (!
m_testActsSurf && !design.insideTrapezoid(locPos.block<2,1>(0,0))) {
88 }
else if (
m_testActsSurf && !plane.insideBounds(locPos.block<2,1>(0,0))) {
92 const Amg::Vector3D globPos = plane.transform(gctxHandle->context()) * locPos;
93 histo->Fill(globPos.x(), globPos.y());
103 return StatusCode::SUCCESS;
106 for (
unsigned int ml =1 ; ml <= 2; ++ml) {
108 for (
int chanType : {chType::Strip, chType::Pad, chType::Wire}){
110 std::string histoName =
"STGC_"+std::string(
active == 1?
"A" :
"C") +
"M" +
112 + (chanType == chType::Strip?
"S" :
113 chanType == chType::Wire ?
"W" :
"P");
115 auto newHisto = std::make_unique<TH2I>(histoName.c_str(),
116 "ActiveNSW;x [mm]; y [mm]", 1000, -5001, 5001., 1000,
119 ATH_CHECK(
histSvc()->regHist(
"/GEOMODELTESTER/ActiveSurfaces/"+ histoName,std::move(newHisto)));
124 return StatusCode::SUCCESS;
128 for (
unsigned int ml = 1; ml <= 2; ++ml) {
131 std::string histoName =
"MM_"+std::string(
active == 1?
"A" :
"C") +
"M" +
133 auto newHisto = std::make_unique<TH2I>(histoName.c_str(),
134 "ActiveNSW;x [mm]; y [mm]", 1000, -5001, 5001., 1000,
137 ATH_CHECK(
histSvc()->regHist(
"/GEOMODELTESTER/ActiveSurfaces/"+ histoName,std::move(newHisto)));
141 return StatusCode::SUCCESS;