Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:10:41

0001 #ifndef HCALDATAFRAMEFILTER_H
0002 #define HCALDATAFRAMEFILTER_H 1
0003 
0004 #include "DataFormats/HcalDigi/interface/HcalDigiCollections.h"
0005 #include "DataFormats/HcalDigi/interface/HcalUnpackerReport.h"
0006 #include "CalibFormats/HcalObjects/interface/HcalDbService.h"
0007 
0008 /** \class HcalDataFrameFilter
0009     
0010     Utility algorithm for filtering out digis from testbeam, etc where
0011     no zero-suppression was applied.  The digis can be required to
0012     have correct form (capid rotation, error bit off, data-valid bit
0013     on).  It can also be filtered by simple amplitude requirements.
0014     As these are applied in units proportional to energy, rather than
0015     transverse energy, and no calibration is applied, care should be used.
0016    
0017    \author J. Mans - Minnesota
0018 */
0019 class HcalDataFrameFilter {
0020 public:
0021   HcalDataFrameFilter(bool requireCapid,
0022                       bool requireDVER,
0023                       bool energyFilter,
0024                       int firstSample = -1,
0025                       int lastSample = -1,
0026                       double minAmpl = -1);
0027   /// filter HB/HE data frames
0028   HBHEDigiCollection filter(const HBHEDigiCollection& incol, HcalUnpackerReport& r);
0029   /// filter HF data frames
0030   HFDigiCollection filter(const HFDigiCollection& incol, HcalUnpackerReport& r);
0031   /// filter HO data frames
0032   HODigiCollection filter(const HODigiCollection& incol, HcalUnpackerReport& r);
0033   /// filter HO data frames
0034   HcalCalibDigiCollection filter(const HcalCalibDigiCollection& incol, HcalUnpackerReport& r);
0035   /// filter ZDC data frames
0036   ZDCDigiCollection filter(const ZDCDigiCollection& incol, HcalUnpackerReport& r);
0037   /// filter QIE10 data frames
0038   QIE10DigiCollection filter(const QIE10DigiCollection& incol, HcalUnpackerReport& r);
0039   /// filter QIE11 data frames
0040   QIE11DigiCollection filter(const QIE11DigiCollection& incol, HcalUnpackerReport& r);
0041   /// whether any filters are on
0042   bool active() const;
0043   /// get conditions
0044   void setConditions(const HcalDbService* conditions);
0045 
0046 private:
0047   bool requireCapid_;
0048   bool requireDVER_;
0049   bool energyFilter_;
0050   int firstSample_, lastSample_;
0051   double minimumAmplitude_;
0052   const HcalDbService* conditions_;
0053 };
0054 
0055 #endif