52 m_dedx_vs_eta =
new TProfile((
m_name +
"_dedx_vs_eta").c_str(),
"Energy loss vs. eta", 600, -3, 3);
53 m_dedx_vs_z =
new TProfile((
m_name +
"_dedx_vs_z").c_str(),
"Energy loss vs. Z", 6000, -300, 300);
54 m_dedx_vs_r =
new TProfile((
m_name +
"_dedx_vs_r").c_str(),
"Energy loss vs. R", 1200, 0, 120);
55 m_radlen_vs_eta =
new TProfile((
m_name +
"_radlen_vs_eta").c_str(),
"Radiation lengths vs. eta", 600, -3, 3);
56 m_radlen_vs_z =
new TProfile((
m_name +
"_radlen_vs_z").c_str(),
"Radiation lengths vs. Z", 6000, -300, 300);
57 m_radlen_vs_r =
new TProfile((
m_name +
"_radlen_vs_r").c_str(),
"Radiation lengths vs. R", 1200, 0, 120);
120 (m_buffer.in().y() + m_buffer.out().y()) / 2.,
121 (m_buffer.in().z() + m_buffer.out().z()) / 2. );
125 m_dedx_vs_z->Fill( average.
z(), m_buffer.energyLoss(), 1. );
128 m_radlen_vs_z->Fill( average.
z(), m_buffer.radiationLengths(), 1. );
137 TCanvas
canvas(name.c_str(), plot->GetTitle(), 1280, 1024);
138 plot->SetFillColor(15);
139 plot->SetLineColor(1);
141 canvas.GetFrame()->SetFillColor(kWhite);
143 canvas.SaveAs((name +
".png").c_str(),
"");
146 plot->SetDirectory(
m_file);
156 TH1F *
line =
new TH1F((name +
"_par").c_str(),
"Parametrization", 1, plot->GetXaxis()->GetXmin(), plot->GetXaxis()->GetXmax());
157 line->SetBinContent(1, average);
159 TCanvas
canvas(name.c_str(), plot->GetTitle(), 1280, 1024);
160 plot->SetFillColor(15);
161 plot->SetLineColor(1);
162 plot->SetLineWidth(2);
164 line->SetLineColor(2);
165 line->SetLineWidth(2);
167 canvas.GetFrame()->SetFillColor(kWhite);
169 canvas.SaveAs((name +
".png").c_str(),
"");
172 plot->SetDirectory(
m_file);
173 line->SetDirectory(
m_file);
179 std::stringstream
out;
180 out << std::setw(48) << std::left <<
m_name << std::right << std::fixed;;
183 out <<
" Elements: " << std::setw(6) <<
m_elements.size();
190 m_file =
new TFile((
m_name +
".root").c_str(),
"RECREATE");
MaterialAccountingGroup(const std::string &name, const DDCompactView &geometry)
explicit constructors
double averageRadiationLengths(void) const
return the average normalized number of radiation lengths
void endOfTrack(void)
commit the buffer and reset the "already hit by this track" flag
void addFilter(const DDFilter &, DDLogOp op=DDLogOp::AND)
MaterialAccountingStep m_errors
MaterialAccountingStep m_buffer
std::vector< GlobalPoint > m_elements
Global3DPoint GlobalPoint
std::pair< double, double > range_r() const
std::string info(void) const
get some infos
BoundingBox m_boundingbox
type of data representation of DDCompactView
double averageEnergyLoss(void) const
return the average normalized energy loss density factor for Bethe-Bloch
bool next()
set current node to the next node in the filtered tree
void savePlot(TH1F *plot, const std::string &name)
MaterialAccountingStep average(void) const
return the average normalized material accounting informations
void grow(double r, double z)
std::pair< double, double > range_z() const
const MaterialAccountingStep & material() const
static double const s_tolerance
XYZVectorD XYZVector
spatial vector with cartesian internal representation
void savePlots(void)
save the plots
const GlobalPoint & position() const
ESHandle< TrackerGeometry > geometry
T perp() const
Magnitude of transverse component.
bool inside(double r, double z) const
static int position[264][3]
TProfile * m_radlen_vs_eta
bool addDetector(const MaterialAccountingDetector &detector)
buffer material from a detector, if the detector is inside the DetLayer bounds
~MaterialAccountingGroup(void)
destructor
const DDTranslation & translation() const
The absolute translation of the current node.
MaterialAccountingStep m_accounting
volatile std::atomic< bool > shutdown_flag false
bool inside(const MaterialAccountingDetector &detector) const
check if detector is inside any part of this layer
void setCriteria(const DDValue &nameVal, DDCompOp, DDLogOp l=DDLogOp::AND, bool asString=true, bool merged=true)
The DDGenericFilter is a runtime-parametrized Filter looking on DDSpecifcs.