24 ZSFIRWeights_(nFIRTaps, 0.),
59 if(weights.size() == 1){
60 vector<double> normWeights;
61 for(vector<float>::iterator it(weights[0].
begin()); it != weights[0].end(); it++)
62 normWeights.push_back(*it);
66 else edm::LogWarning(
"EcalDQM") <<
"SelectiveReadoutTask: DCC weight set is not exactly 1.";
81 MESet& meDCCSizeProf(
MEs_.at(
"DCCSizeProf"));
84 float ebSize(0.), eemSize(0.), eepSize(0.);
87 for(
int iFED(601); iFED <= 654; iFED++){
89 meDCCSize.fill(iFED - 600, size);
90 meDCCSizeProf.fill(iFED - 600, size);
105 std::vector<short>
const& feStatus(dcchItr->getFEStatus());
106 unsigned nFE(feStatus.size());
107 for(
unsigned iFE(0); iFE < nFE; ++iFE)
112 template<
typename SRFlagCollection>
116 MESet& meFlagCounterMap(
MEs_.at(
"FlagCounterMap"));
117 MESet& meFullReadoutMap(
MEs_.at(
"FullReadoutMap"));
120 MESet& meRUForcedMap(
MEs_.at(
"RUForcedMap"));
126 int flag(srf.value());
128 meFlagCounterMap.fill(
id);
139 meFullReadoutMap.fill(
id);
153 meRUForcedMap.fill(
id);
159 template<
typename DigiCollection>
163 MESet& meHighIntOutput(
MEs_.at(
"HighIntOutput"));
164 MESet& meLowIntOutput(
MEs_.at(
"LowIntOutput"));
165 MESet& meHighIntPayload(
MEs_.at(
"HighIntPayload"));
166 MESet& meLowIntPayload(
MEs_.at(
"LowIntPayload"));
167 MESet& meTowerSize(
MEs_.at(
"TowerSize"));
168 MESet& meZSFullReadoutMap(
MEs_.at(
"ZSFullReadoutMap"));
169 MESet& meFRDroppedMap(
MEs_.at(
"FRDroppedMap"));
170 MESet& meZSFullReadout(
MEs_.at(
"ZSFullReadout"));
171 MESet& meFRDropped(
MEs_.at(
"FRDropped"));
173 bool isEB(_collection ==
kEBDigi);
177 std::vector<unsigned> sizes(nTower, 0);
179 int nHighInt[] = {0, 0};
180 int nLowInt[] = {0, 0};
182 for(
typename DigiCollection::const_iterator digiItr(_digis.begin()); digiItr != _digis.end(); ++digiItr){
184 DetId const&
id(digiItr->id());
198 if(
flags_[iRU] < 0)
continue;
208 bool gain12saturated(
false);
209 const int gain12(0x01);
211 for(
int iWeight(0); iWeight <
nFIRTaps; ++iWeight){
215 if(iSample >= 0 && iSample < frame.
size()){
217 if(sample.
gainId() != gain12){
218 gain12saturated =
true;
223 edm::LogWarning(
"EcalDQM") <<
"SelectiveReadoutTask: Not enough samples in data frame or 'ecalDccZs1stSample' module parameter is not valid";
229 else ZSFIRValue /= (0x1 << 8);
238 meHighIntOutput.fill(
id, ZSFIRValue);
245 meLowIntOutput.fill(
id, ZSFIRValue);
265 for(
unsigned iTower(0); iTower < nTower; ++iTower, ++iRU){
272 meTowerSize.fill(
id, towerSize);
274 if(
flags_[iRU] < 0)
continue;
276 int dccid(
dccId(
id));
283 bool ruFullyReadout(sizes[iTower] ==
getElectronicsMap()->dccTowerConstituents(dccid, towerid).
size());
286 meZSFullReadoutMap.fill(
id);
287 meZSFullReadout.fill(
id);
291 meFRDroppedMap.fill(
id);
292 meFRDropped.fill(
id);
301 throw cms::Exception(
"InvalidConfiguration") <<
"weightsForZsFIR" << std::endl;
303 bool notNormalized(
false), notInt(
false);
304 for(std::vector<double>::const_iterator it(_normWeights.begin()); it != _normWeights.end(); ++it){
305 if(*it > 1.) notNormalized =
true;
306 if(
int(*it) != *it) notInt =
true;
308 if(notInt && notNormalized){
310 <<
"weigtsForZsFIR paramater values are not valid: they " 311 <<
"must either be integer and uses the hardware representation " 312 <<
"of the weights or less or equal than 1 and used the normalized " 313 <<
"representation.";
324 const int maxWeight(0xEFF);
T getUntrackedParameter(std::string const &, T const &) const
static EcalTrigTowerDetId detIdFromDenseIndex(uint32_t di)
#define DEFINE_ECALDQM_WORKER(TYPE)
static const int SRF_FORCED_MASK
std::vector< short > flags_
EcalElectronicsMapping const * getElectronicsMap()
std::vector< T >::const_iterator const_iterator
void runOnDigis(DigiCollection const &, Collections)
int hashedIndex() const
get a compact index for arrays [TODO: NEEDS WORK]
static EcalScDetId unhashIndex(int hi)
std::vector< std::vector< float > > dccNormalizedWeights_
void setFIRWeights_(std::vector< double > const &)
void beginEvent(edm::Event const &, edm::EventSetup const &) override
int gainId() const
get the gainId (2 bits)
void runOnRawData(EcalRawDataCollection const &)
size_t size() const
Lenght of the data buffer in bytes.
void setParams(edm::ParameterSet const &) override
Container::value_type value_type
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
void addDependencies(DependencySet &) override
void beginRun(edm::Run const &, edm::EventSetup const &) override
static const int SRF_FULL
Abs< T >::type abs(const T &t)
EcalTrigTowerDetId tower() const
get the HCAL/trigger iphi of this crystal
void runOnSrFlags(SRFlagCollection const &, Collections)
unsigned towerId(DetId const &)
const_iterator end() const
void runOnSource(FEDRawDataCollection const &)
void push_back(Dependency const &_d)
unsigned dccId(DetId const &)
std::set< std::pair< int, int > > suppressed_
const_iterator begin() const
int adc() const
get the ADC sample (12 bits)
std::vector< int > ZSFIRWeights_