1 #include "fmt/format.h"
10 using namespace TrTrack;
17 static constexpr
float corr = 0.0993e-3;
24 return Rigidity.at(fit).at(span);
29 return Rigidity.at(fit).at(span);
32 return 1.0 / (1.0 / Rigidity.at(fit).at(span) + corr);
48 return (RigidityCorr.find(fit) !=
end(RigidityCorr) && RigidityCorr.at(fit).find(span) !=
end(RigidityCorr.at(fit)));
66 LayerChargeXY.clear();
67 LayerChargeStatus.clear();
74 TrTrackHitPos.clear();
75 TrackFeetDistance.clear();
80 PartialRigidity.clear();
81 PartialInvRigErr.clear();
82 PartialTrChiSq.clear();
84 TrTrackResidual.clear();
85 TrTrackFitPos.clear();
87 UnbiasedCharge.clear();
89 InnerChargeRMS.clear();
97 MaxClusterEdep.clear();
98 MaxClusterDistance.clear();
99 ClusterSignalRatio.clear();
105 fmt::print(
"{:=^120} \n",
" TrTrackBaseData ");
106 if (!RigidityCorr.empty()) {
107 for (
const auto &fitIter : RigidityCorr) {
109 fmt::print(
" {:<30} {:>15} {:>15} {:>15}\n",
"Span",
"RigidityCorr",
"TrChiSqX",
"TrChiSqY");
110 for (
auto spanIter : fitIter.second) {
111 fmt::print(
" - {:<28} = {:> 12.4f} GV {:> 15.4f} {:> 15.4f}\n",
TrTrack::spanNames[spanIter.first],
112 spanIter.second, TrChiSq.at(fitIter.first).at(spanIter.first).at(
Side::X),
113 TrChiSq.at(fitIter.first).at(spanIter.first).at(
Side::Y));
118 if (!Charge.empty()) {
119 fmt::print(
"{:-^120}\n",
"");
120 fmt::print(
"{:<32} {:>15} {:>15} {:>15} {:>32}\n",
"Charge type",
"Standard",
"Hu Liu",
"Yi Jia",
"status");
122 fmt::print(
" - {:<28} = ",
"Global charge");
124 fmt::print(
"{:> 15.4f} ",
ContainsKeys(Charge, chType) ? Charge.at(chType) : 0);
128 fmt::print(
" - {:<28} = ",
"Inner tracker charge");
129 for (
auto chType : TrTrack::recoTypes) {
130 fmt::print(
"{:> 15.4f} ",
ContainsKeys(InnerCharge, chType) ? InnerCharge.at(chType) : 0);
134 for (
size_t ijl = 0; ijl < 9; ijl++) {
135 fmt::print(
" - {:<28} = ", fmt::format(
"Layer {}", ijl));
136 for (
auto chType : TrTrack::recoTypes) {
138 fmt::print(
"{:> 15.4f} ", LayerChargeXY.at(ijl).at(chType));
140 fmt::print(
"{:>15} ",
"");
142 std::bitset<32> dummy(
ContainsKeys(LayerChargeStatus, ijl) ? LayerChargeStatus.at(ijl) : 0xFFFF);
143 fmt::print(
"{:>32} ", dummy.to_string());
148 fmt::print(
"{:-^120}\n",
"");
152 fmt::print(
"{:=^120} \n",
" TrTrackPlusData ");
153 if (!Rigidity.empty()) {
154 for (
const auto &fitIter : Rigidity) {
156 if (RigidityTOI.find(fitIter.first) ==
end(RigidityTOI)) {
157 fmt::print(
" {:<30} {:>15} {:>15} {:>15}\n",
"Span",
"Rigidity",
"",
"InvRigErr");
158 for (
auto spanIter : fitIter.second) {
159 fmt::print(
" - {:<28} = {:> 12.4f} GV {:>15} {:>15}\n",
TrTrack::spanNames[spanIter.first], spanIter.second,
160 "", InvRigErr.at(fitIter.first).at(spanIter.first));
163 fmt::print(
" {:<30} {:>15} {:>15} {:>15}\n",
"Span",
"Rigidity",
"RigidityTOI",
"InvRigErr");
164 for (
auto spanIter : fitIter.second) {
165 fmt::print(
" - {:<28} = {:> 12.4f} GV {:> 12.4f} GV {:>15}\n",
TrTrack::spanNames[spanIter.first],
166 spanIter.second, RigidityTOI.at(fitIter.first).at(spanIter.first),
167 InvRigErr.at(fitIter.first).at(spanIter.first));
173 fmt::print(
"{:-^120}\n",
"");
174 fmt::print(
"{:<32} {:>15} {:>15} {:>15} {:>15}\n",
"\"Partial\" variables",
"Rigidity",
"InvRigErr",
"TrChiSqX",
176 for (
unsigned int ijl = 0; ijl < 9; ijl++) {
180 for (
auto &fitIter : PartialRigidity.at(ijl)) {
181 auto fit = fitIter.first;
183 fmt::print(
" - {:<28} = {:>15} {:>15} {:>15} {:>15}\n",
184 fmt::format(
"Layer {} - Fit {}", ijl + 1,
TrTrack::fitNames[fit]), PartialRigidity.at(ijl).at(fit),
185 PartialInvRigErr.at(ijl).at(fit), PartialTrChiSq.at(ijl).at(fit).at(
TrTrack::Side::X),
190 if (!ChargeRMS.empty()) {
191 fmt::print(
"{:-^120}\n",
"");
192 fmt::print(
"{:<32} {:>15} {:>15} {:>15}\n",
"Charge type",
"Standard",
"Hu Liu",
"Yi Jia");
194 fmt::print(
" - {:<28} = ",
"Global charge RMS");
196 fmt::print(
"{:> 15.4f} ",
ContainsKeys(ChargeRMS, chType) ? ChargeRMS.at(chType) : 0);
200 fmt::print(
" - {:<28} = ",
"Inner tracker charge RMS");
201 for (
auto chType : TrTrack::recoTypes) {
202 fmt::print(
"{:> 15.4f} ",
ContainsKeys(InnerChargeRMS, chType) ? InnerChargeRMS.at(chType) : 0);
206 for (
size_t ijl = 0; ijl < 9; ijl++) {
207 fmt::print(
" - {:<28} = ", fmt::format(
"Layer {} X", ijl));
208 for (
auto chType : TrTrack::recoTypes) {
210 fmt::print(
"{:> 15.4f} ", LayerCharge.at(ijl).at(chType).at(
TrTrack::Side::X));
212 fmt::print(
"{:>15} ",
"");
215 fmt::print(
" - {:<28} = ", fmt::format(
"Layer {} Y", ijl));
216 for (
auto chType : TrTrack::recoTypes) {
218 fmt::print(
"{:> 15.4f} ", LayerCharge.at(ijl).at(chType).at(
TrTrack::Side::Y));
220 fmt::print(
"{:>15} ",
"");
225 fmt::print(
"{:-^120}\n",
"");
constexpr std::array< ChargeRecoType, numChargeRecos > recoTypes
std::map< TrTrack::Fit, std::map< TrTrack::Span, T >> TrackFitVariable
bool FitIDExists(TrTrack::Fit fit, TrTrack::Span span) const
Check if a given combination of fit and span is available for this track.
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.
float GetGeomCorrectedRigidity(TrTrack::Fit fit, TrTrack::Span span, TrTrack::TrGeometry trGeom=TrTrack::TrGeometry::Default) const
Get the Rigidity variable after applying the geometry volume correction.
Track constructed with inner tracker + layer9 hits.
float ApplyGeomCorrection(const TrackFitVariable< float > &Rigidity, Fit fit, Span span, TrGeometry trGeom)
TrTrack container class description.
void Clear()
Clear container content.
SingleTreeChain::EventItr end(SingleTreeChain &chain)
static const std::string BranchName
std::enable_if< std::is_convertible< T, Key >::value, bool >::type ContainsKeys(const std::map< Key, Value > &container, T key)
float GetGeomCorrectedRigidityTOI(TrTrack::Fit fit, TrTrack::Span span, TrTrack::TrGeometry trGeom=TrTrack::TrGeometry::Default) const
Get the RigidityTOI variable after applying the geometry volume correction.
float GetGeomCorrectedRigidityCorr(TrTrack::Fit fit, TrTrack::Span span, TrTrack::TrGeometry trGeom=TrTrack::TrGeometry::Default) const
Get the RigidityCorr variable after applying the geometry volume correction.
static const std::string BranchName
static const std::array< std::string, numSpans > spanNames
void Dump() const
Dump on screen container content.
void Clear()
Clear container content.