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::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()) {}

Member Function Documentation

◆ fixedEnergy()

double PhotonFixCMS::fixedEnergy ( ) const

Definition at line 168 of file PhotonFixCMS.cc.

168 { return pf.fixedEnergy(); }

References PhotonFix::fixedEnergy(), and pf.

◆ initialise()

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

Definition at line 29 of file PhotonFixCMS.cc.

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 
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 }

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

◆ photonFix()

const PhotonFix & PhotonFixCMS::photonFix ( ) const

Definition at line 172 of file PhotonFixCMS.cc.

172 { return pf; }

References pf.

◆ sigmaEnergy()

double PhotonFixCMS::sigmaEnergy ( ) const

Definition at line 170 of file PhotonFixCMS.cc.

170 { return pf.sigmaEnergy(); }

References pf, and PhotonFix::sigmaEnergy().

Member Data Documentation

◆ pf

PhotonFix PhotonFixCMS::pf
private

Definition at line 63 of file PhotonFixCMS.h.

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

mps_fire.i
i
Definition: mps_fire.py:428
PhotonFix::fixedEnergy
double fixedEnergy() const
Definition: PhotonFix.cc:149
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
CaloGeometryRecord
Definition: CaloGeometryRecord.h:30
EBDetId
Definition: EBDetId.h:17
PhotonFix::initialiseParameters
static bool initialiseParameters(const std::string &s)
Definition: PhotonFix.cc:680
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
PhotonFixCMS::pf
PhotonFix pf
Definition: PhotonFixCMS.h:63
gather_cfg.cout
cout
Definition: gather_cfg.py:144
geometry
Definition: geometry.py:1
PhotonFix::barrelMGap
static void barrelMGap(unsigned i, unsigned j, unsigned k, double c)
Definition: PhotonFix.cc:331
EcalBarrel
Definition: EcalSubdetector.h:10
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
alignCSCRings.s
s
Definition: alignCSCRings.py:92
CaloGeometry
Definition: CaloGeometry.h:21
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
PVValHelper::eta
Definition: PVValidationHelpers.h:69
PhotonFix::initialised
static bool initialised()
Definition: PhotonFix.cc:670
PhotonFix::barrelCGap
static void barrelCGap(unsigned i, unsigned j, unsigned k, double c)
Definition: PhotonFix.cc:329
edm::ESHandle< CaloGeometry >
PhotonFix::endcapMGap
static void endcapMGap(unsigned i, unsigned j, unsigned k, double c)
Definition: PhotonFix.cc:335
dqmdumpme.k
k
Definition: dqmdumpme.py:60
Point3DBase< float, GlobalTag >
EEDetId
Definition: EEDetId.h:14
PhotonFix::GetaPhi
static double GetaPhi(double f0, double f1)
Definition: PhotonFix.cc:327
EcalEndcap
Definition: EcalSubdetector.h:10
PV3DBase::eta
T eta() const
Definition: PV3DBase.h:73
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
PhotonFix::endcapCrystal
static void endcapCrystal(unsigned i, unsigned j, bool c)
Definition: PhotonFix.cc:332
CaloSubdetectorGeometry::getGeometry
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.
Definition: CaloSubdetectorGeometry.cc:36
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
DetId::Ecal
Definition: DetId.h:27
get
#define get
DDAxes::phi
PhotonFix::endcapSGap
static void endcapSGap(unsigned i, unsigned j, unsigned k, double c)
Definition: PhotonFix.cc:334
PhotonFix::sigmaEnergy
double sigmaEnergy() const
Definition: PhotonFix.cc:189
CaloSubdetectorGeometry
Definition: CaloSubdetectorGeometry.h:22
EEDetId::validDetId
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition: EEDetId.h:248
RunInfoPI::valid
Definition: RunInfoPayloadInspectoHelper.h:16
PhotonFix::barrelSGap
static void barrelSGap(unsigned i, unsigned j, unsigned k, double c)
Definition: PhotonFix.cc:330
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
PV3DBase::phi
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
PhotonFix::endcapCGap
static void endcapCGap(unsigned i, unsigned j, unsigned k, double c)
Definition: PhotonFix.cc:333