NAIA  1.0.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
UnbExtHit.cpp
Go to the documentation of this file.
1 #include "fmt/format.h"
2 #include <bitset>
3 
4 #include "Containers/UnbExtHit.h"
5 
6 namespace NAIA {
7 const std::string UnbExtHitBase::BranchName = "UnbExtHitBaseData";
8 
10  m_hits.clear();
11 
12  _beta = 1.0f;
13 }
14 
16  auto dumpHitData = [](const auto &hitDatap) {
17  const HitData &hitData = hitDatap.second;
18  fmt::print("{:-^120}\n", "");
19 
20  fmt::print("{:<32} {:>15} {:>15}\n", "", "Pos X", "Pos Y");
21  fmt::print(" - {:<28} = {:> 15.4f} {:> 15.4f}", fmt::format("Layer {}", hitDatap.first == ExtHit::L1 ? "1" : "9"),
22  hitData.HitPosX, hitData.HitPosY);
23  fmt::print("\n");
24 
25  fmt::print("{:<32} {:>15} {:>15} {:>15} {:>32}\n", "Charge type", "Standard", "Hu Liu", "Yi Jia", "status");
26  if (hitData.Charge.size() > 0) {
27  fmt::print(" - {:<28} = ", fmt::format("Layer {}", hitDatap.first == ExtHit::L1 ? "1" : "9"));
28  for (auto chType : TrTrack::recoTypes) {
29  fmt::print("{:> 15.4f} ", hitData.Charge.at(chType));
30  }
31 
32  std::bitset<32> dummy(hitData.ChargeStatus);
33  fmt::print("{:>32} ", dummy.to_string());
34  fmt::print("\n");
35 
36  fmt::print("\n");
37  }
38  };
39 
40  fmt::print("{:=^120} \n", " UnbExtHitBaseData ");
41 
42  std::for_each(cbegin(m_hits), cend(m_hits), dumpHitData);
43 
44  fmt::print("{:-^120}\n", "");
45 }
46 } // namespace NAIA
constexpr std::array< ChargeRecoType, numChargeRecos > recoTypes
Definition: Utils.h:96
UnbExtHit container class description.
needed to get basic info without computing twice
Definition: UnbExtHit.h:106
static const std::string BranchName
Definition: UnbExtHit.h:134
void Clear()
Clear container content.
Definition: UnbExtHit.cpp:9
void Dump() const
Dump on screen container content.
Definition: UnbExtHit.cpp:15
HitChargeVariable< float > Charge
Definition: UnbExtHit.h:112
std::map< ExtHit, HitData > m_hits
Definition: UnbExtHit.h:119