Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:01:32

0001 #include "DataFormats/EcalDetId/interface/EBDetId.h"
0002 #include "DataFormats/EcalDetId/interface/EEDetId.h"
0003 
0004 template <class Item>
0005 void getBarrelErrorSummary(typename std::vector<Item> vItems, long unsigned int& errorCount) {
0006   unsigned int stcode = 0;
0007   for (typename std::vector<Item>::const_iterator iItems = vItems.begin(); iItems != vItems.end(); ++iItems) {
0008     stcode = iItems->getStatusCode();
0009     if (stcode != 0)
0010       errorCount++;
0011   }
0012 }
0013 
0014 template <class Item>
0015 void getEndCapErrorSummary(typename std::vector<Item> vItems,
0016                            long unsigned int& errorCountEE1,
0017                            long unsigned int& errorCountEE2,
0018                            long unsigned int& totalEE1,
0019                            long unsigned int& totalEE2) {
0020   unsigned int stcode = 0;
0021   EEDetId endcapId;
0022   long unsigned int count = 0;
0023 
0024   for (typename std::vector<Item>::const_iterator iItems = vItems.begin(); iItems != vItems.end(); ++iItems) {
0025     stcode = iItems->getStatusCode();
0026     if (stcode != 0) {
0027       endcapId = EEDetId::detIdFromDenseIndex(count);
0028       if (endcapId.zside() == -1)
0029         errorCountEE1++;
0030       if (endcapId.zside() == +1)
0031         errorCountEE2++;
0032     }
0033 
0034     if (endcapId.zside() == -1)
0035       totalEE1++;
0036     if (endcapId.zside() == +1)
0037       totalEE2++;
0038     count++;
0039   }
0040 }