Skip to content

Commit dd51bed

Browse files
committed
fix issue of potentially using wrong LS or run number in event object with FRDPreUnpack
1 parent 2ff2179 commit dd51bed

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

EventFilter/Utilities/interface/DAQSourceModelsFRD.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class DataModeFRDPreUnpack : public DataMode {
102102
void readEvent(edm::EventPrincipal& eventPrincipal) override;
103103

104104
//non-virtual
105-
void unpackEvent(edm::streamer::FRDEventMsgView* eview, UnpackedRawEventWrapper* ec);
105+
void unpackEvent(edm::streamer::FRDEventMsgView* eview, UnpackedRawEventWrapper* ec, unsigned int ls);
106106
void unpackFile(RawInputFile*) override;
107107
edm::Timestamp fillFEDRawDataCollection(edm::streamer::FRDEventMsgView* eview,
108108
FEDRawDataCollection& rawData,

EventFilter/Utilities/src/DAQSourceModelsFRD.cc

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ std::string DataModeFRD::getChecksumError() const {
189189
* FRD preRead
190190
*/
191191

192-
void DataModeFRDPreUnpack::unpackEvent(edm::streamer::FRDEventMsgView* eview, UnpackedRawEventWrapper* ec) {
192+
void DataModeFRDPreUnpack::unpackEvent(edm::streamer::FRDEventMsgView* eview, UnpackedRawEventWrapper* ec, unsigned int ls) {
193193
//TODO: also walk the file and build checksum
194194
FEDRawDataCollection* rawData = new FEDRawDataCollection;
195195
bool tcdsInRange;
@@ -203,7 +203,8 @@ void DataModeFRDPreUnpack::unpackEvent(edm::streamer::FRDEventMsgView* eview, Un
203203
if (err) {
204204
ec->setError(errmsg);
205205
} else if (daqSource_->useL1EventID()) {
206-
edm::EventID eventID = edm::EventID(daqSource_->eventRunNumber(), daqSource_->currentLumiSection(), L1EventID);
206+
//filelist mode run override not available with this model currently (source sets it too late)
207+
edm::EventID eventID = edm::EventID(ec->run(), ls, L1EventID);
207208
ec->setAux(new edm::EventAuxiliary(
208209
eventID, daqSource_->processGUID(), tstamp, eview->isRealData(), edm::EventAuxiliary::PhysicsTrigger));
209210
ec->aux()->setProcessHistoryID(daqSource_->processHistoryID());
@@ -216,8 +217,8 @@ void DataModeFRDPreUnpack::unpackEvent(edm::streamer::FRDEventMsgView* eview, Un
216217
tcds::Raw_v1 const* tcds = reinterpret_cast<tcds::Raw_v1 const*>(tcds_pointer + FEDHeader::length);
217218
edm::EventAuxiliary* aux = new edm::EventAuxiliary(); //allocate empty aux
218219
*aux = evf::evtn::makeEventAuxiliary(tcds,
219-
daqSource_->eventRunNumber(),
220-
daqSource_->currentLumiSection(),
220+
ec->run(),
221+
ls,
221222
eview->isRealData(),
222223
static_cast<edm::EventAuxiliary::ExperimentType>(fedHeader.triggerType()),
223224
daqSource_->processGUID(),
@@ -279,7 +280,7 @@ void DataModeFRDPreUnpack::unpackFile(RawInputFile* currentFile) {
279280
ec->setChecksumError(ss.str());
280281
//unpackEvent(eview.get(), ec);
281282
} else
282-
unpackEvent(eview.get(), ec);
283+
unpackEvent(eview.get(), ec, currentFile->lumi_);
283284
currentFile->queue(ec);
284285
}
285286
}
@@ -327,7 +328,7 @@ edm::Timestamp DataModeFRDPreUnpack::fillFEDRawDataCollection(edm::streamer::FRD
327328
throw cms::Exception("DataModeFRDPreUnpack:::fillFRDCollection")
328329
<< "Second TCDS FED ID " << fedId << " found. First ID: " << selectedTCDSFed;
329330
}
330-
//take event ID from GTPE FED
331+
//take event ID from GTPE FED
331332
FEDRawData& fedData = rawData.FEDData(fedId);
332333
fedData.resize(fedSize);
333334
memcpy(fedData.data(), event + eventSize, fedSize);
@@ -360,8 +361,6 @@ edm::Timestamp DataModeFRDPreUnpack::fillFEDRawDataCollection(edm::streamer::FRD
360361
} catch (cms::Exception &e) {
361362
err = true;
362363
errmsg = e.what();
363-
//std::cout << " DEBUG: " << errmsg << std::endl << std::flush;
364-
//assert(0);
365364
}
366365
return tstamp;
367366
}

EventFilter/Utilities/test/RunBUFU.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ ${CMDLINE_STARTFU} > out_2_fu.log 2>&1 || diefu "${CMDLINE_STARTFU}" $? $OUTDIR
161161
#no failures, clean up everything including logs if there are no errors
162162
rm -rf $OUTDIR/{ramdisk,data,*.log}
163163

164-
echo "running DAQSource test with striped event FRD"
164+
echo "running DAQSource test with striped event FRD (SFB)"
165165
CMDLINE_STARTBU="cmsRun startBU.py runNumber=${runnumber} fffBaseDir=${OUTDIR} maxLS=2 fedMeanSize=128 eventsPerFile=20 eventsPerLS=35 frdFileVersion=2 buBaseDir=ramdisk1 subsystems=TCDS,SiPixel,ECAL,RPC"
166166
${CMDLINE_STARTBU} > out_2_bu.log 2>&1 || diebu "${CMDLINE_STARTBU}" $? $OUTDIR
167167
CMDLINE_STARTBU="cmsRun startBU.py runNumber=${runnumber} fffBaseDir=${OUTDIR} maxLS=2 fedMeanSize=128 eventsPerFile=20 eventsPerLS=35 frdFileVersion=2 buBaseDir=ramdisk2 subsystems=SiStrip,HCAL,DT,CSC"
@@ -171,7 +171,7 @@ CMDLINE_STARTFU="cmsRun startFU_daqsource.py daqSourceMode=FRDStriped runNumber=
171171
${CMDLINE_STARTFU} > out_2_fu.log 2>&1 || diefu "${CMDLINE_STARTFU}" $? $OUTDIR out_2_fu.log
172172
rm -rf $OUTDIR/{ramdisk,data,*.log}
173173

174-
echo "running DAQSource test with unpacking in reader threads"
174+
echo "running DAQSource test with unpacking in reader threads (FRDPreUnpack)"
175175
CMDLINE_STARTBU="cmsRun startBU.py runNumber=${runnumber} fffBaseDir=${OUTDIR} maxLS=2 fedMeanSize=128 eventsPerFile=20 eventsPerLS=35 frdFileVersion=1"
176176
CMDLINE_STARTFU="cmsRun startFU_daqsource.py daqSourceMode=FRDPreUnpack runNumber=${runnumber} fffBaseDir=${OUTDIR}"
177177
${CMDLINE_STARTBU} > out_2_bu.log 2>&1 || diebu "${CMDLINE_STARTBU}" $? $OUTDIR

0 commit comments

Comments
 (0)