15 : bunches_(pset.getUntrackedParameter<
std::vector<
int> >(
"Bunches",
std::vector<
int>())),
16 presamples_(pset.getUntrackedParameter<
int>(
"Presamples", 4)),
17 samples_(pset.getUntrackedParameter<
int>(
"Samples", 10)) {
19 produces<HBHEDigiCollection>();
20 produces<HODigiCollection>();
21 produces<HFDigiCollection>();
32 auto hbhe = std::make_unique<HBHEDigiCollection>();
33 auto hf = std::make_unique<HFDigiCollection>();
34 auto ho = std::make_unique<HODigiCollection>();
38 std::vector<HcalQIESample>
samples;
39 for (
int fc = 0;
fc < 3;
fc++) {
50 switch (did.subdet()) {
57 hbhe->back().setSample(
i, samples[
i]);
58 hbhe->back().setReadoutIds(eid);
62 hf->back().setSize(samples_);
65 hf->back().setSample(i, samples[i]);
66 hf->back().setReadoutIds(eid);
70 ho->back().setSize(samples_);
73 ho->back().setSample(i, samples[i]);
74 ho->back().setReadoutIds(eid);
93 wordexp(patspec.c_str(), &
p, WRDE_NOCMD);
95 for (
unsigned int i = 0;
i < p.we_wordc;
i++) {
96 LogDebug(
"HCAL") <<
"Reading pattern file '" << files[
i] <<
"'";
106 std::map<std::string, std::string> params;
107 std::vector<uint32_t>
data;
108 FILE*
f = fopen(filename.c_str(),
"r");
114 int read = fread(block, 1, 4096, f);
115 buffer.append(block, block + read);
119 if (buffer.find(
"<?xml") != 0) {
123 while (buffer.find(
"<CFGBrick>", i) != std::string::npos) {
124 i = buffer.find(
"<CFGBrick>", i);
125 j = buffer.find(
"</CFGBrick>", i);
126 element =
"<?xml version='1.0'?>\n";
127 element.append(buffer, i, j - i);
128 element.append(
"</CFGBrick>");
132 parser.
parse(element, params, data);
void loadPatternFile(const std::string &filename)
EventNumber_t event() const
T getUntrackedParameter(std::string const &, T const &) const
void parse(const std::string &xmlDocument, std::map< std::string, std::string > ¶meters, std::vector< std::string > &items, std::string &encoding)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
void produce(edm::Event &e, const edm::EventSetup &c) override
void loadPatterns(const std::string &patspec)
std::vector< int > bunches_
std::vector< HcalFiberPattern > patterns_
HcalPatternSource(const edm::ParameterSet &pset)
char data[epos_bytes_allocation]
T const * product() const
Readout chain identification for Hcal.
const DetId lookup(HcalElectronicsId fId) const
lookup the logical detid associated with the given electronics id