4 #include "TProfile2D.h"
12 tvx::HistContainer(name, motherDir, option),
14 mNodeZMin(-250), mNodeZMax(250),
15 mNodeRMin(0), mNodeRMax(30),
16 mDoProjection(doProjection),
17 hNStepsVsPhiVsRVsZ(nullptr),
18 hELossVsPhiVsRVsZ(nullptr),
19 hELossVsXVsYVsZ(nullptr),
20 hDensityVsPhiVsRVsZ(nullptr),
21 hRelRadLengthVsPhiVsRVsZ(nullptr)
45 const double minZBinWidth = 1;
46 const double minRBinWidth = 0.2;
51 nRBins = nRBins > 1000 ? 1000 : nRBins;
55 nZBins = nZBins > 500 ? 500 : nZBins;
61 h =
new TH2S(
"hTrackCountVsEtaVsPhi",
" ; #eta; #phi, rad; Num. of Tracks", 50, -2, 2, 120, -M_PI, M_PI);
65 h =
new TH2S(
"hTrackCountVsZVsPhi",
" ; z, cm; #phi, rad; Num. of Tracks", nZBins,
mNodeZMin,
mNodeZMax, 120, -M_PI, M_PI);
69 h =
new TProfile2D(
"hELossVsEtaVsPhi_trk",
" ; Track #eta; Track #phi, rad; Energy Losses in Select Volumes, keV", 50, -2, 2, 120, -M_PI, M_PI);
73 h =
new TProfile2D(
"hELossVsEtaVsPhi",
" ; #eta; #phi, rad; Energy Losses in Select Volumes, keV", 50, -2, 2, 120, -M_PI, M_PI);
77 h =
new TProfile2D(
"hELossVsZVsPhi",
" ; z, cm; #phi, rad; Energy Losses in Select Volumes, keV", nZBins,
mNodeZMin,
mNodeZMax, 120, -M_PI, M_PI);
81 h =
new TProfile2D(
"hELossVsZVsR",
" ; z, cm; r, cm; Energy Losses in Select Volumes, keV", nZBins,
mNodeZMin,
mNodeZMax, nRBins,
mNodeRMin,
mNodeRMax);
85 h =
new Profile2D(
"hELossVsPhiVsR",
" ; #phi, rad; r, cm; Energy Losses in Select Volumes, keV", 120, -M_PI, M_PI, nRBins,
mNodeRMin,
mNodeRMax,
"colz");
88 hNStepsVsPhiVsRVsZ =
new Profile3D(
"hNStepsVsPhiVsRVsZ",
"Num. of Steps per Track ; #phi, rad; r, cm; z, cm", 120, -M_PI, M_PI, nRBins,
mNodeRMin,
mNodeRMax, nZBins,
mNodeZMin,
mNodeZMax);
91 hELossVsPhiVsRVsZ =
new Profile3D(
"hELossVsPhiVsRVsZ",
"Energy Losses in Select Volumes, keV ; #phi, rad; r, cm; z, cm", 120, -M_PI, M_PI, nRBins,
mNodeRMin,
mNodeRMax, nZBins,
mNodeZMin,
mNodeZMax);
94 hELossVsXVsYVsZ =
new Profile3D(
"hELossVsXVsYVsZ",
"Energy Losses in Select Volumes, keV ; x, cm; y, cm; z, cm", nXYBins, -
mNodeRMax,
mNodeRMax, nXYBins, -
mNodeRMax,
mNodeRMax, nZBins,
mNodeZMin,
mNodeZMax);
97 hDensityVsPhiVsRVsZ =
new Profile3D(
"hDensityVsPhiVsRVsZ",
"Material Density, g/cm^{3}; #phi, rad; r, cm; z, cm", 120, -M_PI, M_PI, nRBins,
mNodeRMin,
mNodeRMax, nZBins,
mNodeZMin,
mNodeZMax);
100 hRelRadLengthVsPhiVsRVsZ =
new Profile3D(
"hRelRadLengthVsPhiVsRVsZ",
"Rel. Radiation Length, %; #phi, rad; r, cm; z, cm", 120, -M_PI, M_PI, nRBins,
mNodeRMin,
mNodeRMax, nZBins,
mNodeZMin,
mNodeZMax);
116 TIter iGeaTrack(eventG.
tracks);
118 while (
TGeaTrack* trackG = static_cast<TGeaTrack*>(iGeaTrack()) )
129 TProfile2D* profile2D;
132 profile2D->SetOption(
"colz");
134 Add(
mDoProjection ? profile2D->ProjectionX() : profile2D->ProfileX());
137 profile2D->SetOption(
"colz");
139 Add(
mDoProjection ? profile2D->ProjectionX() : profile2D->ProfileX());
142 profile2D->SetOption(
"colz");
144 Add(
mDoProjection ? profile2D->ProjectionX() : profile2D->ProfileX());
148 profile2D->SetOption(
"colz XZ");
150 TH1* h =
mDoProjection ? profile2D->ProjectionX() : profile2D->ProfileX();
155 profile2D->SetOption(
"colz XZ");
157 Add(
mDoProjection ? profile2D->ProjectionX() : profile2D->ProfileX());
160 profile2D->SetOption(
"colz XZ");
162 Add(
mDoProjection ? profile2D->ProjectionX() : profile2D->ProfileX());
166 profile2D->SetOption(
"colz XZ");
172 profile2D->SetOption(
"colz");
174 h = profile2D->ProfileX();
179 profile2D->SetOption(
"colz");
181 Add(profile2D->ProfileX());
184 profile2D->SetOption(
"colz");
186 Add(profile2D->ProfileX());
190 profile2D->SetOption(
"colz");
192 h =
mDoProjection ? profile2D->ProjectionX() : profile2D->ProfileX();
197 profile2D->SetOption(
"colz");
199 Add(
mDoProjection ? profile2D->ProjectionX() : profile2D->ProfileX());
202 profile2D->SetOption(
"colz");
204 Add(
mDoProjection ? profile2D->ProjectionX() : profile2D->ProfileX());
213 h(
"hTrackCountVsEtaVsPhi")->Fill(dcaNode.
GetTrackP().Eta(), dcaNode.
GetTrackP().Phi());
216 for (
const auto& kalmNode : kalmTrack.
GetNodes())
218 if (volumeList && volumeList->size() && !kalmNode.MatchedVolName(*volumeList) )
continue;
220 if (kalmNode.GetNodeMaterialDensity() <= 0)
continue;
223 dynamic_cast<TProfile2D&
>( *h(
"hELossVsEtaVsPhi_trk")).Fill(kalmNode.GetTrackP().Eta(), kalmNode.GetTrackP().Phi(), kalmNode.GetEnergyLosses());
225 dynamic_cast<TProfile2D&
>( *h(
"hELossVsEtaVsPhi")).Fill(kalmNode.GetPosition().Eta(), kalmNode.GetPosition().Phi(), kalmNode.GetEnergyLosses());
226 dynamic_cast<TProfile2D&
>( *h(
"hELossVsZVsPhi") ).Fill(kalmNode.GetPosition().Z(), kalmNode.GetPosition().Phi(), kalmNode.GetEnergyLosses());
227 dynamic_cast<TProfile2D&
>( *h(
"hELossVsZVsR") ).Fill(kalmNode.GetPosition().Z(), kalmNode.GetPosition().Perp(), kalmNode.GetEnergyLosses());
228 dynamic_cast<TProfile2D&
>( *h(
"hELossVsPhiVsR") ).Fill(kalmNode.GetPosition().Phi(), kalmNode.GetPosition().Perp(), kalmNode.GetEnergyLosses());
232 hDensityVsPhiVsRVsZ->Fill(kalmNode.GetPosition().Phi(), kalmNode.GetPosition().Perp(), kalmNode.GetPosition().Z(), kalmNode.GetNodeMaterialDensity());
245 TIter iGeaStep(&trackG.
steps);
247 while (
TGeaStep* stepG = static_cast<TGeaStep*>(iGeaStep()) )
249 double dEStep = stepG->dEstep * 1e6;
251 TVector3 step_pos(stepG->x, stepG->y, stepG->z);
253 if (volumeList && volumeList->size() && !stepG->MatchedVolName(*volumeList) )
continue;
257 dynamic_cast<TProfile2D&
>( *h(
"hELossVsZVsPhi") ).Fill(step_pos.Z(), step_pos.Phi(), dEStep);
258 dynamic_cast<TProfile2D&
>( *h(
"hELossVsZVsR") ).Fill(step_pos.Z(), step_pos.Perp(), dEStep);
259 dynamic_cast<TProfile2D&
>( *h(
"hELossVsPhiVsR") ).Fill(step_pos.Phi(), step_pos.Perp(), dEStep);
virtual void FillDerivedHists()
Int_t FillAsCumulative(Double_t x, Double_t y, Double_t z, Double_t t)
Profile2D * Project3DProfile(Option_t *option) const
Profile3D * hNStepsVsPhiVsRVsZ
const TVector3 & GetPosition() const
Profile3D * hRelRadLengthVsPhiVsRVsZ
double GetHistZMin() const
double GetHistZMax() const
Profile3D * hELossVsPhiVsRVsZ
const StiScanPrgOptions & fPrgOptions
Command line arguments and options requested by the user.
const TStiKalmanTrackNode & GetDcaNode() const
double GetHistRMax() const
Processes and controls user options provided in the command line.
const std::set< TStiKalmanTrackNode > & GetNodes() const
const std::vector< TStiKalmanTrack > & GetTStiKalmanTracks() const
double GetHistRMin() const
const TVector3 & GetTrackP() const
void InitRange()
The default limits will be used if user provided values for min >= max.
Profile3D * hELossVsXVsYVsZ
void FillHists(const StiScanEvent &eventT, const std::set< std::string > *volumeList=0)
Profile3D * hDensityVsPhiVsRVsZ
bool mDoProjection
If true will create integral projections of 2D profiles instead of creating 1D profiles with bin aver...
StiScanHistContainer(StiScanPrgOptions &prgOpts, const char *name, TDirectory *motherDir=0, bool doProjection=true, Option_t *option="")