Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-09-16 03:23:16

0001 #ifndef _CALO_MISCALIB_MAP_HCAL
0002 #define _CALO_MISCALIB_MAP_HCAL
0003 #include "CalibCalorimetry/CaloMiscalibTools/interface/CaloMiscalibMap.h"
0004 #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h"
0005 #include "Geometry/Records/interface/IdealGeometryRecord.h"
0006 #include "Geometry/CaloGeometry/interface/CaloGeometry.h"
0007 #include "DataFormats/HcalDetId/interface/HcalDetId.h"
0008 #include "DataFormats/HcalDetId/interface/HcalSubdetector.h"
0009 #include "Geometry/CaloTopology/interface/HcalTopology.h"
0010 
0011 #include <iostream>
0012 #include <iomanip>
0013 #include <map>
0014 #include <vector>
0015 
0016 class CaloMiscalibMapHcal : public CaloMiscalibMap {
0017 public:
0018   CaloMiscalibMapHcal() {}
0019 
0020   void prefillMap(const HcalTopology &topology) {
0021     for (int det = 1; det <= HcalForward; det++) {
0022       for (int eta = -HcalDetId::kHcalEtaMask2; eta <= (int)(HcalDetId::kHcalEtaMask2); eta++) {
0023         for (unsigned int phi = 1; phi <= HcalDetId::kHcalPhiMask2; phi++) {
0024           for (unsigned int depth = 1; depth <= HcalDetId::kHcalDepthMask2; depth++) {
0025             try {
0026               HcalDetId hcaldetid((HcalSubdetector)det, eta, phi, depth);
0027               if (topology.valid(hcaldetid)) {
0028                 mapHcal_[hcaldetid.rawId()] = 1.0;
0029                 //        std::cout << "Valid cell found: " << det << " " << eta << " " << phi << " " << depth << std::endl;
0030               }
0031 
0032             } catch (...) {
0033             }
0034           }
0035         }
0036       }
0037     }
0038   }
0039 
0040   void addCell(const DetId &cell, float scaling_factor) override {
0041     //mapHcal_.setValue(cell.rawId(),scaling_factor);
0042     mapHcal_[cell.rawId()] = scaling_factor;
0043   }
0044 
0045   void print() {
0046     std::map<uint32_t, float>::const_iterator it;
0047 
0048     //   for(it=mapHcal_.getMap().begin();it!=mapHcal_.getMap().end();it++){
0049     //   }
0050     for (it = mapHcal_.begin(); it != mapHcal_.end(); it++) {
0051     }
0052   }
0053 
0054   const std::map<uint32_t, float> &get() { return mapHcal_; }
0055 
0056 private:
0057   std::map<uint32_t, float> mapHcal_;
0058   // EcalIntercalibConstants map_;
0059   // const CaloSubdetectorGeometry *geometry;
0060 };
0061 
0062 #endif