CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
PhotonFixCMS Class Reference

#include <PhotonFixCMS.h>

Public Member Functions

double fixedEnergy () const
 
const PhotonFixphotonFix () const
 
 PhotonFixCMS (const reco::Photon &p)
 
double sigmaEnergy () const
 

Static Public Member Functions

static bool initialise (const edm::EventSetup &iSetup, const std::string &s="Nominal")
 

Private Attributes

PhotonFix pf
 

Detailed Description

Definition at line 49 of file PhotonFixCMS.h.

Constructor & Destructor Documentation

PhotonFixCMS::PhotonFixCMS ( const reco::Photon p)

Definition at line 26 of file PhotonFixCMS.cc.

26  :
27  pf(p.energy(),p.superCluster()->eta(),p.superCluster()->phi(),p.r9()) {
28 }
reco::SuperClusterRef superCluster() const
Ref to SuperCluster.
virtual double energy() const final
energy
PhotonFix pf
Definition: PhotonFixCMS.h:63
float r9() const
Definition: Photon.h:228

Member Function Documentation

double PhotonFixCMS::fixedEnergy ( ) const

Definition at line 152 of file PhotonFixCMS.cc.

References PhotonFix::fixedEnergy(), and pf.

152  {
153 
154  return pf.fixedEnergy();
155 }
double fixedEnergy() const
Definition: PhotonFix.cc:139
PhotonFix pf
Definition: PhotonFixCMS.h:63
bool PhotonFixCMS::initialise ( const edm::EventSetup iSetup,
const std::string &  s = "Nominal" 
)
static

Definition at line 30 of file PhotonFixCMS.cc.

References PhotonFix::barrelCGap(), PhotonFix::barrelMGap(), PhotonFix::barrelSGap(), EnergyCorrector::c, gather_cfg::cout, RecoEcal_EventContent_cff::ec, DetId::Ecal, EcalBarrel, EcalEndcap, PhotonFix::endcapCGap(), PhotonFix::endcapCrystal(), PhotonFix::endcapMGap(), PhotonFix::endcapSGap(), stringResolutionProvider_cfi::eta, PV3DBase< T, PVType, FrameType >::eta(), edm::EventSetup::get(), PhotonFix::GetaPhi(), CaloSubdetectorGeometry::getGeometry(), CaloCellGeometry::getPosition(), CaloGeometry::getSubdetectorGeometry(), mps_fire::i, PhotonFix::initialised(), PhotonFix::initialiseParameters(), gen::k, phi, PV3DBase< T, PVType, FrameType >::phi(), EEDetId::validDetId(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

30  {
31 
32  if(PhotonFix::initialised()) return false;
33 
35 
36  // Get ECAL geometry
38  iSetup.get<CaloGeometryRecord>().get(geoHandle);
39  const CaloGeometry& geometry = *geoHandle;
40 
41  // EB
42  const CaloSubdetectorGeometry *barrelGeometry = geometry.getSubdetectorGeometry(DetId::Ecal, EcalBarrel);
43 
44  double bc[170][360][2];
45  for(int iz(0);iz<2;iz++) {
46  for(int ie(0);ie<85;ie++) {
47  int id = ie+1;
48  if (iz==0) id = ie-85;
49  for(int ip(0);ip<360;ip++) {
50  EBDetId eb(id,ip+1);
51 
52  const CaloCellGeometry *cellGeometry = barrelGeometry->getGeometry(eb);
53  GlobalPoint crystalPos = cellGeometry->getPosition();
54  bc[85*iz+ie][ip][0]=crystalPos.eta();
55  bc[85*iz+ie][ip][1]=crystalPos.phi();
56  }
57  }
58  }
59 
60  for(unsigned i(0);i<169;i++) {
61  for(unsigned j(0);j<360;j++) {
62  unsigned k((j+1)%360);
63 
64  double eta = 0.25*( bc[i][j][0]+bc[i+1][j][0]+
65  bc[i][k][0]+bc[i+1][k][0]);
66  double phi = PhotonFix::GetaPhi(PhotonFix::GetaPhi(bc[i][j][1],bc[i+1][j][1]),
67  PhotonFix::GetaPhi(bc[i][k][1],bc[i+1][k][1]));
68 
69  PhotonFix::barrelCGap(i,j,0,eta);
70  PhotonFix::barrelCGap(i,j,1,phi);
71 
72  if((i%5)==4 && (j%2)==1) {
73  PhotonFix::barrelSGap(i/5,j/2,0,eta);
74  PhotonFix::barrelSGap(i/5,j/2,1,phi);
75  }
76 
77  if((j%20)==19) {
78  if(i== 19) {PhotonFix::barrelMGap(0,j/20,0,eta); PhotonFix::barrelMGap(0,j/20,1,phi);}
79  if(i== 39) {PhotonFix::barrelMGap(1,j/20,0,eta); PhotonFix::barrelMGap(1,j/20,1,phi);}
80  if(i== 59) {PhotonFix::barrelMGap(2,j/20,0,eta); PhotonFix::barrelMGap(2,j/20,1,phi);}
81  if(i== 84) {PhotonFix::barrelMGap(3,j/20,0,eta); PhotonFix::barrelMGap(3,j/20,1,phi);}
82  if(i==109) {PhotonFix::barrelMGap(4,j/20,0,eta); PhotonFix::barrelMGap(4,j/20,1,phi);}
83  if(i==129) {PhotonFix::barrelMGap(5,j/20,0,eta); PhotonFix::barrelMGap(5,j/20,1,phi);}
84  if(i==149) {PhotonFix::barrelMGap(6,j/20,0,eta); PhotonFix::barrelMGap(6,j/20,1,phi);}
85 
86  }
87  }
88  }
89 
90  // EE
91  const CaloSubdetectorGeometry *endcapGeometry = geometry.getSubdetectorGeometry(DetId::Ecal, EcalEndcap);
92 
93  double ec[2][100][100][2];
94  bool valid[100][100];
95  int val_count=0;
96  for(int iz(0);iz<2;iz++) {
97  for(int ix(0);ix<100;ix++) {
98  for(int iy(0);iy<100;iy++) {
99  valid[ix][iy] = EEDetId::validDetId(ix+1,iy+1,2*iz-1);
100 if(iz==0) PhotonFix::endcapCrystal(ix,iy,valid[ix][iy]);
101  if(valid[ix][iy]) {
102  EEDetId ee(ix+1,iy+1,2*iz-1);
103  val_count+=1;
104 
105  const CaloCellGeometry *cellGeometry = endcapGeometry->getGeometry(ee);
106  GlobalPoint crystalPos = cellGeometry->getPosition();
107  ec[iz][ix][iy][0]=asinh(crystalPos.x()/fabs(crystalPos.z()));
108  ec[iz][ix][iy][1]=asinh(crystalPos.y()/fabs(crystalPos.z()));
109  }
110  }
111  }
112  }
113  std::cout << "GG valid " << val_count << std::endl;
114  double c[2];
115  for(unsigned iz(0);iz<2;iz++) {
116  unsigned nC(0),nS(0);
117  for(unsigned i(0);i<99;i++) {
118  for(unsigned j(0);j<99;j++) {
119  if(valid[i][j ] && valid[i+1][j ] &&
120  valid[i][j+1] && valid[i+1][j+1]) {
121  for(unsigned k(0);k<2;k++) {
122 
123  c[k] = 0.25*(ec[iz][i][j][k]+ec[iz][i+1][j][k]+ec[iz][i][j+1][k]+ec[iz][i+1][j+1][k]);
124 
125  PhotonFix::endcapCGap(iz,nC,k,c[k]);
126  }
127 
128  if((i%5)==4 && (j%5)==4) {
129  for(unsigned k(0);k<2;k++) {
130  PhotonFix::endcapSGap(iz,nS,k,c[k]);
131  }
132  nS++;
133  }
134  nC++;
135  }
136  }
137  }
138  std::cout << "Endcap number of crystal, submodule boundaries = "
139  << nC << ", " << nS << std::endl;
140  }
141 
142  // Hardcode EE D-module gap to 0,0
143  PhotonFix::endcapMGap(0,0,0,0.0);
144  PhotonFix::endcapMGap(0,0,1,0.0);
145  PhotonFix::endcapMGap(1,0,0,0.0);
146  PhotonFix::endcapMGap(1,0,1,0.0);
147 
148  return true;
149 }
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:45
static bool initialised()
Definition: PhotonFix.cc:651
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
T y() const
Definition: PV3DBase.h:63
static void endcapSGap(unsigned i, unsigned j, unsigned k, double c)
Definition: PhotonFix.cc:343
static void barrelMGap(unsigned i, unsigned j, unsigned k, double c)
Definition: PhotonFix.cc:334
virtual const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
static void barrelCGap(unsigned i, unsigned j, unsigned k, double c)
Definition: PhotonFix.cc:328
static void endcapMGap(unsigned i, unsigned j, unsigned k, double c)
Definition: PhotonFix.cc:346
static void barrelSGap(unsigned i, unsigned j, unsigned k, double c)
Definition: PhotonFix.cc:331
T z() const
Definition: PV3DBase.h:64
static void endcapCGap(unsigned i, unsigned j, unsigned k, double c)
Definition: PhotonFix.cc:340
static void endcapCrystal(unsigned i, unsigned j, bool c)
Definition: PhotonFix.cc:337
int k[5][pyjets_maxn]
static bool initialiseParameters(const std::string &s)
Definition: PhotonFix.cc:663
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition: EEDetId.h:248
const T & get() const
Definition: EventSetup.h:56
T eta() const
Definition: PV3DBase.h:76
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
T x() const
Definition: PV3DBase.h:62
static double GetaPhi(double f0, double f1)
Definition: PhotonFix.cc:324
const PhotonFix & PhotonFixCMS::photonFix ( ) const

Definition at line 162 of file PhotonFixCMS.cc.

References pf.

162  {
163  return pf;
164 }
PhotonFix pf
Definition: PhotonFixCMS.h:63
double PhotonFixCMS::sigmaEnergy ( ) const

Definition at line 157 of file PhotonFixCMS.cc.

References pf, and PhotonFix::sigmaEnergy().

157  {
158 
159  return pf.sigmaEnergy();
160 }
double sigmaEnergy() const
Definition: PhotonFix.cc:178
PhotonFix pf
Definition: PhotonFixCMS.h:63

Member Data Documentation

PhotonFix PhotonFixCMS::pf
private

Definition at line 63 of file PhotonFixCMS.h.

Referenced by fixedEnergy(), photonFix(), and sigmaEnergy().