46 std::cout <<
"Opening file: " << inFile << std::endl;
47 TFile inputFile(inFile.c_str());
48 std::cout <<
"Reading tree: " << treename << std::endl;
49 TTreeReader reader(treename.c_str(), &inputFile);
52 std::vector<Acts::MaterialTrack> mrecords;
53 std::cout <<
"Accessing Branch 'MaterialTracks'" << std::endl;
54 TTreeReaderValue<Acts::MaterialTrack> mtRecord(reader,
"MaterialTracks");
55 while (reader.Next()) { mrecords.push_back(*mtRecord); }
58 std::cout <<
"Creating new output file: " << outFile
62 TFile outputFile(outFile.c_str(),
"recreate");
64 TProfile* t_phi =
new TProfile(
"t_phi",
"t_phi", binsPhi, minPhi, maxPhi);
65 TProfile* t_eta =
new TProfile(
"t_eta",
"t_eta", binsEta, minEta, maxEta);
67 =
new TProfile(
"t_theta",
"t_theta", binsTheta, minTheta, maxTheta);
71 =
new TProfile(
"tInX0_phi",
"tInX0_phi", binsPhi, minPhi, maxPhi);
73 =
new TProfile(
"tInX0_eta",
"tInX0_eta", binsEta, minEta, maxEta);
74 TProfile* tInX0_theta =
new TProfile(
75 "tInX0_theta",
"tInX0_theta", binsTheta, minTheta, maxTheta);
78 =
new TProfile(
"tInL0_phi",
"tInL0_phi", binsPhi, minPhi, maxPhi);
80 =
new TProfile(
"tInL0_eta",
"tInL0_eta", binsEta, minEta, maxEta);
81 TProfile* tInL0_theta =
new TProfile(
82 "tInL0_theta",
"tInL0_theta", binsTheta, minTheta, maxTheta);
84 TProfile* A_phi =
new TProfile(
"A_phi",
"A_phi", binsPhi, minPhi, maxPhi);
85 TProfile* A_eta =
new TProfile(
"A_eta",
"A_eta", binsEta, minEta, maxEta);
87 =
new TProfile(
"A_theta",
"A_theta", binsTheta, minTheta, maxTheta);
89 TProfile* Z_phi =
new TProfile(
"Z_phi",
"Z_phi", binsPhi, minPhi, maxPhi);
90 TProfile* Z_eta =
new TProfile(
"Z_eta",
"Z_eta", binsEta, minEta, maxEta);
92 =
new TProfile(
"Z_theta",
"Z_theta", binsTheta, minTheta, maxTheta);
95 =
new TProfile(
"rho_phi",
"rho_phi", binsPhi, minPhi, maxPhi);
97 =
new TProfile(
"rho_eta",
"rho_eta", binsEta, minEta, maxEta);
99 =
new TProfile(
"rho_theta",
"rho_theta", binsTheta, minTheta, maxTheta);
101 TProfile* x0_phi =
new TProfile(
"x0_phi",
"x0_phi", binsPhi, minPhi, maxPhi);
102 TProfile* x0_eta =
new TProfile(
"x0_eta",
"x0_eta", binsEta, minEta, maxEta);
104 =
new TProfile(
"x0_theta",
"x0_theta", binsTheta, minTheta, maxTheta);
106 TProfile* l0_phi =
new TProfile(
"l0_phi",
"l0_phi", binsPhi, minPhi, maxPhi);
107 TProfile* l0_eta =
new TProfile(
"l0_eta",
"l0_eta", binsEta, minEta, maxEta);
109 =
new TProfile(
"l0_theta",
"l0_theta", binsTheta, minTheta, maxTheta);
111 for (
auto& mrecord : mrecords) {
112 std::vector<Acts::MaterialStep>
steps = mrecord.materialSteps();
113 float theta = mrecord.theta();
114 float eta = -log(tan(theta * 0.5));
124 for (
auto&
step : steps) {
126 float t =
step.material().thickness();
127 float r =
step.material().material().massDensity();
128 thickness +=
step.material().thickness();
130 A +=
step.material().material().Ar() * r *
t;
131 Z +=
step.material().material().Z() * r *
t;
132 tInX0 += (t != 0. &&
step.material().x0() != 0.)
133 ? t /
step.material().x0()
136 tInL0 += (t != 0. &&
step.material().x0() != 0.)
137 ? t /
step.material().l0()
146 t_phi->Fill(phi, thickness);
147 t_theta->Fill(theta, thickness);
148 t_eta->Fill(eta, thickness);
151 x0_phi->Fill(phi, thickness / tInX0);
152 x0_theta->Fill(theta, thickness / tInX0);
153 x0_eta->Fill(eta, thickness / tInX0);
157 l0_phi->Fill(phi, thickness / tInL0);
158 l0_theta->Fill(theta, thickness / tInL0);
159 l0_eta->Fill(eta, thickness / tInL0);
162 tInX0_phi->Fill(phi, tInX0);
163 tInX0_theta->Fill(theta, tInX0);
164 tInX0_eta->Fill(eta, tInX0);
166 tInL0_phi->Fill(phi, tInL0);
167 tInL0_theta->Fill(theta, tInL0);
168 tInL0_eta->Fill(eta, tInL0);
171 A_theta->Fill(theta, A);
175 Z_theta->Fill(theta, Z);
178 rho_phi->Fill(phi, rho);
179 rho_theta->Fill(theta, rho);
180 rho_eta->Fill(eta, rho);
191 tInX0_theta->Write();
198 tInL0_theta->Write();