43 double bc[170][360][2];
44 for (
int iz(0); iz < 2; iz++) {
45 for (
int ie(0); ie < 85; ie++) {
49 for (
int ip(0); ip < 360; ip++) {
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();
60 for (
unsigned i(0);
i < 169;
i++) {
61 for (
unsigned j(0);
j < 360;
j++) {
62 unsigned k((
j + 1) % 360);
64 double eta = 0.25 * (bc[
i][
j][0] + bc[
i + 1][
j][0] + bc[
i][
k][0] + bc[
i + 1][
k][0]);
71 if ((
i % 5) == 4 && (j % 2) == 1) {
112 double ec[2][100][100][2];
113 bool valid[100][100];
115 for (
int iz(0); iz < 2; iz++) {
116 for (
int ix(0); ix < 100; ix++) {
117 for (
int iy(0); iy < 100; iy++) {
122 EEDetId ee(ix + 1, iy + 1, 2 * iz - 1);
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()));
133 std::cout <<
"GG valid " << val_count << std::endl;
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]);
146 if ((
i % 5) == 4 && (j % 5) == 4) {
147 for (
unsigned k(0);
k < 2;
k++) {
156 std::cout <<
"Endcap number of crystal, submodule boundaries = " << nC <<
", " << nS << std::endl;
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
static bool initialised()
Geom::Phi< T > phi() const
static void endcapSGap(unsigned i, unsigned j, unsigned k, double c)
static void barrelMGap(unsigned i, unsigned j, unsigned k, double c)
static void barrelCGap(unsigned i, unsigned j, unsigned k, double c)
static void endcapMGap(unsigned i, unsigned j, unsigned k, double c)
static void barrelSGap(unsigned i, unsigned j, unsigned k, double c)
static void endcapCGap(unsigned i, unsigned j, unsigned k, double c)
static void endcapCrystal(unsigned i, unsigned j, bool c)
static bool initialiseParameters(const std::string &s)
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)
static double GetaPhi(double f0, double f1)