7 #include "GaudiKernel/SystemOfUnits.h"
19 const std::string& basePath,
24 auto registerHisto = [&](TH1*
h) {
27 std::string
stName =
"Inclusive";
35 stName = idHelperSvc->tgcIdHelper().stationNameString(stIdent);
38 stName = idHelperSvc->stgcIdHelper().stationNameString(stIdent);
41 stName = idHelperSvc->mmIdHelper().stationNameString(stIdent);
47 const std::string histPath =
std::format(
"/{}/Station_{}/{}",
48 basePath,
stName,
h->GetName());
49 histSvc->regHist(histPath,
h).ignore();
53 h_sdoWord = registerHisto(
new TH1F(
"sdoWord",
"sdoWord", 100, 0, 10));
54 h_eventIndex = registerHisto(
new TH1F(
"eventIndex",
"Event index (SDO)", 100, 0, 1000));
58 h_stationPhi = registerHisto(
new TH1F(
"stationPhi",
"StationPhi;stationPhi",48, 0.5, 48.5));
59 h_stationEta = registerHisto(
new TH1F(
"stationEta",
"StationEta;stationEta",11, -5.5, 5.5));
62 h_xyPos = registerHisto(
new TH2F(
"hitXY",
"hitXY;x [mm]; y[mm];entries", 240, -
r,
r, 240,-
r,
r));
63 h_rzPos = registerHisto(
new TH2F(
"hitRZ",
"hitRz;r [mm]; z[mm];entries", 1200, 0,
r, 2200,-
z,
z));
66 h_stationPhi = registerHisto(
new TH1F(
"stationPhi",
"StationPhi;stationPhi",8, 0.5, 8.5));
67 h_stationEta = registerHisto(
new TH1F(
"stationEta",
"StationEta;stationEta",17, -8.5, 8.5));
70 h_xyPos = registerHisto(
new TH2F(
"hitXY",
"hitXY;x [mm]; y[mm];entries", 240, -
r,
r, 240,-
r,
r));
71 h_rzPos = registerHisto(
new TH2F(
"hitRZ",
"hitRz;r [mm]; z[mm];entries", 1200, 0,
r, 600,-
z,
z));
75 h_stationPhi = registerHisto(
new TH1F(
"stationPhi",
"StationPhi;stationPhi",8, 0.5, 8.5));
76 h_stationEta = registerHisto(
new TH1F(
"stationEta",
"StationEta;stationEta",17, -8.5, 8.5));
79 h_xyPos = registerHisto(
new TH2F(
"hitXY",
"hitXY;x [mm]; y[mm];entries", 2400, -
r,
r, 2400,-
r,
r));
80 h_rzPos = registerHisto(
new TH2F(
"hitRZ",
"hitRz;r [mm]; z[mm];entries", 1200, 0,
r, 2200,-
z,
z));
84 h_stationPhi = registerHisto(
new TH1F(
"stationPhi",
"StationPhi;stationPhi",8, 0.5, 8.5));
85 h_stationEta = registerHisto(
new TH1F(
"stationEta",
"StationEta;stationEta",5, -2.5, 2.5));
88 h_xyPos = registerHisto(
new TH2F(
"hitXY",
"hitXY;x [mm]; y[mm];entries", 1000, -
r,
r, 1000,-
r,
r));
89 h_rzPos = registerHisto(
new TH2F(
"hitRZ",
"hitRz;r [mm]; z[mm];entries", 500, 0,
r, 160, -
z,
z));
93 h_stationPhi = registerHisto(
new TH1F(
"stationPhi",
"StationPhi;stationPhi",8, 0.5, 8.5));
94 h_stationEta = registerHisto(
new TH1F(
"stationEta",
"StationEta;stationEta",7, -3.5, 3.5));
97 h_xyPos = registerHisto(
new TH2F(
"hitXY",
"hitXY;x [mm]; y[mm];entries", 1000, -
r,
r, 1000,-
r,
r));
98 h_rzPos = registerHisto(
new TH2F(
"hitRZ",
"hitRz;r [mm]; z[mm];entries", 500, 0,
r, 160, -
z,
z));
104 h_radius = registerHisto(
new TH1F(
"h_radius",
"Radius (SDO)", 100, -15, 15));
105 h_localZ = registerHisto(
new TH1F(
"h_localZ",
"Local z-position (SDO)", 100, -3200, 3200));
112 std::set<int> histIds{-1};
117 for (
int s = 0 ;
s <
toInt(StIdx_t::StIndexMax); ++
s){
128 std::for_each(idHelper.module_begin(), idHelper.module_end(),
130 histIds.insert(idHelper.stationName(id));
135 std::for_each(idHelper.module_begin(), idHelper.module_end(),
137 histIds.insert(idHelper.stationName(id));
142 std::for_each(idHelper.module_begin(), idHelper.module_end(),
144 histIds.insert(idHelper.stationName(id));
149 return StatusCode::FAILURE;
151 for (
int id : histIds) {
154 return StatusCode::SUCCESS;
158 const EventContext& ctx{Gaudi::Hive::currentContext()};
162 for (
const auto&[sdoID, sdo]: *sdoCont) {
163 std::vector<unsigned> fillMe{};
180 const int sdoWord = sdo.word();
182 const float xPos =
gPos.x();
183 const float yPos =
gPos.y();
184 const float zPos =
gPos.z();
185 for (
unsigned h : fillMe) {
188 m_histos[
h].h_rzPos->Fill(std::hypot(xPos, yPos), zPos);
189 m_histos[
h].h_stationPhi->Fill(stationPhi);
190 m_histos[
h].h_stationEta->Fill(stationEta);
193 for (
const auto& [particleLink,
data]: sdo.getdeposits()) {
194 const int eventIx = particleLink.eventIndex();
196 const float localZ =
data.secondEntry();
197 for (
unsigned h : fillMe) {
204 return StatusCode::SUCCESS;