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))
20 produces<HBHEDigiCollection>();
21 produces<HODigiCollection>();
22 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().setReadoutIds(eid);
61 hf->back().setSize(samples_);
63 for (
int i=0; i<
samples_; i++) hf->back().setSample(i,samples[i]);
64 hf->back().setReadoutIds(eid);
68 ho->back().setSize(samples_);
70 for (
int i=0; i<
samples_; i++) ho->back().setSample(i,samples[i]);
71 ho->back().setReadoutIds(eid);
89 wordexp(patspec.c_str(),&
p, WRDE_NOCMD);
91 for (
unsigned int i=0;
i<p.we_wordc;
i++) {
92 LogDebug (
"HCAL") <<
"Reading pattern file '" << files[
i] <<
"'";
102 std::map<std::string,std::string> params;
103 std::vector<uint32_t>
data;
104 FILE*
f=fopen(filename.c_str(),
"r");
105 if (f==
nullptr)
return;
109 int read=fread(block,1,4096,f);
110 buffer.append(block,block+read);
114 if (buffer.find(
"<?xml")!=0) {
118 while (buffer.find(
"<CFGBrick>",i)!=std::string::npos) {
119 i=buffer.find(
"<CFGBrick>",i);
120 j=buffer.find(
"</CFGBrick>",i);
121 element=
"<?xml version='1.0'?>\n";
122 element.append(buffer,i,j-i);
123 element.append(
"</CFGBrick>");
127 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