48 if (events.length()) {
49 for (
size_t pos1 = 0, pos2 = events.find(
',');; pos1 = pos2 + 1, pos2 = events.find(
',', pos2 + 1)) {
50 if (pos2 != std::string::npos) {
52 if (sscanf(events.substr(pos1, pos2 - pos1).c_str(),
"%ld", &
event) == 1 &&
event >= 0)
55 edm::LogError(
"CSCFileDumper") <<
" cannot parse events (" << events
56 <<
") parameter: " << events.substr(pos1, pos2 - pos1);
59 if (sscanf(events.substr(pos1, events.length() - pos1).c_str(),
"%ld", &
event) == 1 &&
event >= 0)
62 edm::LogError(
"CSCFileDumper") <<
" cannot parse events (" << events
63 <<
") parameter: " << events.substr(pos1, events.length() - pos1);
67 std::ostringstream
tmp;
70 edm::LogInfo(
"CSCFileDumper") <<
" Following events will be dumped: " << tmp.str();
72 edm::LogInfo(
"CSCFileDumper") <<
" All events will be dumped";
78 fclose(stream->second);
95 const FEDRawData &fedData = rawdata->FEDData(
id);
96 unsigned short int length = fedData.
size();
100 std::ostringstream
name;
101 name <<
output <<
"_FED" <<
id <<
".raw" << std::ends;
103 if ((file = fopen(name.str().c_str(),
"wt")) ==
nullptr) {
104 edm::LogError(
"CSCFileDumper") <<
"Cannot open the file: " << name.str();
112 size_t size = length / 2;
113 const unsigned short *
buf = (
unsigned short *)fedData.
data();
114 fwrite(buf, 2, size, stream->second);
CSCFileDumper(edm::ParameterSet const &pset)
edm::EDGetTokenT< FEDRawDataCollection > i_token
Token for consumes interface & access to data.
EventNumber_t event() const
T getUntrackedParameter(std::string const &, T const &) const
const edm::EventSetup & c
uint16_t *__restrict__ id
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void analyze(const edm::Event &e, const edm::EventSetup &c) override
Log< level::Error, false > LogError
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
size_t size() const
Lenght of the data buffer in bytes.
std::set< unsigned long > eventsToDump
std::vector< unsigned int > cscFEDids
std::map< int, FILE * > dump_files
Log< level::Info, false > LogInfo
~CSCFileDumper(void) override
T getParameter(std::string const &) const
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
tuple size
Write out results.