CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_9/src/CalibCalorimetry/CaloMiscalibTools/interface/CaloMiscalibMapHcal.h

Go to the documentation of this file.
00001 #ifndef _CALO_MISCALIB_MAP_HCAL
00002 #define _CALO_MISCALIB_MAP_HCAL
00003 #include "CalibCalorimetry/CaloMiscalibTools/interface/CaloMiscalibMap.h"
00004 #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h"
00005 #include "Geometry/Records/interface/IdealGeometryRecord.h"
00006 #include "Geometry/CaloGeometry/interface/CaloGeometry.h"
00007 #include "FWCore/Framework/interface/EDProducer.h"
00008 #include "DataFormats/HcalDetId/interface/HcalDetId.h"
00009 #include "Geometry/CaloTopology/interface/HcalTopology.h"
00010 
00011 #include <iostream>
00012 #include <iomanip>
00013 #include <map>
00014 #include <vector>
00015 
00016 
00017 
00018 class CaloMiscalibMapHcal: public CaloMiscalibMap {
00019 public:
00020 CaloMiscalibMapHcal(){ 
00021 }
00022 
00023 void prefillMap(){
00024 
00025   for (int det = 1; det < 5; det++) {
00026     for (int eta = -63; eta < 64; eta++) {
00027       for (int phi = 0; phi < 128; phi++) {
00028         for (int depth = 1; depth < 5; depth++) {
00029 
00030           try {
00031             HcalDetId hcaldetid ((HcalSubdetector) det, eta, phi, depth);
00032             if (topology.valid(hcaldetid))
00033             //      mapHcal_.setValue(hcaldetid.rawId(),1.0);
00034             {
00035               mapHcal_[hcaldetid.rawId()]=1.0; 
00036               //              std::cout << "Valid cell found: " << det << " " << eta << " " << phi << " " << depth << std::endl;
00037             }
00038                 
00039           }
00040           catch (...) {
00041           }
00042         }
00043       }
00044     }
00045   }
00046 }
00047 
00048 
00049 virtual void addCell(const DetId &cell, float scaling_factor)
00050 {
00051   //mapHcal_.setValue(cell.rawId(),scaling_factor);
00052   mapHcal_[cell.rawId()]=scaling_factor;
00053 }
00054 
00055 void print()
00056  {
00057  
00058  std::map<uint32_t,float>::const_iterator it;
00059  
00060  //   for(it=mapHcal_.getMap().begin();it!=mapHcal_.getMap().end();it++){
00061  //   }
00062    for(it=mapHcal_.begin();it!=mapHcal_.end();it++){
00063    }
00064  
00065 }
00066 
00067 const std::map<uint32_t, float> & get(){
00068 return mapHcal_;
00069 }
00070 
00071 private:
00072 
00073    std::map<uint32_t, float> mapHcal_;
00074    HcalTopology topology;
00075    // EcalIntercalibConstants map_;
00076    // const CaloSubdetectorGeometry *geometry;
00077 };
00078 
00079 #endif