2 #include <fmt/format.h>
12 using namespace TrTrack;
15 return (Rigidity.find(fit) !=
end(Rigidity) && Rigidity.at(fit).find(span) !=
end(Rigidity.at(fit)));
28 TrTrackHitPos.clear();
29 TrTrackFitPos.clear();
37 InnerChargeRMS.clear();
38 LayerChargeXY.clear();
39 LayerChargeStatus.clear();
46 TrackFeetDistance.clear();
50 PartialRigidity.clear();
51 PartialInvRigErr.clear();
52 PartialTrChiSq.clear();
53 PartialTrTrackResidual.clear();
55 TrTrackResidual.clear();
56 UnbiasedCharge.clear();
62 MaxClusterEdep.clear();
63 MaxClusterDistance.clear();
64 ClusterSignalRatio.clear();
66 DirectionalStoermerCutoff = {0, 0};
72 fmt::print(
"{:=^120} \n",
" TrTrackBaseData ");
73 if (!Rigidity.empty()) {
74 for (
const auto &fitIter : Rigidity) {
76 fmt::print(
" {:<30} {:>15} {:>15} {:>15}\n",
"Span",
"Rigidity",
"TrChiSqX",
"TrChiSqY");
77 for (
auto spanIter : fitIter.second) {
78 fmt::print(
" - {:<28} = {:> 12.4f} GV {:> 15.4f} {:> 15.4f}\n",
TrTrack::spanNames[spanIter.first],
79 spanIter.second, TrChiSq.at(fitIter.first).at(spanIter.first).at(
Side::X),
80 TrChiSq.at(fitIter.first).at(spanIter.first).at(
Side::Y));
85 if (!Charge.empty()) {
86 fmt::print(
"{:-^120}\n",
"");
87 fmt::print(
"{:<32} {:>15} {:>15} {:>15} {:>32}\n",
"Charge type",
"Standard",
"Hu Liu",
"Yi Jia",
"status");
89 fmt::print(
" - {:<28} = ",
"Global charge");
91 fmt::print(
"{:> 15.4f} ",
ContainsKeys(Charge, chType) ? Charge.at(chType) : 0);
95 fmt::print(
" - {:<28} = ",
"Inner tracker charge");
96 for (
auto chType : TrTrack::recoTypes) {
97 fmt::print(
"{:> 15.4f} ",
ContainsKeys(InnerCharge, chType) ? InnerCharge.at(chType) : 0);
101 fmt::print(
" - {:<28} = ",
"Global charge RMS");
102 for (
auto chType : TrTrack::recoTypes) {
103 fmt::print(
"{:> 15.4f} ",
ContainsKeys(ChargeRMS, chType) ? ChargeRMS.at(chType) : 0);
107 fmt::print(
" - {:<28} = ",
"Inner tracker charge RMS");
108 for (
auto chType : TrTrack::recoTypes) {
109 fmt::print(
"{:> 15.4f} ",
ContainsKeys(InnerChargeRMS, chType) ? InnerChargeRMS.at(chType) : 0);
113 for (
size_t ijl = 0; ijl < 9; ijl++) {
117 fmt::print(
" - {:<28} = ", fmt::format(
"Layer {}", ijl));
118 for (
auto chType : TrTrack::recoTypes) {
120 fmt::print(
"{:> 15.4f} ", LayerChargeXY.at(ijl).at(chType));
122 fmt::print(
"{:>15} ",
"");
124 std::bitset<32> dummy(
ContainsKeys(LayerChargeStatus, ijl) ? LayerChargeStatus.at(ijl) : 0xFFFF);
125 fmt::print(
"{:>32} ", dummy.to_string());
130 fmt::print(
"{:-^120}\n",
"");
134 fmt::print(
"{:=^120} \n",
" TrTrackPlusData ");
135 if (!InvRigErr.empty()) {
136 for (
const auto &fitIter : InvRigErr) {
138 if (RigidityTOI.find(fitIter.first) ==
end(RigidityTOI)) {
139 fmt::print(
" {:<30} {:>15} {:>15}\n",
"Span",
"",
"InvRigErr");
140 for (
auto spanIter : fitIter.second) {
142 InvRigErr.at(fitIter.first).at(spanIter.first));
145 fmt::print(
" {:<30} {:>15} {:>15}\n",
"Span",
"RigidityTOI",
"InvRigErr");
146 for (
auto spanIter : fitIter.second) {
148 RigidityTOI.at(fitIter.first).at(spanIter.first), InvRigErr.at(fitIter.first).at(spanIter.first));
154 fmt::print(
"{:-^120}\n",
"");
155 fmt::print(
"{:<32} {:>15} {:>15} {:>15} {:>15}\n",
"\"Partial\" variables",
"Rigidity",
"InvRigErr",
"TrChiSqX",
157 for (
unsigned int ijl = 0; ijl < 9; ijl++) {
161 for (
auto &fitIter : PartialRigidity.at(ijl)) {
162 auto fit = fitIter.first;
164 fmt::print(
" - {:<28} = {:>15} {:>15} {:>15} {:>15}\n",
165 fmt::format(
"Layer {} - Fit {}", ijl + 1,
TrTrack::fitNames[fit]), PartialRigidity.at(ijl).at(fit),
166 PartialInvRigErr.at(ijl).at(fit), PartialTrChiSq.at(ijl).at(fit).at(
TrTrack::Side::X),
171 if (!LayerCharge.empty()) {
172 fmt::print(
"{:-^120}\n",
"");
173 fmt::print(
"{:<32} {:>15} {:>15} {:>15}\n",
"Charge type",
"Standard",
"Hu Liu",
"Yi Jia");
174 for (
size_t ijl = 0; ijl < 9; ijl++) {
175 fmt::print(
" - {:<28} = ", fmt::format(
"Layer {} X", ijl));
178 fmt::print(
"{:> 15.4f} ", LayerCharge.at(ijl).at(chType).at(
TrTrack::Side::X));
180 fmt::print(
"{:>15} ",
"");
183 fmt::print(
" - {:<28} = ", fmt::format(
"Layer {} Y", ijl));
184 for (
auto chType : TrTrack::recoTypes) {
186 fmt::print(
"{:> 15.4f} ", LayerCharge.at(ijl).at(chType).at(
TrTrack::Side::Y));
188 fmt::print(
"{:>15} ",
"");
193 fmt::print(
"{:-^120}\n",
"");
197 auto result = std::bitset<9>{0};
199 for (
unsigned int i = 0u; i < 9; ++i) {
constexpr std::array< ChargeRecoType, numChargeRecos > recoTypes
static const std::string BranchName
bool FitIDExists(TrTrack::Fit fit, TrTrack::Span span) const
Check if a given combination of fit and span is available for this track.
static const std::string BranchName
void Dump() const
Dump on screen container content.
static const std::array< std::string, numFits > fitNames
TrTrack::Span GetBestSpan(TrTrack::Fit fit=TrTrack::Fit::Choutko) const
Get the best Span available for this track.
Track constructed with inner tracker + layer9 hits.
TrTrack container class description.
void Clear()
Clear container content.
static const std::string BranchName
std::bitset< 9 > GetTrackPattern(TrTrack::Side side)
Get the track pattern for a given tracker side. One bit per layer, set to 1 if there is a hit on that...
std::enable_if< std::is_convertible< Key, size_t >::value, bool >::type ContainsKeys(const std::array< T, N > &container, Key key)
static const std::string BranchName
NAIAChain::EventItr end(NAIAChain &chain)
static const std::array< std::string, numSpans > spanNames
void Dump() const
Dump on screen container content.
void Clear()
Clear container content.