Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
#include "DataFormats/EcalDetId/interface/EBDetId.h"
#include "DataFormats/EcalDetId/interface/EEDetId.h"

template <class Item>
void getBarrelErrorSummary(typename std::vector<Item> vItems, long unsigned int& errorCount) {
  unsigned int stcode = 0;
  for (typename std::vector<Item>::const_iterator iItems = vItems.begin(); iItems != vItems.end(); ++iItems) {
    stcode = iItems->getStatusCode();
    if (stcode != 0)
      errorCount++;
  }
}

template <class Item>
void getEndCapErrorSummary(typename std::vector<Item> vItems,
                           long unsigned int& errorCountEE1,
                           long unsigned int& errorCountEE2,
                           long unsigned int& totalEE1,
                           long unsigned int& totalEE2) {
  unsigned int stcode = 0;
  EEDetId endcapId;
  long unsigned int count = 0;

  for (typename std::vector<Item>::const_iterator iItems = vItems.begin(); iItems != vItems.end(); ++iItems) {
    stcode = iItems->getStatusCode();
    if (stcode != 0) {
      endcapId = EEDetId::detIdFromDenseIndex(count);
      if (endcapId.zside() == -1)
        errorCountEE1++;
      if (endcapId.zside() == +1)
        errorCountEE2++;
    }

    if (endcapId.zside() == -1)
      totalEE1++;
    if (endcapId.zside() == +1)
      totalEE2++;
    count++;
  }
}