8 #include "GaudiKernel/SystemOfUnits.h"
17 #include "Acts/Surfaces/Surface.hpp"
18 #include "Acts/Surfaces/SurfaceBounds.hpp"
32 return StatusCode::SUCCESS;
35 const EventContext& ctx = Gaudi::Hive::currentContext();
39 std::vector<const MmReadoutElement*> micromegas =
m_detMgr->getAllMmReadoutElements();
43 10 *
mm->multilayer());
46 const Acts::Surface& plane{
mm->surface(
mm->layerHash(
hash))};
47 const double halfY = 2.*design.longHalfHeight();
48 const double halfX = 2.*design.halfWidth();
52 if (!
m_testActsSurf && !design.insideTrapezoid(locPos.block<2,1>(0,0))) {
54 }
else if (
m_testActsSurf && !plane.insideBounds(locPos.block<2,1>(0,0))) {
58 const Amg::Vector3D globPos = plane.transform(gctx->context()) * locPos;
59 histo->Fill(globPos.x(), globPos.y());
65 std::vector<const sTgcReadoutElement*> sTgcs =
m_detMgr->getAllsTgcReadoutElements();
67 for (
int chanType : {chType::Strip, chType::Pad, chType::Wire}){
70 10 * sTgc->multilayer());
73 const StripDesign& design{ chanType == chType::Strip? sTgc->stripDesign(
hash) :
74 chanType == chType::Wire ?
static_cast<const StripDesign&
>(sTgc->wireDesign(
hash))
76 const Acts::Surface& plane{sTgc->surface(sTgc->layerHash(
hash))};
77 const double halfY = 2.*design.longHalfHeight();
78 const double halfX = 2.*design.halfWidth();
82 if (!
m_testActsSurf && !design.insideTrapezoid(locPos.block<2,1>(0,0))) {
84 }
else if (
m_testActsSurf && !plane.insideBounds(locPos.block<2,1>(0,0))) {
88 const Amg::Vector3D globPos = plane.transform(gctx->context()) * locPos;
89 histo->Fill(globPos.x(), globPos.y());
99 return StatusCode::SUCCESS;
102 for (
unsigned int ml =1 ; ml <= 2; ++ml) {
104 for (
int chanType : {chType::Strip, chType::Pad, chType::Wire}){
106 std::string histoName =
"STGC_"+std::string(
active == 1?
"A" :
"C") +
"M" +
108 + (chanType == chType::Strip?
"S" :
109 chanType == chType::Wire ?
"W" :
"P");
111 auto newHisto = std::make_unique<TH2I>(histoName.c_str(),
112 "ActiveNSW;x [mm]; y [mm]", 1000, -5001, 5001., 1000,
115 ATH_CHECK(
histSvc()->regHist(
"/GEOMODELTESTER/ActiveSurfaces/"+ histoName,std::move(newHisto)));
120 return StatusCode::SUCCESS;
124 for (
unsigned int ml = 1; ml <= 2; ++ml) {
127 std::string histoName =
"MM_"+std::string(
active == 1?
"A" :
"C") +
"M" +
129 auto newHisto = std::make_unique<TH2I>(histoName.c_str(),
130 "ActiveNSW;x [mm]; y [mm]", 1000, -5001, 5001., 1000,
133 ATH_CHECK(
histSvc()->regHist(
"/GEOMODELTESTER/ActiveSurfaces/"+ histoName,std::move(newHisto)));
137 return StatusCode::SUCCESS;