28 return StatusCode::SUCCESS;
33 const EventContext& ctx{Gaudi::Hive::currentContext()};
37 constexpr std::string_view delim =
",";
38 std::ofstream
file{std::string(Form(
"event%09zu-",++
m_event))+
"SpacePoints.csv"};
40 file<<
"bucketId"<<delim;
41 file<<
"localPositionX"<<delim;
42 file<<
"localPositionY"<<delim;
43 file<<
"localPositionZ"<<delim;
48 file<<
"driftR"<<delim;
49 file<<
"stationName"<<delim;
50 file<<
"stationEta"<<delim;
51 file<<
"stationPhi"<<delim;
52 file<<
"gasGap"<<delim;
53 file<<
"primaryCh"<<delim;
54 file<<
"secondaryCh"<<delim;
55 file<<
"measuresEta"<<delim;
56 file<<
"measuresPhi"<<delim<<std::endl;
64 for (
const auto& spacePoint : *bucket) {
65 const Identifier measId = spacePoint->identify();
66 int gasGap{0}, primaryCh{0}, secondCh{-1};
68 const TechIndex techIdx =
m_idHelperSvc->technologyIndex(measId);
72 gasGap = (idHelper.multilayer(measId) -1)*idHelper.tubeLayerMax(measId) + idHelper.tubeLayer(measId);
73 primaryCh = idHelper.tube(measId);
78 gasGap = (idHelper.doubletR(measId) -1) * idHelper.gasGapMax(measId) + idHelper.gasGap(measId);
79 primaryCh = idHelper.channel(measId);
80 if (spacePoint->secondaryMeasurement()){
81 secondCh = idHelper.channel(
xAOD::identify(spacePoint->secondaryMeasurement()));
87 gasGap = idHelper.gasGap(measId);
88 primaryCh = idHelper.channel(measId);
89 if (spacePoint->secondaryMeasurement()){
90 secondCh = idHelper.channel(
xAOD::identify(spacePoint->secondaryMeasurement()));
96 gasGap = (idHelper.multilayer(measId) -1) * 4 + idHelper.gasGap(measId);
97 primaryCh = idHelper.channel(measId);
98 if (spacePoint->secondaryMeasurement()){
99 secondCh = idHelper.channel(
xAOD::identify(spacePoint->secondaryMeasurement()));
105 gasGap = (idHelper.multilayer(measId) -1) * 4 + idHelper.gasGap(measId);
106 primaryCh = idHelper.channel(measId);
107 if (spacePoint->secondaryMeasurement()){
108 secondCh = idHelper.channel(
xAOD::identify(spacePoint->secondaryMeasurement()));
118 buckId.fields[0] = spacePoint->chamber()->stationName();
119 buckId.fields[1] = spacePoint->chamber()->stationEta();
120 buckId.fields[2] = spacePoint->chamber()->stationPhi();
121 buckId.fields[3] = bucket->bucketId();
123 file<<buckId.hash<<delim;
124 file<<spacePoint->positionInChamber().x()<<delim;
125 file<<spacePoint->positionInChamber().y()<<delim;
126 file<<spacePoint->positionInChamber().z()<<delim;
131 file<<spacePoint->driftRadius()<<delim;
136 file<<primaryCh<<delim;
137 file<<secondCh<<delim;
138 file<<spacePoint->measuresEta()<<delim;
139 file<<spacePoint->measuresPhi()<<delim;
144 return StatusCode::SUCCESS;