44 double bc[170][360][2];
45 for(
int iz(0);iz<2;iz++) {
46 for(
int ie(0);ie<85;ie++) {
48 if (iz==0)
id = ie-85;
49 for(
int ip(0);ip<360;ip++) {
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]+
65 bc[
i][
k][0]+bc[
i+1][
k][0]);
72 if((
i%5)==4 && (j%2)==1) {
93 double ec[2][100][100][2];
96 for(
int iz(0);iz<2;iz++) {
97 for(
int ix(0);ix<100;ix++) {
98 for(
int iy(0);iy<100;iy++) {
107 ec[iz][ix][iy][0]=asinh(crystalPos.
x()/fabs(crystalPos.
z()));
108 ec[iz][ix][iy][1]=asinh(crystalPos.
y()/fabs(crystalPos.
z()));
113 std::cout <<
"GG valid " << val_count << std::endl;
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++) {
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]);
128 if((
i%5)==4 && (j%5)==4) {
129 for(
unsigned k(0);
k<2;
k++) {
138 std::cout <<
"Endcap number of crystal, submodule boundaries = "
139 << 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)
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)
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)
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
ESHandle< TrackerGeometry > geometry
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
static double GetaPhi(double f0, double f1)