ATLAS Offline Software
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 
9 namespace GlobalSim {
11  }
12 
15  const xAOD::EventInfo& eventInfo,
16  const LArStripNeighborhoodContainer& neighborhoods) 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& nbhd : neighborhoods) {
29  out << *nbhd << '\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 
66  const xAOD::EventInfo& eventInfo,
67  const LArStripNeighborhoodContainer& neighborhoods) 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& n : neighborhoods) {dump_n(n, out);}
79 
80 
81  out.close();
82 
83  return StatusCode::SUCCESS;
84  }
85 }
86 
87 
GlobalSim::LArStripNeighborhoodDumper::LArStripNeighborhoodDumper
LArStripNeighborhoodDumper()
Definition: LArStripNeighborhoodDumper.cxx:10
xAOD::EventInfo_v1::eventNumber
uint64_t eventNumber() const
The current event's event number.
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:70
xAOD::EventInfo_v1::IS_SIMULATION
@ IS_SIMULATION
true: simulation, false: data
Definition: EventInfo_v1.h:151
xAOD::EventInfo_v1::runNumber
uint32_t runNumber() const
The current event's run number.
python.selector.AtlRunQuerySelectorLhcOlc.sd
sd
Definition: AtlRunQuerySelectorLhcOlc.py:611
LArStripNeighborhoodDumper.h
GlobalSim
AlgTool to obtain a selection of eFex RoIs read in from the event store.
Definition: dump.h:8
beamspotman.n
n
Definition: beamspotman.py:729
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
GlobalSim::LArStripNeighborhoodDumper::dump
StatusCode dump(const std::string &name, const xAOD::EventInfo &eventInfo, const LArStripNeighborhoodContainer &) const
Definition: LArStripNeighborhoodDumper.cxx:14
GlobalSim::dump_stripdataVector
void dump_stripdataVector(const StripDataVector &sdv, std::ostream &os)
Definition: LArStripNeighborhoodDumper.cxx:37
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
GlobalSim::LArStripNeighborhoodDumper::dumpTerse
StatusCode dumpTerse(const std::string &name, const xAOD::EventInfo &eventInfo, const LArStripNeighborhoodContainer &) const
Definition: LArStripNeighborhoodDumper.cxx:65
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
xAOD::EventInfo_v1::mcEventWeight
float mcEventWeight(size_t i=0) const
The weight of one specific MC event used in the simulation.
Definition: EventInfo_v1.cxx:203
GlobalSim::LArStripNeighborhood
Definition: LArStripNeighborhood.h:28
GlobalSim::StripDataVector
std::vector< StripData > StripDataVector
Definition: LArStripNeighborhood.h:24
GlobalSim::dump_n
void dump_n(const LArStripNeighborhood *n, std::ostream &os)
Definition: LArStripNeighborhoodDumper.cxx:57
xAOD::EventInfo_v1::eventType
bool eventType(EventType type) const
Check for one particular bitmask value.