17 edm::ProducerSourceFromFiles(pset,desc,
true),
18 m_quiet( pset.getUntrackedParameter<
bool>("quiet",true)),
19 m_onlyRemapped( pset.getUntrackedParameter<
bool>("onlyRemapped",
false))
26 unpackSetup(pset.getUntrackedParameter<std::vector<std::string> >(
"streams",std::vector<std::string>()));
27 produces<FEDRawDataCollection>();
31 for (std::vector<std::string>::const_iterator
i=params.begin();
i!=params.end();
i++) {
32 unsigned long pos=
i->find(
':');
35 if (pos!=std::string::npos)
36 remapTo=atoi(
i->c_str()+pos+1);
40 edm::LogInfo(
"HCAL") << streamName <<
" --> " << remapTo << endl;
42 edm::LogInfo(
"HCAL") << streamName <<
" using fedid in file" << endl;
62 m_file=TFile::Open(filename.c_str());
64 edm::LogError(
"HCAL") <<
"Unable to open " << filename << endl;
74 edm::LogError(
"HCAL") <<
"Unable to find CMSRAW tree" << endl;
79 edm::LogInfo(
"HCAL") <<
"Opening '" << filename <<
"' with " <<
m_tree->GetEntries() <<
" events.\n";
82 TObjArray* lb=
m_tree->GetListOfBranches();
84 for (
int i=0;
i<lb->GetSize();
i++) {
85 TBranch*
b=(TBranch*)lb->At(
i);
87 if (!strcmp(b->GetClassName(),
"CDFEventInfo")) {
91 if (strcmp(b->GetClassName(),
"CDFChunk"))
continue;
96 edm::LogInfo(
"HCAL") <<
"Also reading branch " << b->GetName();
142 time = present_time + time_between_events;
148 auto bare_product = std::make_unique<FEDRawDataCollection>();
162 unsigned int*
header=(
unsigned int*)fed.
data();
163 header[0]=(header[0]&0xFFF000FFu)|(
id<<8);
167 edm::LogInfo(
"HCAL") <<
"Reading " << len <<
" bytes for FED " <<
id << std::endl;
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
ClassImp(CDFChunk) ClassImp(CDFEventInfo) using namespace edm
def getData(doc, options, dataset, site)
virtual bool setRunAndEventInfo(edm::EventID &id, edm::TimeValue_t &time, edm::EventAuxiliary::ExperimentType &)
std::vector< std::string > const & fileNames() const
void openFile(const std::string &filename)
void resize(size_t newsize)
unsigned int timeBetweenEvents() const
Global information about an event such as event number and run number.
virtual void produce(edm::Event &e)
unsigned long long TimeValue_t
UInt_t getRunNumber() const
get the run number
CDFChunk * m_chunks[CHUNK_COUNT]
int m_chunkIds[CHUNK_COUNT]
void unpackSetup(const std::vector< std::string > ¶ms)
TimeValue_t presentTime() const
char data[epos_bytes_allocation]
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
LuminosityBlockNumber_t luminosityBlock() const
CDFEventInfo * m_eventInfo
Int_t getDataLength() const
std::map< std::string, int > m_sourceIdRemap
ULong64_t getEventNumber() const
get the event number
unsigned long long TimeValue_t