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>();
38 std::vector<HcalQIESample> samples;
39 for (
int fc=0;
fc<3;
fc++) {
50 switch (did.subdet()) {
56 for (
int i=0;
i<
samples_;
i++) hbhe->back().setSample(
i,samples[
i]);
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");
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)
void loadPatterns(const std::string &patspec)
edm::SortedCollection< HODataFrame > HODigiCollection
std::vector< int > bunches_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
std::vector< HcalFiberPattern > patterns_
virtual void produce(edm::Event &e, const edm::EventSetup &c)
T const * product() const
HcalPatternSource(const edm::ParameterSet &pset)
char data[epos_bytes_allocation]
edm::SortedCollection< HFDataFrame > HFDigiCollection
Readout chain identification for Hcal.
const DetId lookup(HcalElectronicsId fId) const
lookup the logical detid associated with the given electronics id
edm::SortedCollection< HBHEDataFrame > HBHEDigiCollection