106 int calibType = -1 ;
int numEmptyFEDs = 0 ;
107 std::vector<int> calibTypeCounter(8,0) ;
111 if ( fedData.
size() < 24 ) numEmptyFEDs++ ;
112 if ( fedData.
size() < 24 )
continue ;
114 calibTypeCounter.at(value)++ ;
119 for (
unsigned int i=0;
i<calibTypeCounter.size();
i++) {
120 if ( calibTypeCounter.at(
i) >
maxCount ) { calibType =
i ; maxCount = calibTypeCounter.at(
i) ; }
121 if ( maxCount == numberOfFEDIds ) break ;
123 if ( maxCount != (numberOfFEDIds-numEmptyFEDs) )
124 edm::LogWarning(
"HcalCalibTypeFilter") <<
"Conflicting calibration types found. Assigning type " 126 LogDebug(
"HcalCalibTypeFilter") <<
"Calibration type is: " << calibType ;
145 edm::LogWarning(
"HcalCalibTypeFilter") <<
"Summary of filter decisions: "
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
~HcalCalibTypeFilter() override
std::vector< int > CalibTypes_
size_t size() const
Lenght of the data buffer in bytes.
#define DEFINE_FWK_MODULE(type)
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
bool filter(edm::Event &, const edm::EventSetup &) override
HcalCalibTypeFilter(const edm::ParameterSet &)
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
edm::EDGetTokenT< FEDRawDataCollection > tok_data_
std::vector< int > eventsByType