8 #include "GaudiKernel/SystemOfUnits.h"
22 ISvcLocator* pSvcLocator)
26 std::unique_ptr<TFile> out_file =
27 std::make_unique<TFile>(
m_outFile.value().c_str(),
"RECREATE");
28 if (!out_file || !out_file->IsOpen() || out_file->IsZombie()) {
31 return StatusCode::FAILURE;
33 out_file->mkdir(
"SinglePads");
34 TDirectory*
dir = out_file->GetDirectory(
"SinglePads");
36 std::stringstream ch_name{};
37 dir->WriteObject(grObj.get(),
padName(
id).c_str());
40 out_file->mkdir(
"PadScanning");
41 dir = out_file->GetDirectory(
"PadScanning");
43 std::stringstream ch_name{};
44 dir->WriteObject(grObj.get(),
padName(
id).c_str());
48 return StatusCode::SUCCESS;
52 std::stringstream ch_name{};
55 ch_name << std::abs(stEta)<< (stEta > 0 ?
"A" :
"C");
58 ch_name <<
"L" << st_helper.
gasGap(
id);
59 ch_name <<
"PAD"<<st_helper.
padEta(
id)<<
"P"<<st_helper.
padPhi(
id);
67 return StatusCode::SUCCESS;
72 return StatusCode::SUCCESS;
73 const EventContext& ctx = Gaudi::Hive::currentContext();
76 if (!detMgr.isValid()) {
78 return StatusCode::FAILURE;
82 std::array<Amg::Vector2D, 4> corners{};
88 grObj->SetPoint(grObj->GetN(), corner.x(), corner.y());
95 for (
int binX = 1 ;
binX <= padObj->GetNbinsX(); ++
binX) {
96 for (
int binY = 1;
binY <= padObj->GetNbinsY(); ++
binY) {
98 padObj->GetYaxis()->GetBinCenter(
binY)};
100 padObj->SetBinContent(
binX,
binY, std::hypot(distVec.x(), distVec.y()));
106 return StatusCode::SUCCESS;
113 for (
const std::string station : {
"STS",
"STL"}) {
115 if (
eta == 0)
continue;
118 bool is_valid{
false};
120 if (!is_valid)
continue;
125 for (
int lay = 1; lay <= 4; ++lay) {
129 const Identifier padId = id_helper.
padID(module_id, ml, lay, sTgcIdHelper::sTgcChannelTypes::Pad, padEta, padPhi,
isValid);
131 m_nswPads[padId] = std::make_unique<TGraph>();
135 const double padMinX =
std::min(padEdges[padCorners::botLeft].
x(), padEdges[padCorners::topLeft].
x());
136 const double padMaxX =
std::max(padEdges[padCorners::botRight].
x(), padEdges[padCorners::topRight].
x());
137 const double padMinY = padEdges[padCorners::botLeft].y();
138 const double padMaxY = padEdges[padCorners::topLeft].y();
139 const double dX = padMaxX - padMinX;
140 const double dY = padMaxY - padMinY;
141 std::unique_ptr<TH2> padH = std::make_unique<TH2D>(
padName(padId).c_str(),
142 "dummy; pad x[mm];pad y[mm];pad distance [mm]",
143 800, padMinX - 0.25*dX, padMaxX + 0.25*dX,
144 800, padMinY - 0.25*dY, padMaxY + 0.25*dY);
145 ATH_MSG_DEBUG(
"Dimensions "<<
padName(padId)<<
" "<<padMinX<<
" "<<padMaxX<<
" -- "<<padMinY<<
" "<<padMaxY);
154 return StatusCode::SUCCESS;