18 m_quiet(
pset.getUntrackedParameter<
bool>(
"quiet",
true)),
19 m_onlyRemapped(
pset.getUntrackedParameter<
bool>(
"onlyRemapped",
false)),
20 m_skip(
pset.getUntrackedParameter<uint32_t>(
"skipEvents", 0)) {
27 edm::LogWarning(
"HcalTBSource") <<
"skipEvents != 0 works only for the first input file";
29 unpackSetup(
pset.getUntrackedParameter<std::vector<std::string> >(
"streams", std::vector<std::string>()));
30 produces<FEDRawDataCollection>();
34 for (std::vector<std::string>::const_iterator
i =
params.begin();
i !=
params.end();
i++) {
35 unsigned long pos =
i->find(
':');
38 if (
pos != std::string::npos)
39 remapTo = atoi(
i->c_str() +
pos + 1);
41 m_sourceIdRemap.insert(std::pair<std::string, int>(streamName, remapTo));
43 edm::LogInfo(
"HCAL") << streamName <<
" --> " << remapTo << endl;
45 edm::LogInfo(
"HCAL") << streamName <<
" using fedid in file" << endl;
77 edm::LogError(
"HCAL") <<
"Unable to find CMSRAW tree" << endl;
85 TObjArray* lb =
m_tree->GetListOfBranches();
87 for (
int i = 0;
i < lb->GetSize();
i++) {
88 TBranch*
b = (TBranch*)lb->At(
i);
91 if (!strcmp(
b->GetClassName(),
"CDFEventInfo")) {
95 if (strcmp(
b->GetClassName(),
"CDFChunk"))
102 edm::LogInfo(
"HCAL") <<
"Also reading branch " <<
b->GetName();
155 time = present_time + time_between_events;
160 auto bare_product = std::make_unique<FEDRawDataCollection>();
174 unsigned int*
header = (
unsigned int*)fed.
data();
179 edm::LogInfo(
"HCAL") <<
"Reading " << len <<
" bytes for FED " <<
id << std::endl;
UInt_t getRunNumber() const
get the run number
ULong64_t getEventNumber() const
get the event number
Log< level::Error, false > LogError
unsigned int timeBetweenEvents() const
void openFile(const std::string &filename)
LuminosityBlockNumber_t luminosityBlock() const
Int_t getDataLength() const
Global information about an event such as event number and run number.
unsigned long long TimeValue_t
TimeValue_t presentTime() const
CDFChunk * m_chunks[CHUNK_COUNT]
Log< level::Info, false > LogInfo
int m_chunkIds[CHUNK_COUNT]
HcalTBSource(const edm::ParameterSet &pset, edm::InputSourceDescription const &desc)
void unpackSetup(const std::vector< std::string > ¶ms)
void resize(size_t newsize, size_t wordsize=8)
char data[epos_bytes_allocation]
std::vector< std::string > fileNames(unsigned iCatalog) const
std::map< std::string, int > m_sourceIdRemap
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
CDFEventInfo * m_eventInfo
bool setRunAndEventInfo(edm::EventID &id, edm::TimeValue_t &time, edm::EventAuxiliary::ExperimentType &) override
Log< level::Warning, false > LogWarning
void produce(edm::Event &e) override