33 : bunches_(pset.getUntrackedParameter<std::
vector<int> >(
"Bunches", std::
vector<int>())),
34 presamples_(pset.getUntrackedParameter<int>(
"Presamples", 4)),
35 samples_(pset.getUntrackedParameter<int>(
"Samples", 10)),
38 produces<HBHEDigiCollection>();
39 produces<HODigiCollection>();
40 produces<HFDigiCollection>();
52 auto hbhe = std::make_unique<HBHEDigiCollection>();
53 auto hf = std::make_unique<HFDigiCollection>();
54 auto ho = std::make_unique<HODigiCollection>();
58 std::vector<HcalQIESample> samples;
59 for (
int fc = 0; fc < 3; fc++) {
70 switch (did.subdet()) {
77 hbhe->back().setSample(
i, samples[
i]);
78 hbhe->back().setReadoutIds(eid);
82 hf->back().setSize(samples_);
85 hf->back().setSample(i, samples[i]);
86 hf->back().setReadoutIds(eid);
90 ho->back().setSize(samples_);
93 ho->back().setSample(i, samples[i]);
94 ho->back().setReadoutIds(eid);
113 wordexp(patspec.c_str(), &
p, WRDE_NOCMD);
115 for (
unsigned int i = 0;
i < p.we_wordc;
i++) {
116 LogDebug(
"HCAL") <<
"Reading pattern file '" << files[
i] <<
"'";
126 std::map<std::string, std::string>
params;
127 std::vector<uint32_t>
data;
128 FILE*
f = fopen(filename.c_str(),
"r");
134 int read = fread(block, 1, 4096, f);
135 buffer.append(block, block + read);
139 if (buffer.find(
"<?xml") != 0) {
143 while (buffer.find(
"<CFGBrick>", i) != std::string::npos) {
144 i = buffer.find(
"<CFGBrick>", i);
145 j = buffer.find(
"</CFGBrick>", i);
146 element =
"<?xml version='1.0'?>\n";
147 element.append(buffer, i,
j - i);
148 element.append(
"</CFGBrick>");
152 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.
const edm::EventSetup & c
void produce(edm::Event &e, const edm::EventSetup &c) override
#define DEFINE_FWK_MODULE(type)
void loadPatterns(const std::string &patspec)
bool getData(T &iHolder) const
std::vector< int > bunches_
const edm::ESGetToken< HcalElectronicsMap, HcalElectronicsMapRcd > theHcalElectronicsMapToken_
std::vector< HcalFiberPattern > patterns_
~HcalPatternSource() override
HcalPatternSource(const edm::ParameterSet &pset)
char data[epos_bytes_allocation]
Log< level::Warning, false > LogWarning
Readout chain identification for Hcal.