ATLAS Offline Software
Loading...
Searching...
No Matches
LArStripNeighborhoodDumper.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7#include <fstream>
8
9namespace GlobalSim {
12
13 StatusCode
14 LArStripNeighborhoodDumper::dump(const std::string& name,
15 const xAOD::EventInfo& eventInfo,
16 const IOBitwise::eEmNbhoodTOBContainer& neighborhoodTOBs) const {
17
18 std::ofstream out(name + "_" +
19 std::to_string(eventInfo.eventNumber()) +
20 ".log");
21
22 out << "run " << eventInfo.runNumber()
23 << " evt " << eventInfo.eventNumber()
24 << " is simulation " << std::boolalpha
26 << " weight " << eventInfo.mcEventWeight() << '\n';
27
28 for (const auto nbhdTOB : neighborhoodTOBs) {
29 out << nbhdTOB->Neighbourhood() << '\n';
30 }
31
32 out.close();
33
34 return StatusCode::SUCCESS;
35 }
36
37 void dump_stripdataVector(const StripDataVector& sdv, std::ostream& os) {
38
39 for(const auto& sd : sdv) {
40 os << sd.m_eta << ' ';
41 }
42 os << '\n';
43
44
45 for(const auto& sd : sdv) {
46 os << sd.m_phi << ' ';
47 }
48 os << '\n';
49
50 for(const auto & sd : sdv) {
51 os << sd.m_e << ' ';
52 }
53 os << '\n';
54 os << '\n';
55 }
56
58 std::ostream& os){
59 dump_stripdataVector(n.phi_low(), os);
60 dump_stripdataVector(n.phi_center(), os);
61 dump_stripdataVector(n.phi_high(), os);
62 }
63
64 StatusCode
66 const xAOD::EventInfo& eventInfo,
67 const IOBitwise::eEmNbhoodTOBContainer& neighborhoodTOBs) const {
68
69 std::ofstream out(name + "_" +
70 std::to_string(eventInfo.eventNumber()) +
71 "_terse.log");
72 out << "run " << eventInfo.runNumber()
73 << " evt " << eventInfo.eventNumber()
74 << " is simulation " << std::boolalpha
76 << " weight " << eventInfo.mcEventWeight() << '\n';
77
78 for (const auto nTOB : neighborhoodTOBs) {dump_n(nTOB->Neighbourhood(), out);}
79
80
81 out.close();
82
83 return StatusCode::SUCCESS;
84 }
85}
86
87
StatusCode dump(const std::string &name, const xAOD::EventInfo &eventInfo, const IOBitwise::eEmNbhoodTOBContainer &) const
StatusCode dumpTerse(const std::string &name, const xAOD::EventInfo &eventInfo, const IOBitwise::eEmNbhoodTOBContainer &) const
Class to hold windows of LAr strip cells in a the neighbourhood of a eFexRoI.
bool eventType(EventType type) const
Check for one particular bitmask value.
@ IS_SIMULATION
true: simulation, false: data
uint32_t runNumber() const
The current event's run number.
uint64_t eventNumber() const
The current event's event number.
float mcEventWeight(size_t i=0) const
The weight of one specific MC event used in the simulation.
DataVector< GlobalSim::IOBitwise::eEmNbhoodTOB > eEmNbhoodTOBContainer
Property: Defining the container object.
AlgTool that to test whether expected the TIP values generated by data supplied by eEmMultTestBench c...
void dump_n(const LArStripNeighborhood &n, std::ostream &os)
std::vector< StripData > StripDataVector
void dump_stripdataVector(const StripDataVector &sdv, std::ostream &os)
EventInfo_v1 EventInfo
Definition of the latest event info version.