74 verbosity_(iConfig.getUntrackedParameter<
int>(
"verbosity", 0)),
75 recHitHBHE_(iConfig.getUntrackedParameter<
edm::InputTag>(
"recHitHBHE",
edm::InputTag(
"hbhereco"))),
76 preRecHitHBHE_(iConfig.getUntrackedParameter<
edm::InputTag>(
"preRecHitHBHE",
edm::InputTag(
"hbheprereco"))),
95 descriptions.
add(
"hcalCollapseAnalyzer", desc);
101 <<
" starts ==============";
113 edm::LogVerbatim(
"Collapse") <<
"Handle PreReco " << hbheprereco <<
" Size " << hbheprereco->
size();
120 <<
" and hbheprereco: " << prerecohbhe->
size();
121 double sfrac = (prerecohbhe->
empty()) ? 1 : ((
double)(recohbhe->
size())) / ((double)(prerecohbhe->
size()));
124 for (
const auto &
hit : (*recohbhe)) {
128 std::vector<HcalDetId> ids;
131 edm::LogVerbatim(
"Collapse") <<
id <<
" is derived from " << ids.size() <<
" components";
132 for (
unsigned int k = 0;
k < ids.size(); ++
k)
136 double energy =
hit.energy();
139 for (
const auto phit : (*prerecohbhe)) {
140 if (
std::find(ids.begin(), ids.end(), phit.id()) != ids.end()) {
141 etot += phit.energy();
142 double frac = (energy > 0) ? phit.energy() / energy : 1.0;
145 edm::LogVerbatim(
"Collapse") <<
"Frac[" << k <<
"] " << frac <<
" for " << phit.id();
149 double frac = (energy > 0) ? etot / energy : 1.0;
161 h_merge = ibooker.
book1D(
"h_merge",
"Number of hits merged", 10, 0.0, 10.0);
162 h_size = ibooker.
book1D(
"h_size",
"Size of the RecHit collection", 100, 500.0, 1500.0);
163 h_depth = ibooker.
book1D(
"h_depth",
"Depth of the Id's used", 10, 0.0, 10.0);
164 h_sfrac = ibooker.
book1D(
"h_sfrac",
"Ratio of sizes of preRecHit and RecHit collections", 150, 0.0, 1.5);
165 h_frac = ibooker.
book1D(
"h_frac",
"Fraction of energy before collapse", 150, 0.0, 1.5);
166 h_balance = ibooker.
book1D(
"h_balance",
"Balance of energy between pre- and post-collapse", 100, 0.5, 1.5);
~HcalCollapseAnalyzer() override
EventNumber_t event() const
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
#define DEFINE_FWK_MODULE(type)
void setCurrentFolder(std::string const &fullpath)
const edm::InputTag preRecHitHBHE_
MonitorElement * book1D(Args &&...args)
void analyze(edm::Event const &, edm::EventSetup const &) override
void unmergeDepthDetId(const HcalDetId &id, std::vector< HcalDetId > &ids) const
ParameterDescriptionBase * add(U const &iLabel, T const &value)
HcalCollapseAnalyzer(const edm::ParameterSet &)
T const * product() const
void add(std::string const &label, ParameterSetDescription const &psetDescription)
edm::EDGetTokenT< HBHERecHitCollection > tok_prehbhe_
const edm::InputTag recHitHBHE_
const std::string topFolderName_
MonitorElement * h_balance
T const * product() const
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_