56 produces<CastorTowerCollection>();
75 using namespace TMath;
90 double castorplus[4][16];
91 double castormin[4][16];
93 for (
int j = 0;
j < 16;
j++) {
94 castorplus[3][
j] = -2.94524 +
j * 0.3927;
95 castormin[3][
j] = -2.94524 +
j * 0.3927;
96 castorplus[0][
j] = 0.;
98 castorplus[1][
j] = 0.;
100 castorplus[2][
j] = 0.;
101 castormin[2][
j] = 0.;
107 vector<double> depthplus[16];
108 vector<double> depthmin[16];
109 vector<double> fhotplus[16];
110 vector<double> fhotmin[16];
111 vector<double> energyplus[16];
112 vector<double> energymin[16];
116 for (
int i = 0;
i < 16;
i++) {
117 depthplus[
i].clear();
121 energyplus[
i].clear();
122 energymin[
i].clear();
134 if (fabs(
p.eta()) > 5.2 && fabs(
p.eta()) < 6.6) {
140 double emEnergy = 0.;
141 double hadEnergy = 0.;
147 if (
p.pdgId() == 11 ||
p.pdgId() == 22) {
153 double mean = 1.0024 *
p.energy() - 0.3859;
154 double sigma = 0.0228 *
p.energy() + 2.1061;
162 if (
p.pdgId() == 11) {
170 double x = 0.5 * 19.38;
174 emEnergy =
energy - leakage;
179 double d0 = 0.2338 *
pow(
p.energy(), -0.1634);
180 double d1 = 5.4336 *
pow(
p.energy(), 0.2410) + 14408.1025;
181 double d2 = 1.4692 *
pow(
p.energy(), 0.1307) - 0.5216;
186 new TF1(
"fdepth",
"[0] * TMath::Exp(-0.5*( (x-[1])/[2] + TMath::Exp(-(x-[1])/[2])))", 14400., 14460.);
199 double mean = 0.8340 *
p.energy() - 8.5054;
200 double sigma = 0.1595 *
p.energy() + 3.1183;
210 double d0 = -0.000012 *
p.energy() + 0.0661;
211 double d1 = 785.7524 *
pow(
p.energy(), 0.0262) + 13663.4262;
212 double d2 = 9.8748 *
pow(
p.energy(), 0.1720) + 37.0187;
217 new TF1(
"fdepth",
"[0] * TMath::Exp(-0.5*( (x-[1])/[2] + TMath::Exp(-(x-[1])/[2]) ))", 14400., 15500.);
229 for (
int j = 0;
j < 16;
j++) {
230 double a = -
M_PI +
j * 0.3927;
231 double b = -
M_PI + (
j + 1) * 0.3927;
232 if ((
p.phi() >
a) && (
p.phi() <
b)) {
239 castorplus[0][sector] = castorplus[0][sector] +
energy;
240 castorplus[1][sector] = castorplus[1][sector] + emEnergy;
241 castorplus[2][sector] = castorplus[2][sector] + hadEnergy;
243 depthplus[sector].push_back(
depth);
244 fhotplus[sector].push_back(fhot);
245 energyplus[sector].push_back(
energy);
252 castormin[0][sector] = castormin[0][sector] +
energy;
253 castormin[1][sector] = castormin[1][sector] + emEnergy;
254 castormin[2][sector] = castormin[2][sector] + hadEnergy;
256 depthmin[sector].push_back(
depth);
257 fhotmin[sector].push_back(fhot);
258 energymin[sector].push_back(
energy);
265 for (
int j = 0;
j < 16;
j++) {
266 double hadnoise = 0.;
268 for (
int i = 0;
i < 12;
i++) {
274 hadnoise = hadnoise - 12 * 0.053;
275 emnoise = emnoise - 2 * 0.053;
280 double totnoise = hadnoise + emnoise;
283 castorplus[0][
j] = castorplus[0][
j] + totnoise;
284 castormin[0][
j] = castormin[0][
j] + totnoise;
285 castorplus[1][
j] = castorplus[1][
j] + emnoise;
286 castormin[1][
j] = castormin[1][
j] + emnoise;
287 castorplus[2][
j] = castorplus[2][
j] + hadnoise;
288 castormin[2][
j] = castormin[2][
j] + hadnoise;
297 for (
int j = 0;
j < 16;
j++) {
298 if (castorplus[0][
j] != 0.) {
300 fem = castorplus[1][
j] / castorplus[0][
j];
306 double depth_mean = 0.;
307 double fhot_mean = 0.;
308 double sum_energy = 0.;
311 for (
size_t p = 0;
p < energyplus[
j].size();
p++) {
312 depth_mean = depth_mean + depthplus[
j][
p] * energyplus[
j][
p];
313 fhot_mean = fhot_mean + fhotplus[
j][
p] * energyplus[
j][
p];
314 sum_energy = sum_energy + energyplus[
j][
p];
316 depth_mean = depth_mean / sum_energy;
317 fhot_mean = fhot_mean / sum_energy;
323 castorplus[0][
j],
pt2, castorplus[1][
j], castorplus[2][
j], fem, depth_mean, fhot_mean, refvector));
327 for (
int j = 0;
j < 16;
j++) {
328 if (castormin[0][
j] != 0.) {
330 fem = castormin[1][
j] / castormin[0][
j];
334 double depth_mean = 0.;
335 double fhot_mean = 0.;
336 double sum_energy = 0.;
338 for (
size_t p = 0;
p < energymin[
j].size();
p++) {
339 depth_mean = depth_mean + depthmin[
j][
p] * energymin[
j][
p];
340 fhot_mean = fhot_mean + fhotmin[
j][
p] * energymin[
j][
p];
341 sum_energy = sum_energy + energymin[
j][
p];
343 depth_mean = depth_mean / sum_energy;
344 fhot_mean = fhot_mean / sum_energy;
349 castormin[0][
j],
pt2, castormin[1][
j], castormin[2][
j], fem, depth_mean, fhot_mean, refvector));
359 double mu_noise = 0.053;
360 double sigma_noise = 0.027;
363 result =
r2.Gaus(mu_noise, sigma_noise);