Skip to content

Commit 5569b45

Browse files
authored
Merge pull request cms-sw#33799 from barvic/csccommissioning_filereader_crash_fix
IORawData/CSCCommissioning file reader fixes
2 parents 8558347 + bfbfc60 commit 5569b45

File tree

3 files changed

+52
-2
lines changed

3 files changed

+52
-2
lines changed

IORawData/CSCCommissioning/src/CSCFileReader.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,12 @@ CSCFileReader::CSCFileReader(const edm::ParameterSet &pset) {
3737
// this is ok as long as eighter of RUI or FU are are provided in .cfg (not both)
3838
nActiveRUIs = 0;
3939
nActiveFUs = 0;
40-
fFirstReadBug = true;
40+
41+
/// Legacy first read EDM EvendID bug (fixed?).
42+
/// Currently disabled to fix number of events with data
43+
/// Added as configurable parameter
44+
// fFirstReadBug = true;
45+
fFirstReadBug = pset.getUntrackedParameter<bool>("FirstReadBug", false);
4146
for (int unit = 0; unit < nRUIs; unit++) {
4247
std::ostringstream ruiName, fuName;
4348
ruiName << "RUI" << (unit < 10 ? "0" : "") << unit << std::ends;

IORawData/CSCCommissioning/src/FileReaderDCC.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ FileReaderDCC::FileReaderDCC(void) {
1717
throw std::runtime_error(std::string("Wrong platform: sizeof(unsigned long long)!=8 || sizeof(unsigned short)!=2"));
1818
raw_event = new unsigned short[200000 * 40];
1919
end = (file_buffer_end = file_buffer + sizeof(file_buffer) / sizeof(unsigned long long));
20-
bzero(raw_event, sizeof(raw_event) * 200000 * 40);
20+
bzero(raw_event, sizeof(unsigned short) * 200000 * 40);
2121
bzero(file_buffer, sizeof(file_buffer));
2222
word_0 = 0;
2323
word_1 = 0;
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import FWCore.ParameterSet.Config as cms
2+
from FWCore.ParameterSet.VarParsing import VarParsing
3+
4+
process = cms.Process("reader")
5+
6+
process.load("FWCore.MessageLogger.MessageLogger_cfi")
7+
process.MessageLogger.cout.threshold = cms.untracked.string('INFO')
8+
process.MessageLogger.debugModules = cms.untracked.vstring('*')
9+
10+
process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(True) )
11+
12+
options = VarParsing ('analysis')
13+
options.register ("firstRun", 341761, VarParsing.multiplicity.singleton, VarParsing.varType.int)
14+
options.maxEvents = 10000
15+
options.parseArguments()
16+
17+
# Better to know actual number of events in the .raw data file to set maxEvents.
18+
# Otherwise it doesn't stop automatically at the end of reading of .raw data file
19+
process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(options.maxEvents) )
20+
21+
process.source = cms.Source("EmptySource",
22+
firstRun= cms.untracked.uint32(options.firstRun),
23+
numberEventsInLuminosityBlock = cms.untracked.uint32(200),
24+
numberEventsInRun = cms.untracked.uint32(0)
25+
)
26+
27+
# For B904 setup ME11 chamber, which corresponds to ME+1/1/02 in the production system mapping
28+
# changing to FED837 and RUI16 could let to pass data without disabling mapping consistency check unpacking flags
29+
process.rawDataCollector = cms.EDProducer('CSCFileReader',
30+
firstEvent = cms.untracked.int32(0),
31+
FED846 = cms.untracked.vstring('RUI01'),
32+
RUI01 = cms.untracked.vstring('/afs/cern.ch/user/b/barvic/public/cscgem_tests/csc_00000001_EmuRUI01_Local_000_210422_152923_UTC.raw')
33+
# FED837 = cms.untracked.vstring('RUI16'),
34+
# RUI16 = cms.untracked.vstring('/afs/cern.ch/user/b/barvic/public/cscgem_tests/csc_00000001_EmuRUI01_Local_000_210519_162820_UTC.raw')
35+
)
36+
37+
process.FEVT = cms.OutputModule("PoolOutputModule",
38+
fileName = cms.untracked.string("/tmp/barvic/csc_00000001_EmuRUI01_Local_000_210422_152923_UTC.root"),
39+
outputCommands = cms.untracked.vstring("keep *")
40+
)
41+
42+
process.p = cms.Path( process.rawDataCollector)
43+
44+
process.outpath = cms.EndPath(process.FEVT)
45+

0 commit comments

Comments
 (0)