Go to the documentation of this file.00001 #ifndef Point5MaterialMap_cc
00002 #define Point5MaterialMap_cc
00003
00004 #include <iostream>
00005 #include <cmath>
00006
00007 #include "GeneratorInterface/CosmicMuonGenerator/interface/CosmicMuonParameters.h"
00008
00009
00010
00011 inline int inPlug(double vx, double vy, double vz,
00012 double PlugVx = PlugOnShaftVx, double PlugVz = PlugOnShaftVz) {
00013 if (vy > SurfaceOfEarth && vy < SurfaceOfEarth + PlugWidth) {
00014 if (vx > PlugVx - PlugXlength/2. && vx < PlugVx + PlugXlength/2. &&
00015 vz > PlugVz - PlugZlength/2. && vz < PlugVz + PlugZlength/2.) return Plug;
00016 if (vz >= PlugVz - PlugZlength/2. - PlugNoseZlength && vz < PlugVz - PlugZlength/2. &&
00017 vx > PlugVx - PlugNoseXlength/2. && vx < PlugVx + PlugNoseXlength/2.) return Plug;
00018 }
00019 return Unknown;
00020 }
00021
00022
00023 inline int inAirAfterPlug(double vx, double vy, double vz) {
00024
00025 if (vy >= SurfaceOfEarth) return Air;
00026
00027
00028 if (std::fabs(vz) < 26548. && sqrt((vx*1.1576)*(vx*1.1576) + vy*vy) < 15460. &&
00029 vy > -8762) return Air;
00030
00031
00032 if (vy > 0. && vy < (SurfaceOfEarth-2250.) &&
00033 sqrt(vx*vx + (vz-Z_PX56)*(vz-Z_PX56)) < 10250.) return Air;
00034
00035
00036 if (vy >= SurfaceOfEarth-2250. && vy < SurfaceOfEarth) {
00037 if (sqrt(vx*vx + (vz-Z_PX56)*(vz-Z_PX56)) < 10250.
00038 && vz-Z_PX56 > -7000. && vz-Z_PX56 < 7000.) return Air;
00039 if (vx > -2400. && vx < 2400. && vz-Z_PX56 >= -9800. && vz-Z_PX56 < -7000. )
00040 return Air;
00041 }
00042
00043
00044 if (vy > 3233. && vy < (SurfaceOfEarth) &&
00045 sqrt((vx-26600.)*(vx-26600.) + (vz-30100.-Z_PX56)*(vz-30100.-Z_PX56)) < 6050.)
00046
00047 return Air;
00048
00049
00050
00051 if (vy > -3700. && vy < (SurfaceOfEarth) &&
00052 sqrt((vx-18220.)*(vx-18220.) + (vz+24227.-Z_PX56)*(vz+24227.-Z_PX56)) < 3550.)
00053 return Air;
00054
00055
00056 if (vz > -22050. && vz < 62050. &&
00057 sqrt((vx-29550.)*(vx-29550.) + (vy-3233.)*(vy-3233.)) < 9050. &&
00058 vy > -3650.) return Air;
00059
00060
00061 if (((vz >= -29278. && vz < -26548.) || (vz >= 26548 && vz <= 29278.)) &&
00062 sqrt(vy*vy + vx*vx) < 800.) return Air;
00063
00064
00065 if (vx > 10000. && vx < 20500.+3050. &&
00066 vz > 14460. && vz < 16260. &&
00067 vy > -8680. && vy < -1507.) return Air;
00068
00069 if (vx > 10000. && vx < 16500. &&
00070 vy > -8680. && vy < -1507. &&
00071 vz > 14460.-1865.*(16500.-vx)/(3200.) && vz <= 14460.) return Air;
00072
00073 if (vx > 13300. && vx < 20500.+3050. &&
00074 vz > 14460. && vz < 16260. &&
00075 vy > -8680. && vy < -1507.) return Air;
00076
00077 if (vx > 26600-6050. && vx < 20500.+3050. &&
00078 vz > 14460. && vz < 16260. &&
00079 vy >= -1507. && vy < 1000.) return Air;
00080
00081
00082 if (vz > -85000. && vz <= -29278. &&
00083 sqrt(vy*vy + (vx-350.)*(vx-350.)) < 1900. &&
00084 vy > -1000.) return Air;
00085
00086
00087 if (vz >= 29278. && vz < 63000. &&
00088 sqrt(vy*vy + (vx-350.)*(vx-350.)) < 1900. &&
00089 vy > -1000.) return Air;
00090
00091
00092 if (vz > -58875. && vz < -33927. &&
00093 sqrt(vy*vy + (vx-4450.)*(vx-4450.)) < 6750. && vy > -1000. &&
00094 !(vx > 2250. && vx < 4250. && (vz > -(33927.+18000.) || vz < -(33927.+19500.))) &&
00095 !(vx >= 4250. && vx < 6650. && vz > -(33927.+18000.) && vz < -(33927.+16000.)))
00096 return Air;
00097
00098
00099 if (vx > 9000. && vx < 18220. &&
00100 sqrt((vy-50.)*(vy-50.)+(vz+24227.-Z_PX56)*(vz+24227.-Z_PX56)) < 3550.
00101 && vy > -1000.) return Air;
00102
00103 return Unknown;
00104
00105 }
00106
00107
00108 inline int inWallAfterAir(double vx, double vy, double vz) {
00109
00110 if (vy < SurfaceOfEarth && vy >= (SurfaceOfEarth-2250.)) {
00111 if (std::fabs(vz-Z_PX56) < 30000. && std::fabs(vx) < 10950) return Wall;
00112
00113 if (std::fabs(vz-Z_PX56) < 9000. && std::fabs(vx) >= 10950 && std::fabs(vx) < 16950)
00114 return Wall;
00115 }
00116
00117
00118 if (std::fabs(vz) < 29278. && sqrt((vx*1.1576)*(vx*1.1576) + vy*vy) < 16830. &&
00119 vy > -11762.) return Wall;
00120
00121
00122 if (vy > 0. && vy < (SurfaceOfEarth-2250.) &&
00123 sqrt(vx*vx + (vz-Z_PX56)*(vz-Z_PX56)) < 12400.) return Wall;
00124
00125
00126 if (vy > 3233. && vy < (SurfaceOfEarth-1000.) &&
00127 sqrt((vx-26600.)*(vx-26600.) + (vz-30100.-Z_PX56)*(vz-30100.-Z_PX56))
00128 < 6050.+2150./10250.*6050.) return Wall;
00129
00130
00131 else if (vy >= SurfaceOfEarth-1000. && vy < SurfaceOfEarth &&
00132 sqrt((vx-26600.)*(vx-26600.) + (vz-30100.-Z_PX56)*(vz-30100.-Z_PX56))
00133 < 6050.+2150./10250.*6050. +1800.) return Wall;
00134
00135
00136
00137
00138 if (vy > -5450. && vy < (SurfaceOfEarth-1000.) &&
00139 sqrt((vx-18220.)*(vx-18220.) + (vz+24227.-Z_PX56)*(vz+24227.-Z_PX56))
00140 < 3550.+2150./10250.*3550.) return Wall;
00141 else if (vy > SurfaceOfEarth-1000. && vy < SurfaceOfEarth &&
00142 sqrt((vx-18220.)*(vx-18220.) + (vz+24227.-Z_PX56)*(vz+24227.-Z_PX56))
00143 < 3550.+2150./10250.*3550. +1800.) return Wall;
00144
00145
00146 if (vz > -(22050.+1150.) && vz < (62050.+1150.) &&
00147 sqrt((vx-29550.)*(vx-29550.) + (vy-3233.)*(vy-3233.)) < 9050.+950. &&
00148 vy > -3650.-2000.) return Wall;
00149
00150
00151 if (vz > -29278.+1000. && vz < 29278.+1000.) {
00152 if (vy > -17985. && vy < 10410. && vx > 13300. && vx < 20500.)
00153 return Wall;
00154
00155 if (vy > 0. && vy < 10410. && vx > 10000. && vx <= 13300.)
00156 return Wall;
00157
00158 if (vy > -3650.-2000. && vy < -3233. &&
00159 vx > 20000. && vx < 24000.) return Wall;
00160 if (vy > -11762. && vy < -5000. &&
00161 vx > 10500. && vx < 14000.) return Wall;
00162 }
00163
00164 if (vy > -14000. && vy < -1450. &&
00165 vz > 13460. && vz < 17260. && vx >= 20500. && vx < 24550.)
00166 return Wall;
00167
00168
00169 if (vz > -85000. && vz < -28510.) {
00170 if (sqrt(vy*vy + (vx-350.)*(vx-350.)) < 2250.) return Wall;
00171 }
00172
00173
00174 if (vz > 26550. && vz < 63000. &&
00175 sqrt(vy*vy + (vx-350.)*(vx-350.)) < 2250.) return Wall;
00176
00177
00178 if (vz > -(58875.+500.) && vz < -(33927.-500.) &&
00179 sqrt(vy*vy + (vx-4450.)*(vx-4450.)) < (6750.+500.) && vy > -3650.)
00180 return Wall;
00181
00182
00183 if (vx > 9000. && vx < 18220. &&
00184 sqrt((vy-50.)*(vy-50.)+(vz+24227.-Z_PX56)*(vz+24227.-Z_PX56)) < 3550.+500.
00185 && vy > -3650.) return Wall;
00186
00187 return Unknown;
00188 }
00189
00190
00191
00192 inline int inClayOrRockAfterWall(double vx, double vy, double vz, double ClayWidth) {
00193
00194
00195 if (vy >= SurfaceOfEarth - ClayWidth && vy < SurfaceOfEarth)
00196 return Clay;
00197
00198
00199 if (vy < SurfaceOfEarth - ClayWidth)
00200 return Rock;
00201
00202 return Unknown;
00203
00204 }
00205
00206
00207
00208 inline int inClayAfterWall(double vx, double vy, double vz, double ClayWidth) {
00209
00210
00211 if (vy >= SurfaceOfEarth - ClayWidth && vy < SurfaceOfEarth)
00212 return Clay;
00213
00214 return Unknown;
00215
00216 }
00217
00218
00219
00220 inline int inRockAfterClay(double vx, double vy, double vz, double ClayWidth) {
00221
00222
00223 if (vy < SurfaceOfEarth - ClayWidth)
00224 return Rock;
00225
00226 return Unknown;
00227
00228 }
00229
00230
00231
00232
00233
00234 inline int inMat(double vx, double vy, double vz,
00235 double PlugVx = PlugOnShaftVx, double PlugVz = PlugOnShaftVz,
00236 double ClayWidth = DefaultClayWidth) {
00237
00238
00239 if (inPlug(vx, vy, vz, PlugVx, PlugVz)) return Plug;
00240
00241
00242 if (inAirAfterPlug(vx, vy, vz)) return Air;
00243
00244
00245 if (inWallAfterAir(vx, vy, vz)) return Wall;
00246
00247
00248 if (vy >= SurfaceOfEarth - ClayWidth && vy < SurfaceOfEarth)
00249 return Clay;
00250
00251
00252 if (vy < SurfaceOfEarth - ClayWidth)
00253 return Rock;
00254
00255
00256 std::cout << "Point5MaterialMap.h: Warning! No Material recognised for point: vx="
00257 << vx << " vy=" << vy << " vz=" << vz << std::endl;
00258
00259 return Unknown;
00260
00261 }
00262
00263
00264
00265
00266 #endif