diff --git a/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/LoadEventNexus.h b/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/LoadEventNexus.h index 653821f52558..d38e3ddc64c7 100644 --- a/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/LoadEventNexus.h +++ b/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/LoadEventNexus.h @@ -127,6 +127,8 @@ namespace Mantid double shortest_tof; /// Count of all the "bad" tofs found. These are events with TOF > 2e8 microsec size_t bad_tofs; + /// A count of events discarded because they came from a pixel that's not in the IDF + size_t discarded_events; /// Do we pre-count the # of events in each pixel ID? bool precount; diff --git a/Code/Mantid/Framework/DataHandling/src/LoadEventNexus.cpp b/Code/Mantid/Framework/DataHandling/src/LoadEventNexus.cpp index d2f2733bd380..9bc3217b43a7 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadEventNexus.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadEventNexus.cpp @@ -170,11 +170,11 @@ class ProcessBankData : public Task void run() { //Local tof limits - double my_shortest_tof, my_longest_tof; - my_shortest_tof = static_cast(std::numeric_limits::max()) * 0.1; - my_longest_tof = 0.; + double my_shortest_tof = static_cast(std::numeric_limits::max()) * 0.1; + double my_longest_tof = 0.; // A count of "bad" TOFs that were too high size_t badTofs = 0; + size_t my_discarded_events(0); prog->report(entry_name + ": precount"); @@ -295,6 +295,10 @@ class ProcessBankData : public Task eventVector->push_back( WeightedEvent(tof, pulsetime, weight, errorSq) ); #endif } + else + { + ++my_discarded_events; + } } else { @@ -310,6 +314,10 @@ class ProcessBankData : public Task eventVector->push_back( TofEvent(tof, pulsetime) ); #endif } + else + { + ++my_discarded_events; + } } //Local tof limits @@ -364,6 +372,7 @@ class ProcessBankData : public Task if (my_shortest_tof < alg->shortest_tof) { alg->shortest_tof = my_shortest_tof;} if (my_longest_tof > alg->longest_tof ) { alg->longest_tof = my_longest_tof;} alg->bad_tofs += badTofs; + alg->discarded_events += my_discarded_events; } @@ -938,7 +947,7 @@ class LoadBankFromDiskTask : public Task /// Empty default constructor LoadEventNexus::LoadEventNexus() : IFileLoader(), - event_id_is_spec(false), m_allBanksPulseTimes(NULL) + discarded_events(0), event_id_is_spec(false), m_allBanksPulseTimes(NULL) { } @@ -1170,6 +1179,14 @@ void LoadEventNexus::exec() // Load the detector events WS = createEmptyEventWorkspace(); // Algorithm currently relies on an object-level workspace ptr loadEvents(&prog, false); // Do not load monitor blocks + + if ( discarded_events > 0 ) + { + g_log.information() << discarded_events + << " events were encountered coming from pixels which are not in the Instrument Definition File." + "These events were discarded.\n"; + } + //add filename WS->mutableRun().addProperty("Filename",m_filename); //Save output