17 #include "TProfile2D.h" 37 const std::vector<std::string>
names_;
40 const double etaLow_, etaHigh_,
phiLow_, phiHigh_;
51 binEta_(
p.getParameter<
int>(
"nBinEta")),
52 binPhi_(
p.getParameter<
int>(
"nBinPhi")),
53 etaLow_(
p.getParameter<double>(
"etaLow")),
54 etaHigh_(
p.getParameter<double>(
"etaHigh")),
58 tok_info_ = consumes<edm::MaterialInformationContainer>(
tag_);
62 << -1._pi <<
":" << 1._pi <<
" for " <<
names_.size() <<
" detectors from " 64 std::ostringstream st1;
65 for (
unsigned int k = 0;
k <
names_.size(); ++
k)
66 st1 <<
" [" <<
k <<
"] " <<
names_[
k];
73 std::vector<std::string>
names = {
"BEAM",
87 desc.add<std::vector<std::string> >(
"names",
names);
89 desc.add<
int>(
"nBinEta", 300);
90 desc.add<
int>(
"nBinPhi", 180);
91 desc.add<
double>(
"etaLow", -6.0);
92 desc.add<
double>(
"etaHigh", 6.0);
93 descriptions.
add(
"materialBudgetVolumeAnalysis",
desc);
100 unsigned int nsize(0),
ntot(0), nused(0);
102 if (materialInformationContainer.
isValid()) {
104 nsize = materialInformationContainer->size();
106 for (
const auto& it : *(materialInformationContainer.
product())) {
116 meStepEta_[
k]->Fill(it.trackEta(), it.stepLength());
117 meRadLEta_[
k]->Fill(it.trackEta(), it.radiationLength());
118 meIntLEta_[
k]->Fill(it.trackEta(), it.interactionLength());
119 meStepPhi_[
k]->Fill(it.trackPhi(), it.stepLength());
120 meRadLPhi_[
k]->Fill(it.trackPhi(), it.radiationLength());
121 meIntLPhi_[
k]->Fill(it.trackPhi(), it.interactionLength());
122 meStepEtaPhi_[
k]->Fill(it.trackEta(), it.trackPhi(), it.stepLength());
123 meRadLEtaPhi_[
k]->Fill(it.trackEta(), it.trackPhi(), it.radiationLength());
124 meIntLEtaPhi_[
k]->Fill(it.trackEta(), it.trackPhi(), it.interactionLength());
129 edm::LogVerbatim(
"MaterialBudget") <<
"MaterialInformation with " << nsize <<
":" <<
ntot <<
" elements of which " 130 << nused <<
" are used";
137 for (
unsigned int k = 0;
k <
names_.size(); ++
k) {
139 sprintf(
title,
"MB(Step) vs #eta for %s",
names_[
k].c_str());
142 sprintf(
title,
"MB(X0) vs #eta for %s",
names_[
k].c_str());
145 sprintf(
title,
"MB(L0) vs #eta for %s",
names_[
k].c_str());
148 sprintf(
title,
"MB(Step) vs #phi for %s",
names_[
k].c_str());
151 sprintf(
title,
"MB(X0) vs #phi for %s",
names_[
k].c_str());
154 sprintf(
title,
"MB(L0) vs #phi for %s",
names_[
k].c_str());
157 sprintf(
title,
"MB(Step) vs #eta and #phi for %s",
names_[
k].c_str());
161 sprintf(
title,
"MB(X0) vs #eta and #phi for %s",
names_[
k].c_str());
165 sprintf(
title,
"MB(L0) vs #eta and #phi for %s",
names_[
k].c_str());
static const std::string kSharedResource
Log< level::Info, true > LogVerbatim
std::vector< TProfile * > meStepPhi_
std::vector< TProfile * > meIntLPhi_
std::vector< TProfile2D * > meStepEtaPhi_
std::vector< TProfile2D * > meIntLEtaPhi_
MaterialBudgetVolumeAnalysis(edm::ParameterSet const &)
T const * product() const
std::vector< TProfile * > meRadLEta_
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
const std::string names[nVars_]
example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
std::vector< TProfile * > meRadLPhi_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void analyze(edm::Event const &, edm::EventSetup const &) override
#define DEFINE_FWK_MODULE(type)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
const std::vector< std::string > names_
std::vector< TProfile * > meIntLEta_
std::vector< TProfile2D * > meRadLEtaPhi_
std::vector< TProfile * > meStepEta_
edm::EDGetTokenT< edm::MaterialInformationContainer > tok_info_