Go to the documentation of this file.00001 #ifndef _CALO_MISCALIB_MAP_ECAL
00002 #define _CALO_MISCALIB_MAP_ECAL
00003 #include "CondFormats/EcalObjects/interface/EcalIntercalibConstants.h"
00004 #include "CalibCalorimetry/CaloMiscalibTools/interface/CaloMiscalibMap.h"
00005 #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h"
00006 #include "Geometry/Records/interface/IdealGeometryRecord.h"
00007 #include "Geometry/CaloGeometry/interface/CaloGeometry.h"
00008 #include "FWCore/Framework/interface/EDProducer.h"
00009 #include "DataFormats/Common/interface/EDProduct.h"
00010 #include "DataFormats/EcalDetId/interface/EBDetId.h"
00011 #include "DataFormats/EcalDetId/interface/EEDetId.h"
00012 #include <iostream>
00013 #include <iomanip>
00014 #include <map>
00015 #include <vector>
00016
00017
00018
00019 class CaloMiscalibMapEcal: public CaloMiscalibMap {
00020 public:
00021 CaloMiscalibMapEcal(){
00022 }
00023
00024 void prefillMap(){
00025
00026
00027 for(int iEta=-EBDetId::MAX_IETA; iEta<=EBDetId::MAX_IETA ;++iEta) {
00028 if(iEta==0) continue;
00029 for(int iPhi=EBDetId::MIN_IPHI; iPhi<=EBDetId::MAX_IPHI; ++iPhi) {
00030
00031 try
00032 {
00033 EBDetId ebdetid(iEta,iPhi);
00034 map_.setValue(ebdetid.rawId(),1.0);
00035 }
00036 catch (...)
00037 {
00038 }
00039 }
00040 }
00041
00042 for(int iX=EEDetId::IX_MIN; iX<=EEDetId::IX_MAX ;++iX) {
00043 for(int iY=EEDetId::IY_MIN; iY<=EEDetId::IY_MAX; ++iY) {
00044 try
00045 {
00046 EEDetId eedetidpos(iX,iY,1);
00047 map_.setValue(eedetidpos.rawId(),1.0);
00048 EEDetId eedetidneg(iX,iY,-1);
00049 map_.setValue(eedetidneg.rawId(),1.0);
00050 }
00051 catch (...)
00052 {
00053 }
00054 }
00055 }
00056
00057
00058 }
00059
00060
00061 virtual void addCell(const DetId &cell, float scaling_factor)
00062 {
00063 map_.setValue(cell.rawId(),scaling_factor);
00064 }
00065
00066 void print()
00067 {
00068
00069 int icount=0;
00070 for(int iEta=-EBDetId::MAX_IETA; iEta<=EBDetId::MAX_IETA ;++iEta) {
00071 if(iEta==0) continue;
00072 for(int iPhi=EBDetId::MIN_IPHI; iPhi<=EBDetId::MAX_IPHI; ++iPhi) {
00073 if (EBDetId::validDetId(iEta,iPhi))
00074 {
00075 EBDetId ebdetid(iEta,iPhi);
00076 EcalIntercalibConstantMap::const_iterator icalit= map_.find(ebdetid.rawId());
00077 EcalIntercalibConstant icalconst;
00078 icalconst = (*icalit);
00079
00080 icount++;
00081 if(icount%230==0){
00082 std::cout<< "here is value for chan eta/phi "<<iEta<<"/"<<iPhi<<"="<<icalconst<<std::endl;}
00083 }
00084 }
00085 }
00086 for(int iX=EEDetId::IX_MIN; iX<=EEDetId::IX_MAX ;++iX) {
00087 for(int iY=EEDetId::IY_MIN; iY<=EEDetId::IY_MAX; ++iY) {
00088 if (EEDetId::validDetId(iX,iY,1))
00089 {
00090 EEDetId eedetidpos(iX,iY,1);
00091 EcalIntercalibConstantMap::const_iterator icalit= map_.find(eedetidpos.rawId());
00092 EcalIntercalibConstant icalconst;
00093 icalconst = (*icalit);
00094
00095 EEDetId eedetidneg(iX,iY,-1);
00096 EcalIntercalibConstantMap::const_iterator icalit2= map_.find(eedetidneg.rawId());
00097 EcalIntercalibConstant icalconst2;
00098 icalconst2 = (*icalit2);
00099
00100
00101 icount++;
00102 if(icount%230==0){
00103
00104 std::cout<< "here is value for chan x/y "<<iX<<"/"<<iY<<" pos side is ="<<icalconst<< " and neg side is= "<< icalconst2<<std::endl;}
00105
00106 }
00107 }
00108 }
00109
00110 }
00111
00112 const EcalIntercalibConstants & get(){
00113 return map_;
00114 }
00115
00116 private:
00117
00118 EcalIntercalibConstants map_;
00119 const CaloSubdetectorGeometry *geometry;
00120 };
00121
00122 #endif