12 #include <DD4hep/DD4hepUnits.h> 35 bool firstChild = fv.firstChild();
39 for (
const auto&
j : fv.specpars()) {
40 for (
const auto&
k :
j.second->paths) {
42 std::vector<std::vector<cms::Node*>>
children = fv.children(
k);
48 <<
"MaterialAccountingGroup:\t" 49 <<
"Adding element at (r,z) " <<
gp.perp() <<
"," <<
gp.z() << std::endl;
62 <<
"MaterialAccountingGroup:\t" 66 m_dedx_spectrum = std::make_shared<TH1F>((
m_name +
"_dedx_spectrum").c_str(),
"Energy loss spectrum", 1000, 0., 1.);
68 std::make_shared<TH1F>((
m_name +
"_radlen_spectrum").c_str(),
"Radiation lengths spectrum", 1000, 0., 1.);
69 m_dedx_vs_eta = std::make_shared<TProfile>((
m_name +
"_dedx_vs_eta").c_str(),
"Energy loss vs. eta", 600, -3., 3.);
70 m_dedx_vs_z = std::make_shared<TProfile>((
m_name +
"_dedx_vs_z").c_str(),
"Energy loss vs. Z", 6000, -300., 300.);
71 m_dedx_vs_r = std::make_shared<TProfile>((
m_name +
"_dedx_vs_r").c_str(),
"Energy loss vs. R", 1200, 0., 120.);
73 std::make_shared<TProfile>((
m_name +
"_radlen_vs_eta").c_str(),
"Radiation lengths vs. eta", 600, -3., 3.);
75 std::make_shared<TProfile>((
m_name +
"_radlen_vs_z").c_str(),
"Radiation lengths vs. Z", 6000, -300., 300.);
77 std::make_shared<TProfile>((
m_name +
"_radlen_vs_r").c_str(),
"Radiation lengths vs. R", 1200, 0., 120.);
152 m_file = std::make_unique<TFile>((
m_name +
".root").c_str(),
"RECREATE");
167 plot->SetFillColor(15);
168 plot->SetLineColor(1);
170 canvas.GetFrame()->SetFillColor(kWhite);
177 std::unique_ptr<TH1F>
line = std::make_unique<TH1F>(
178 (
name +
"_par").c_str(),
"Parametrization", 1,
plot->GetXaxis()->GetXmin(),
plot->GetXaxis()->GetXmax());
183 plot->SetFillColor(15);
184 plot->SetLineColor(1);
185 plot->SetLineWidth(2);
187 line->SetLineColor(2);
188 line->SetLineWidth(2);
190 canvas.GetFrame()->SetFillColor(kWhite);
199 std::stringstream
out;
Log< level::Info, true > LogVerbatim
MaterialAccountingStep m_buffer
std::shared_ptr< TH1F > m_radlen_spectrum
std::shared_ptr< TProfile > m_dedx_vs_eta
Global3DPoint GlobalPoint
double sigmaRadiationLengths(void) const
bool addDetector(const MaterialAccountingDetector &detector)
DD4hep_MaterialAccountingGroup(const DD4hep_MaterialAccountingGroup &layer)=delete
const std::string & name(void) const
const GlobalPoint & in(void) const
static constexpr double s_tolerance
std::pair< double, double > range_z() const
MaterialAccountingStep m_accounting
double averageLength(void) const
MaterialAccountingStep average(void) const
std::string info(void) const
std::shared_ptr< TProfile > m_radlen_vs_r
T perp() const
Magnitude of transverse component.
bool inside(const double &r, const double &z) const
MaterialAccountingStep m_errors
double sigmaLength(void) const
double averageEnergyLoss(void) const
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
double length(void) const
void grow(const double &r, const double &z)
std::unique_ptr< TFile > m_file
double sigmaEnergyLoss(void) const
std::pair< double, double > range_r() const
bool isInside(const MaterialAccountingDetector &detector) const
std::shared_ptr< TProfile > m_radlen_vs_eta
std::vector< GlobalPoint > m_elements
const GlobalPoint & out(void) const
static int position[264][3]
std::shared_ptr< TProfile > m_dedx_vs_r
std::shared_ptr< TProfile > m_radlen_vs_z
double radiationLengths(void) const
std::shared_ptr< TProfile > m_dedx_vs_z
double energyLoss(void) const
BoundingBox m_boundingbox
std::shared_ptr< TH1F > m_dedx_spectrum
double averageRadiationLengths(void) const
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > Translation
void savePlot(std::shared_ptr< TH1F > &plot, const std::string &name)