Skip to content

Commit

Permalink
move custom range setup to constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
smorovic committed Jul 30, 2020
1 parent 592ff6e commit 9341edc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
3 changes: 3 additions & 0 deletions EventFilter/Utilities/interface/FedRawDataInputSource.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ class FedRawDataInputSource : public edm::RawInputSource {
unsigned int eventsThisLumi_;
unsigned long eventsThisRun_ = 0;

uint16_t MINTCDSuTCAFEDID_ = FEDNumbering::MINTCDSuTCAFEDID;
uint16_t MAXTCDSuTCAFEDID_ = FEDNumbering::MAXTCDSuTCAFEDID;

/*
*
* Multithreaded file reader
Expand Down
24 changes: 10 additions & 14 deletions EventFilter/Utilities/src/FedRawDataInputSource.cc
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,15 @@ FedRawDataInputSource::FedRawDataInputSource(edm::ParameterSet const& pset, edm:
edm::LogInfo("FedRawDataInputSource") << "Construction. read-ahead chunk size -: " << std::endl
<< (eventChunkSize_ / 1048576) << " MB on host " << thishost;

if (testTCDSFEDRange_.size()) {
if (testTCDSFEDRange_.size() != 2) {
throw cms::Exception("FedRawDataInputSource::fillFEDRawDataCollection")
<< "Invalid TCDS Test FED range parameter";
}
MINTCDSuTCAFEDID_ = testTCDSFEDRange_[0];
MAXTCDSuTCAFEDID_ = testTCDSFEDRange_[1];
}

long autoRunNumber = -1;
if (fileListMode_) {
autoRunNumber = initFileList();
Expand Down Expand Up @@ -706,20 +715,7 @@ edm::Timestamp FedRawDataInputSource::fillFEDRawDataCollection(FEDRawDataCollect
const uint16_t fedId = fedHeader.sourceID();
if (fedId > FEDNumbering::MAXFEDID) {
throw cms::Exception("FedRawDataInputSource::fillFEDRawDataCollection") << "Out of range FED ID : " << fedId;
} else if (UNLIKELY(testTCDSFEDRange_.size())) {
if (testTCDSFEDRange_.size() != 2) {
throw cms::Exception("FedRawDataInputSource::fillFEDRawDataCollection")
<< "Invalid TCDS Test FED range parameter";
}
if (fedId >= testTCDSFEDRange_[0] && fedId <= testTCDSFEDRange_[1]) {
if (!selectedTCDSFed) {
selectedTCDSFed = fedId;
tcds_pointer_ = event + eventSize;
} else
throw cms::Exception("FedRawDataInputSource::fillFEDRawDataCollection")
<< "Second TCDS FED ID " << fedId << " found. First ID: " << selectedTCDSFed;
}
} else if (fedId >= FEDNumbering::MINTCDSuTCAFEDID && fedId <= FEDNumbering::MAXTCDSuTCAFEDID) {
} else if (fedId >= MINTCDSuTCAFEDID_ && fedId <= MAXTCDSuTCAFEDID_) {
if (!selectedTCDSFed) {
selectedTCDSFed = fedId;
tcds_pointer_ = event + eventSize;
Expand Down

0 comments on commit 9341edc

Please sign in to comment.