8 #include "GaudiKernel/SystemOfUnits.h"
18 #include "Acts/Surfaces/Surface.hpp"
19 #include "Acts/Surfaces/SurfaceBounds.hpp"
34 return StatusCode::SUCCESS;
37 const EventContext& ctx = Gaudi::Hive::currentContext();
41 std::vector<const MmReadoutElement*> micromegas =
m_detMgr->getAllMmReadoutElements();
50 10 *
mm->multilayer());
53 const Acts::Surface& plane{
mm->surface(
mm->layerHash(
hash))};
54 const double halfY = 2.*design.longHalfHeight();
55 const double halfX = 2.*design.halfWidth();
59 if (!
m_testActsSurf && !design.insideTrapezoid(locPos.block<2,1>(0,0))) {
61 }
else if (
m_testActsSurf && !plane.insideBounds(locPos.block<2,1>(0,0))) {
65 const Amg::Vector3D globPos = plane.transform(gctx->context()) * locPos;
66 histo->Fill(globPos.x(), globPos.y());
72 std::vector<const sTgcReadoutElement*> sTgcs =
m_detMgr->getAllsTgcReadoutElements();
79 for (
int chanType : {chType::Strip, chType::Pad, chType::Wire}){
82 10 * sTgc->multilayer());
85 const StripDesign& design{ chanType == chType::Strip? sTgc->stripDesign(
hash) :
86 chanType == chType::Wire ?
static_cast<const StripDesign&
>(sTgc->wireDesign(
hash))
88 const Acts::Surface& plane{sTgc->surface(sTgc->layerHash(
hash))};
89 const double halfY = 2.*design.longHalfHeight();
90 const double halfX = 2.*design.halfWidth();
94 if (!
m_testActsSurf && !design.insideTrapezoid(locPos.block<2,1>(0,0))) {
96 }
else if (
m_testActsSurf && !plane.insideBounds(locPos.block<2,1>(0,0))) {
100 const Amg::Vector3D globPos = plane.transform(gctx->context()) * locPos;
101 histo->Fill(globPos.x(), globPos.y());
108 std::vector<const TgcReadoutElement*> tgcs =
m_detMgr->getAllTgcReadoutElements();
116 for (
bool isStrip : {
false,
true}) {
117 int stationNameIndex = std::stoi(
m_idHelperSvc->stationNameString(tgc->identify()).substr(1,1));
119 if(!tgc->numChannels(
hash)) {
126 const Acts::Surface& plane{tgc->surface(tgc->layerHash(
hash))};
128 const double halfX = 1.5*design.halfWidth();
132 if (!
m_testActsSurf && !design.insideTrapezoid(locPos.block<2,1>(0,0))) {
134 }
else if (
m_testActsSurf && !plane.insideBounds(locPos.block<2,1>(0,0))) {
138 const Amg::Vector3D globPos = plane.transform(gctx->context()) * locPos;
139 histo->Fill(globPos.x(), globPos.y());
149 return StatusCode::SUCCESS;
152 for (
unsigned int ml =1 ; ml <= 2; ++ml) {
154 for (
int chanType : {chType::Strip, chType::Pad, chType::Wire}){
156 std::string histoName =
"STGC_"+std::string(
active == 1?
"A" :
"C") +
"M" +
158 + (chanType == chType::Strip?
"S" :
159 chanType == chType::Wire ?
"W" :
"P");
161 auto newHisto = std::make_unique<TH2I>(histoName.c_str(),
162 "ActiveNSW;x [mm]; y [mm]", 1000, -5001, 5001., 1000,
165 ATH_CHECK(
histSvc()->regHist(
"/GEOMODELTESTER/ActiveSurfaces/"+ histoName,std::move(newHisto)));
170 return StatusCode::SUCCESS;
174 for (
unsigned int ml = 1; ml <= 2; ++ml) {
177 std::string histoName =
"MM_"+std::string(
active == 1?
"A" :
"C") +
"M" +
179 auto newHisto = std::make_unique<TH2I>(histoName.c_str(),
180 "ActiveNSW;x [mm]; y [mm]", 1000, -5001, 5001., 1000,
183 ATH_CHECK(
histSvc()->regHist(
"/GEOMODELTESTER/ActiveSurfaces/"+ histoName,std::move(newHisto)));
187 return StatusCode::SUCCESS;
192 std::set<std::string> tgcNames;
194 tgcNames.insert(
m_idHelperSvc->stationNameString(tgc->identify()));
197 for (
bool isStrip : {
false,
true}) {
198 for (
uint station: {1,2,3,4} ){
200 auto newHisto = std::make_unique<TH2I>(histoName.c_str(),
201 "ActiveTGC;x [mm]; y [mm]", 3000, -15001, 15001., 3000,
204 ATH_CHECK(
histSvc()->regHist(
"/GEOMODELTESTER/ActiveSurfaces/"+ histoName,std::move(newHisto)));
208 return StatusCode::SUCCESS;