CMS 3D CMS Logo

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

Generated on Tue Jun 9 17:25:12 2009 for CMSSW by  doxygen 1.5.4