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.

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

Member Function Documentation

double PhotonFixCMS::fixedEnergy ( ) const

Definition at line 168 of file PhotonFixCMS.cc.

References PhotonFix::fixedEnergy(), and pf.

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

Definition at line 29 of file PhotonFixCMS.cc.

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

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

Definition at line 172 of file PhotonFixCMS.cc.

References pf.

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

Definition at line 170 of file PhotonFixCMS.cc.

References pf, and PhotonFix::sigmaEnergy().

170 { return pf.sigmaEnergy(); }
double sigmaEnergy() const
Definition: PhotonFix.cc:189
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().