8 #include "GaudiKernel/SystemOfUnits.h"
23 ISvcLocator* pSvcLocator)
34 return StatusCode::SUCCESS;
37 const EventContext& ctx = Gaudi::Hive::currentContext();
41 std::vector<const MmReadoutElement*> micromegas =
m_detMgr->getAllMmReadoutElements();
45 10 *
mm->multilayer());
48 const Acts::Surface& plane{
mm->surface(
mm->layerHash(
hash))};
49 const double halfY = 2.*design.longHalfHeight();
50 const double halfX = 2.*design.halfWidth();
54 if (!
m_testActsSurf && !design.insideTrapezoid(locPos.block<2,1>(0,0))) {
56 }
else if (
m_testActsSurf && !plane.insideBounds(locPos.block<2,1>(0,0))) {
60 const Amg::Vector3D globPos = plane.transform(gctxHandle->context()) * locPos;
61 histo->Fill(globPos.x(), globPos.y());
67 std::vector<const sTgcReadoutElement*> sTgcs =
m_detMgr->getAllsTgcReadoutElements();
69 for (
int chanType : {chType::Strip, chType::Pad, chType::Wire}){
72 10 * sTgc->multilayer());
75 const StripDesign& design{ chanType == chType::Strip? sTgc->stripDesign(
hash) :
76 chanType == chType::Wire ?
static_cast<const StripDesign&
>(sTgc->wireDesign(
hash))
78 const Acts::Surface& plane{sTgc->surface(sTgc->layerHash(
hash))};
79 const double halfY = 2.*design.longHalfHeight();
80 const double halfX = 2.*design.halfWidth();
84 if (!
m_testActsSurf && !design.insideTrapezoid(locPos.block<2,1>(0,0))) {
86 }
else if (
m_testActsSurf && !plane.insideBounds(locPos.block<2,1>(0,0))) {
90 const Amg::Vector3D globPos = plane.transform(gctxHandle->context()) * locPos;
91 histo->Fill(globPos.x(), globPos.y());
101 return StatusCode::SUCCESS;
104 for (
unsigned int ml =1 ; ml <= 2; ++ml) {
106 for (
int chanType : {chType::Strip, chType::Pad, chType::Wire}){
108 std::string histoName =
"STGC_"+std::string(
active == 1?
"A" :
"C") +
"M" +
110 + (chanType == chType::Strip?
"S" :
111 chanType == chType::Wire ?
"W" :
"P");
113 auto newHisto = std::make_unique<TH2I>(histoName.c_str(),
114 "ActiveNSW;x [mm]; y [mm]", 1000, -5001, 5001., 1000,
117 ATH_CHECK(
histSvc()->regHist(
"/GEOMODELTESTER/ActiveSurfaces/"+ histoName,std::move(newHisto)));
122 return StatusCode::SUCCESS;
126 for (
unsigned int ml = 1; ml <= 2; ++ml) {
129 std::string histoName =
"MM_"+std::string(
active == 1?
"A" :
"C") +
"M" +
131 auto newHisto = std::make_unique<TH2I>(histoName.c_str(),
132 "ActiveNSW;x [mm]; y [mm]", 1000, -5001, 5001., 1000,
135 ATH_CHECK(
histSvc()->regHist(
"/GEOMODELTESTER/ActiveSurfaces/"+ histoName,std::move(newHisto)));
139 return StatusCode::SUCCESS;