Skip to content

Commit

Permalink
Merge pull request #34279 from perrotta/initializeMsize
Browse files Browse the repository at this point in the history
Initialize file size for MatacqProducer::msize
  • Loading branch information
cmsbuild committed Jul 1, 2021
2 parents c454f21 + 6f02448 commit 9519f09
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions EventFilter/EcalRawToDigi/plugins/MatacqProducer.cc
Expand Up @@ -364,7 +364,7 @@ bool MatacqProducer::getMatacqEvent(uint32_t runNumber, int32_t orbitId, bool fi
filepos_t pos = posEstim_.pos(orbitId);

// struct stat st;
filepos_t fsize;
filepos_t fsize = -1;
// if(0==stat(inFileName_.c_str(), &st)){
if (msize(fsize)) {
// const int64_t fsize = st.st_size;
Expand Down Expand Up @@ -747,19 +747,24 @@ void MatacqProducer::PosEstimator::init(MatacqProducer* mp) {
return;
}

filepos_t s;
filepos_t s = -1;
mp->msize(s);

//number of complete events:
const unsigned nEvents = s / eventLength_ / 8;

if (nEvents == 0) {
if (s == -1) {
if (verbosity_)
cout << "[Matacq " << now() << "] File is missing!" << endl;
orbitStepMean_ = 0;
return;
} else if (s == 0) {
if (verbosity_)
cout << "[Matacq " << now() << "] File is empty!" << endl;
orbitStepMean_ = 0;
return;
}

//number of complete events:
const unsigned nEvents = s / eventLength_ / 8;

if (verbosity_ > 1)
cout << "[Matacq " << now() << "] File size: " << s << " Number of events: " << nEvents << endl;

Expand Down

0 comments on commit 9519f09

Please sign in to comment.