#include #include using namespace std; namespace RAT { void OwlCut::BeginOfRun(DS::Run&) { fLClean = DB::Get()->GetLink("DATACLEANING",fName); fMode = fLClean->GetI("mode"); fTotThresh = fLClean->GetI("tot_thresh"); fOwlThresh = fLClean->GetI("owl_thresh"); fButtThresh = fLClean->GetI("butt_thresh"); } Processor::Result OwlCut::DSEvent(DS::Run&, DS::Entry& ds) { bool pass = true; // If any triggered event fails, they all fail for( size_t iEV = 0; iEV < ds.GetEVCount(); iEV++ ) if( Event(ds, ds.GetEV(iEV)) != OKTRUE ) pass = false; return pass ? OKTRUE : OKFALSE; } Processor::Result OwlCut::Event(DS::Entry&, DS::EV& ev) { fPassFlag = true; int owlcount = ev.GetUncalPMTs().GetOWLCount(); int buttcount = ev.GetUncalPMTs().GetBUTTCount(); if (fMode == 1){ if ((owlcount + buttcount) >= fTotThresh) fPassFlag = false; }else{ if ((owlcount >= fOwlThresh) || (buttcount >= fButtThresh)) fPassFlag = false; } // now update the mask UpdateMask(ev); return fPassFlag ? OKFALSE : OKTRUE; } } // namespace RAT