#include #include namespace RAT { void PollingCut::BeginOfRun(DS::Run&) { fLClean = DB::Get()->GetLink("DATACLEANING",fName); // The run when we switched to the new way of marking polling fRunSwitch = fLClean->GetI("switch_run"); fHasWarned = false; currentRun = 0; } Processor::Result PollingCut::DSEvent(DS::Run& run, DS::Entry& ds) { currentRun = run.GetRunID(); 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 PollingCut::Event(DS::Entry&, DS::EV& ev) { fPassFlag = true; if(currentRun < fRunSwitch){ fPassFlag = PollingMarkedByTUBII(ev); } else{ fPassFlag = PollingMarkedByMTC(ev); } // Update the mask UpdateMask(ev); return fPassFlag ? OKFALSE : OKTRUE; } bool PollingCut::PollingMarkedByTUBII(DS::EV& ev){ int ext2_bit = 16; int mtca_mimic1_bit = 16; bool mtca_mimic = false; bool ext2 = false; // Check the MTCD EXT2 before the TUBii trig word Int_t mtcd_trig_word = ev.GetTrigType(); ext2 = (mtcd_trig_word & (1 << ext2_bit)) != 0; if(ext2) { if(!ev.TUBiiTrigExists()) { if (!fHasWarned) { fHasWarned = true; warn<<"Can't perform Polling cut, tubii data is missing"<