17 #include "TProfile2D.h"
25 using namespace geant_units::operators;
37 const std::vector<std::string>
names_;
40 const double etaLow_, etaHigh_,
phiLow_, phiHigh_;
49 : names_(p.getParameter<std::
vector<std::
string> >(
"names")),
50 tag_(p.getParameter<edm::
InputTag>(
"inputTag")),
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 = {
74 "BEAM",
"BEAM1",
"BEAM2",
"BEAM3",
"BEAM4",
"Tracker",
"ECAL",
"HCal",
"MUON",
"VCAL",
"MGNT",
"OQUA",
"CALOEC"};
75 desc.
add<std::vector<std::string> >(
"names",
names);
77 desc.
add<
int>(
"nBinEta", 300);
78 desc.
add<
int>(
"nBinPhi", 180);
79 desc.
add<
double>(
"etaLow", -6.0);
80 desc.
add<
double>(
"etaHigh", 6.0);
81 descriptions.
add(
"materialBudgetVolumeAnalysis", desc);
88 unsigned int nsize(0),
ntot(0), nused(0);
90 if (materialInformationContainer.
isValid()) {
92 nsize = materialInformationContainer->size();
94 for (
const auto& it : *(materialInformationContainer.
product())) {
104 meStepEta_[
k]->Fill(it.trackEta(), it.stepLength());
105 meRadLEta_[
k]->Fill(it.trackEta(), it.radiationLength());
106 meIntLEta_[
k]->Fill(it.trackEta(), it.interactionLength());
107 meStepPhi_[
k]->Fill(it.trackPhi(), it.stepLength());
108 meRadLPhi_[
k]->Fill(it.trackPhi(), it.radiationLength());
109 meIntLPhi_[
k]->Fill(it.trackPhi(), it.interactionLength());
110 meStepEtaPhi_[
k]->Fill(it.trackEta(), it.trackPhi(), it.stepLength());
111 meRadLEtaPhi_[
k]->Fill(it.trackEta(), it.trackPhi(), it.radiationLength());
112 meIntLEtaPhi_[
k]->Fill(it.trackEta(), it.trackPhi(), it.interactionLength());
117 edm::LogVerbatim(
"MaterialBudget") <<
"MaterialInformation with " << nsize <<
":" <<
ntot <<
" elements of which "
118 << nused <<
" are used";
125 for (
unsigned int k = 0;
k <
names_.size(); ++
k) {
126 sprintf(name,
"stepEta%s",
names_[
k].c_str());
127 sprintf(title,
"MB(Step) vs #eta for %s",
names_[
k].c_str());
129 sprintf(name,
"radlEta%s",
names_[
k].c_str());
130 sprintf(title,
"MB(X0) vs #eta for %s",
names_[
k].c_str());
132 sprintf(name,
"intlEta%s",
names_[
k].c_str());
133 sprintf(title,
"MB(L0) vs #eta for %s",
names_[
k].c_str());
135 sprintf(name,
"stepPhi%s",
names_[
k].c_str());
136 sprintf(title,
"MB(Step) vs #phi for %s",
names_[
k].c_str());
138 sprintf(name,
"radlPhi%s",
names_[
k].c_str());
139 sprintf(title,
"MB(X0) vs #phi for %s",
names_[
k].c_str());
141 sprintf(name,
"intlPhi%s",
names_[
k].c_str());
142 sprintf(title,
"MB(L0) vs #phi for %s",
names_[
k].c_str());
144 sprintf(name,
"stepEtaPhi%s",
names_[
k].c_str());
145 sprintf(title,
"MB(Step) vs #eta and #phi for %s",
names_[
k].c_str());
148 sprintf(name,
"radlEtaPhi%s",
names_[
k].c_str());
149 sprintf(title,
"MB(X0) vs #eta and #phi for %s",
names_[
k].c_str());
152 sprintf(name,
"intlEtaPhi%s",
names_[
k].c_str());
153 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 &)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
std::vector< TProfile * > meRadLEta_
T * make(const Args &...args) const
make new ROOT object
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
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
T const * product() const
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_