//////////////////////////////////////////////////////////////////// // // Utility to assist with the implementation of data cleaning cuts // in ROOT. Functions to obtain a data cleaning word and to check // event passes data cleaning cuts. Note: The data cleaning processor // should be applied to the data. If not all cuts in the mask have been // applied the program will exit. // // Author: J Walker // /contact R. Knapik // // REVISION HISTORY: // 2015-06-02 : J Walker - First version. // 2015-06-09 : J Walker - Now lists which cuts have not been applied and then dies. // 2017-01-20 : R. Knapik- changed Die to warn and change contact person // 2017-04-05 : R. Knapik- Checks the dCApplied flags in the current pass, // if the first applied bit is zero, fPass = fPass -1. // //////////////////////////////////////////////////////////////////// #ifndef SRC_UTIL_DATACLEANINGUTILITY_HH_ #define SRC_UTIL_DATACLEANINGUTILITY_HH_ #include #include #include #include #include namespace RAT { // Get data cleaning word from bitmask name // // name: name of the bitmask in DATACLEANING.ratdb // Returns the data cleaning word ULong64_t GetDataCleaningWord( const std::string& bitMask ); // Get data cleaning word from a vector of cut names // // cutnames: names of cuts // Returns the data cleaning word ULong64_t GetDataCleaningWord( const std::vector& cutnames ); // Check event passes data cleaning cuts // // pass: pass number (defaults to the current pass number) // Returns true if the event is clean Bool_t EventIsClean( const RAT::DS::EV& ev, const ULong64_t dataCleaningWord, const Int_t pass = -1 ); // Check bitmask against data cleaning word. Used by EventIsClean function. // // bitMask: from DataQCFlags. Flags or Applied // Returns true if the bits match Bool_t CheckMask( const RAT::DS::BitMask& bitMask, const ULong64_t dataCleaningWord ); // Lists bits missing from bitmask compared to data cleaning word. Used by EventIsClean function. // // bitMask: Applied bitMask from DataQCFlags void MissingBits( const RAT::DS::BitMask& bitMask, const ULong64_t dataCleaningWord ); } #endif // SRC_UTIL_DATACLEANINGUTILITY_HH_