2 #include <boost/algorithm/string/replace.hpp>
11 tvx::HistContainer(name, motherDir, option),
13 hDiffProjToFitPositionWRTHit(nullptr),
14 hDiffProjToFitError(nullptr),
15 hDist2AcceptedHit(nullptr),
16 hDist2ClosestHit(nullptr),
17 hPullClosestHit1D(nullptr),
18 hPullClosestHit2D(nullptr),
19 hPullCandidateHits2D(nullptr),
20 hChi2CandidateHits(nullptr),
21 hCountCandidateHits(nullptr),
22 hActiveLayerCounts(nullptr),
23 hProjErrorMag(nullptr)
25 const double suggestBinWidth = 1;
32 int n_z_bins = ceil( (z_max - z_min) / suggestBinWidth );
33 int n_y_bins = ceil( (y_max - y_min) / suggestBinWidth );
35 n_z_bins = ( n_z_bins <= 10 ? 10 : (n_z_bins > 20 ? 20 : n_z_bins) );
36 n_y_bins = ( n_y_bins <= 10 ? 10 : (n_y_bins > 20 ? 20 : n_y_bins) );
40 hDiffProjToFitPositionWRTHit =
new TH1I(
"hDiffProjToFitPositionWRTHit",
" ; Diff. (Projection - Final) Position w.r.t. Hit, cm; Num. of Track Nodes; ", 50, -0.5, 0.5);
44 hDiffProjToFitError =
new TH2I(
"hDiffProjToFitError",
" ; Diff. (Projection - Final) Error_z, cm; Diff. Error_y, cm; Num. of Track Nodes; ", 50, 0, 0.25, 50, 0, 0.25);
48 hDist2AcceptedHit =
new TH1I(
"hDist2AcceptedHit",
" ; Closest to Accepted Hits: Distance R, cm; Num. of Track Nodes; ", 100, 0, 1);
52 hDist2ClosestHit =
new TH1I(
"hDist2ClosestHit",
" ; Closest to Accepted Hits: Distance R, cm; Num. of Track Nodes; ", 100, 0, 1);
56 hPullClosestHit1D =
new TH1I(
"hPullClosestHit1D",
" ; Track Proj. to Closest Hit Pull Dist.: Distance R, #sigma-units; Num. of Track Nodes; ", 100, 0, 10);
59 hPullClosestHit2D =
new TH2I(
"hPullClosestHit2D",
" ; Track Proj. to Closest Hit Pull Dist.: Local Z, #sigma-units; Local Y, #sigma-units; Num. of Track Nodes", 50, -6, 6, 50, -6, 6);
63 hPullCandidateHits2D =
new TH2I(
"hPullCandidateHits2D",
" ; Track Proj. to Candidate Hit Pull Dist.: Local Z, #sigma-units; Local Y, #sigma-units; Num. of Track Nodes", 50, -6, 6, 50, -6, 6);
67 hChi2CandidateHits =
new TH1I(
"hChi2CandidateHits",
" ; Track Proj. to Candidate Hit: #chi^{2}; Num. of Track Nodes", 100, 0, 20);
70 hCountCandidateHits =
new TH1I(
"hCountCandidateHits",
" ; Num. of Candidate Hits; Num. of Track Nodes", 20, 0, 20);
73 hActiveLayerCounts =
new TH2F(
"hActiveLayerCounts",
" ; Track Local Z, cm; Local Y, cm; Num. of Track Nodes", n_z_bins, z_min, z_max, n_y_bins, y_min, y_max);
77 hProjErrorMag =
new TH1I(
"hProjErrorMag",
"Projection Error; Projection Error Mag",200,0.,1.0);
86 for (
const auto& trkNode : kalmTrack.GetNodes())
89 if ( onlyNodesWithCandidates && !trkNode.GetCandidateProxyHits().size() )
104 Error(
"FillHists",
"Internal type of Sti hit assigned to this node "
105 "is not specified or implemented. Histograms won't be filled");
153 bool foundClosestCandidate =
false;
155 for (
const auto& hitCandidate : hitCandidates)
157 TVector3 pull = trkNode.
CalcPullToHit( *hitCandidate.GetTStiHit() );
163 if (hitCandidate.GetDistanceToNode() >= 0 && !foundClosestCandidate)
166 foundClosestCandidate =
true;
176 std::string histName(
"hActiveLayerCounts_" + boost::replace_all_copy<string>(trkNode.
GetVolumeName(),
"/",
"__"));
178 TH1* hActiveLayerCounts_det = h(histName);
180 if (!hActiveLayerCounts_det) {
183 hActiveLayerCounts_det->SetName(histName.c_str());
184 hActiveLayerCounts_det->SetOption(
"colz");
185 Add(hActiveLayerCounts_det);
double GetHistYMin() const
const std::set< TStiHitProxy > & GetCandidateProxyHits() const
TH1I * hDiffProjToFitPositionWRTHit
double GetHistZMin() const
double GetHistYMax() const
TVector3 CalcPullToHit(const TStiHit &hit) const
void FillHistsHitsAccepted(const TStiKalmanTrackNode &trkNode)
Processes and controls user options provided in the command line.
std::string GetVolumeName() const
const TStiHit * GetHit() const
TH2F * hActiveLayerCounts
TVector3 CalcDiffProjToFitError() const
double CalcDistanceToHit() const
bool SplitHistsByVolume() const
TH2I * hPullCandidateHits2D
void FillHistsHitsRejected(const TStiKalmanTrackNode &trkNode)
void FillHists(const StiHifyEvent &event, StiNodeHitStatus hitStatus=StiNodeHitStatus::Any, bool onlyNodesWithCandidates=false)
const TVector3 & GetPositionLocal() const
const StiHifyPrgOptions & fPrgOptions
Command line arguments and options requested by the user.
bool MatchedVolName(const std::string &volName) const
Note that the function returns true when the internal list of regex'es formed by the user specified o...
StiHifyHistContainer(const StiHifyPrgOptions &prgOpts, const char *name, TDirectory *motherDir=0, Option_t *option="")
virtual void FillDerivedHists()
Creates X and Y projections from filled 2D histograms.
const std::vector< TStiKalmanTrack > & GetTStiKalmanTracks() const
TH1I * hChi2CandidateHits
double CalcDistanceToClosestHit() const
double CalcDiffProjToFitPositionWRTHit() const
TH2I * hDiffProjToFitError
double GetHistZMax() const
TH1I * hCountCandidateHits
bool IsInsideVolume() const
const TVector3 & GetProjError() const