55 produces<CastorTowerCollection>();
74 using namespace TMath;
88 double castorplus[4][16];
89 double castormin[4][16];
91 for (
int j = 0;
j < 16;
j++) {
92 castorplus[3][
j] = -2.94524 +
j * 0.3927;
93 castormin[3][
j] = -2.94524 +
j * 0.3927;
94 castorplus[0][
j] = 0.;
96 castorplus[1][
j] = 0.;
98 castorplus[2][
j] = 0.;
105 vector<double> depthplus[16];
106 vector<double> depthmin[16];
107 vector<double> fhotplus[16];
108 vector<double> fhotmin[16];
109 vector<double> energyplus[16];
110 vector<double> energymin[16];
114 for (
int i = 0;
i < 16;
i++) {
115 depthplus[
i].clear();
119 energyplus[
i].clear();
120 energymin[
i].clear();
132 if (fabs(
p.eta()) > 5.2 && fabs(
p.eta()) < 6.6) {
138 double emEnergy = 0.;
139 double hadEnergy = 0.;
145 if (
p.pdgId() == 11 ||
p.pdgId() == 22) {
151 double mean = 1.0024 *
p.energy() - 0.3859;
152 double sigma = 0.0228 *
p.energy() + 2.1061;
160 if (
p.pdgId() == 11) {
168 double x = 0.5 * 19.38;
172 emEnergy =
energy - leakage;
177 double d0 = 0.2338 *
pow(
p.energy(), -0.1634);
178 double d1 = 5.4336 *
pow(
p.energy(), 0.2410) + 14408.1025;
179 double d2 = 1.4692 *
pow(
p.energy(), 0.1307) - 0.5216;
184 new TF1(
"fdepth",
"[0] * TMath::Exp(-0.5*( (x-[1])/[2] + TMath::Exp(-(x-[1])/[2])))", 14400., 14460.);
197 double mean = 0.8340 *
p.energy() - 8.5054;
198 double sigma = 0.1595 *
p.energy() + 3.1183;
208 double d0 = -0.000012 *
p.energy() + 0.0661;
209 double d1 = 785.7524 *
pow(
p.energy(), 0.0262) + 13663.4262;
210 double d2 = 9.8748 *
pow(
p.energy(), 0.1720) + 37.0187;
215 new TF1(
"fdepth",
"[0] * TMath::Exp(-0.5*( (x-[1])/[2] + TMath::Exp(-(x-[1])/[2]) ))", 14400., 15500.);
227 for (
int j = 0;
j < 16;
j++) {
228 double a = -
M_PI +
j * 0.3927;
229 double b = -
M_PI + (
j + 1) * 0.3927;
230 if ((
p.phi() >
a) && (
p.phi() <
b)) {
237 castorplus[0][sector] = castorplus[0][sector] +
energy;
238 castorplus[1][sector] = castorplus[1][sector] + emEnergy;
239 castorplus[2][sector] = castorplus[2][sector] + hadEnergy;
241 depthplus[sector].push_back(
depth);
242 fhotplus[sector].push_back(fhot);
243 energyplus[sector].push_back(
energy);
250 castormin[0][sector] = castormin[0][sector] +
energy;
251 castormin[1][sector] = castormin[1][sector] + emEnergy;
252 castormin[2][sector] = castormin[2][sector] + hadEnergy;
254 depthmin[sector].push_back(
depth);
255 fhotmin[sector].push_back(fhot);
256 energymin[sector].push_back(
energy);
263 for (
int j = 0;
j < 16;
j++) {
264 double hadnoise = 0.;
266 for (
int i = 0;
i < 12;
i++) {
272 hadnoise = hadnoise - 12 * 0.053;
273 emnoise = emnoise - 2 * 0.053;
278 double totnoise = hadnoise + emnoise;
281 castorplus[0][
j] = castorplus[0][
j] + totnoise;
282 castormin[0][
j] = castormin[0][
j] + totnoise;
283 castorplus[1][
j] = castorplus[1][
j] + emnoise;
284 castormin[1][
j] = castormin[1][
j] + emnoise;
285 castorplus[2][
j] = castorplus[2][
j] + hadnoise;
286 castormin[2][
j] = castormin[2][
j] + hadnoise;
295 for (
int j = 0;
j < 16;
j++) {
296 if (castorplus[0][
j] != 0.) {
298 fem = castorplus[1][
j] / castorplus[0][
j];
304 double depth_mean = 0.;
305 double fhot_mean = 0.;
306 double sum_energy = 0.;
309 for (
size_t p = 0;
p < energyplus[
j].size();
p++) {
310 depth_mean = depth_mean + depthplus[
j][
p] * energyplus[
j][
p];
311 fhot_mean = fhot_mean + fhotplus[
j][
p] * energyplus[
j][
p];
312 sum_energy = sum_energy + energyplus[
j][
p];
314 depth_mean = depth_mean / sum_energy;
315 fhot_mean = fhot_mean / sum_energy;
321 castorplus[0][
j],
pt2, castorplus[1][
j], castorplus[2][
j], fem, depth_mean, fhot_mean, refvector));
325 for (
int j = 0;
j < 16;
j++) {
326 if (castormin[0][
j] != 0.) {
328 fem = castormin[1][
j] / castormin[0][
j];
332 double depth_mean = 0.;
333 double fhot_mean = 0.;
334 double sum_energy = 0.;
336 for (
size_t p = 0;
p < energymin[
j].size();
p++) {
337 depth_mean = depth_mean + depthmin[
j][
p] * energymin[
j][
p];
338 fhot_mean = fhot_mean + fhotmin[
j][
p] * energymin[
j][
p];
339 sum_energy = sum_energy + energymin[
j][
p];
341 depth_mean = depth_mean / sum_energy;
342 fhot_mean = fhot_mean / sum_energy;
347 castormin[0][
j],
pt2, castormin[1][
j], castormin[2][
j], fem, depth_mean, fhot_mean, refvector));
357 double mu_noise = 0.053;
358 double sigma_noise = 0.027;
361 result =
r2.Gaus(mu_noise, sigma_noise);
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
CastorFastTowerProducer(const edm::ParameterSet &)
std::vector< reco::CastorTower > CastorTowerCollection
#define DEFINE_FWK_MODULE(type)
ROOT::Math::RhoEtaPhiPoint TowerPoint
const edm::EDGetTokenT< reco::GenParticleCollection > tokGenPart_
Abs< T >::type abs(const T &t)
static const double tmax[3]
static constexpr float d0
void produce(edm::Event &, const edm::EventSetup &) override
~CastorFastTowerProducer() override
Structure Point Contains parameters of Gaussian fits to DMRs.
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
static constexpr float d1
Power< A, B >::type pow(const A &a, const B &b)