double PFReconstructor::nsigmaHcal(const Cluster& cluster) const { /*'WARNING CMS SPECIFIC! //http://cmslxr.fnal.gov/source/RecoParticleFlow/PFProducer/src/PFAlgo.cc#3365 '''*/ return 1. + exp(-cluster.energy() / 100.); }
bool CMSHCAL::acceptance(const Cluster& cluster) const { double energy = cluster.energy(); double eta = fabs(cluster.eta()); bool accept = false; auto& pars = m_acceptanceParameters; if (eta < m_etaCrack) { if (energy > pars[0]) accept = rootrandom::Random::uniform(0, 1) < (pars[1] / (1 + exp((energy + pars[2]) / (pars[3])))); } else if (eta < pars[4]) { if (energy > pars[5]) { if (energy < pars[6]) accept = rootrandom::Random::uniform(0, 1) < (pars[7] + pars[8] * energy + pars[9] * (pow(energy, 2))); else accept = rootrandom::Random::uniform(0, 1) < (pars[10] / (1 + exp((energy + pars[11]) / pars[12]))); } } else if (eta < pars[13] && energy > pars[14]) accept = true; /*if (eta < m_etaCrack) { if (energy > 1.) accept = rootrandom::Random::uniform(0, 1) < (1 / (1 + exp((energy - 1.93816) / (-1.75330)))); } else if (eta < 3.) { if (energy > 1.1) { if (energy < 10.) accept = rootrandom::Random::uniform(0, 1) < (1.05634 - 1.66943e-01 * energy + 1.05997e-02 * (pow(energy, 2))); else accept = rootrandom::Random::uniform(0, 1) < (8.09522e-01 / (1 + exp((energy - 9.90855) / -5.30366))); } } else if (eta < 5. && energy > 7) accept = true;*/ return accept; }
bool ClicECAL::acceptance(const Cluster& cluster) const { double energy = cluster.energy(); double eta = fabs(cluster.eta()); if (eta < volumeCylinder().inner().etaJunction()) return (energy > m_emin[0]); // barrel else if (eta < m_etaAcceptance) return energy > m_emin[1]; // endcap else return false; }
bool CMSECAL::acceptance(const Cluster& cluster) const { double energy = cluster.energy(); double eta = fabs(cluster.eta()); if (eta < m_etaCrack) return energy > m_emin[kBarrel]; else if (eta < m_etaAcceptanceThreshold) // 2.93) return ((energy > m_emin[kEndCap]) & (cluster.pt() > m_ptAcceptanceThreshold)); // 0.2)); else return false; }
SimParticle PFReconstructor::reconstructCluster(const Cluster& cluster, papas::Layer layer, double energy, const TVector3& vertex) { // construct a photon if it is an ecal // construct a neutral hadron if it is an hcal int pdgId = 0; if (energy < 0) { energy = cluster.energy(); } // double charge = ParticlePData::particleCharge(pdgId); if (layer == papas::Layer::kEcal) { pdgId = 22; // photon } else if (layer == papas::Layer::kHcal) { pdgId = 130; // K0 } else { // TODO raise ValueError('layer must be equal to ecal_in or hcal_in') } // assert(pdg_id) double mass = ParticlePData::particleMass(pdgId); if (energy < mass) // null particle return SimParticle(); double momentum; if (mass == 0) { momentum = energy; } //#avoid sqrt for zero mass else { momentum = sqrt(pow(energy, 2) - pow(mass, 2)); } TVector3 p3 = cluster.position().Unit() * momentum; TLorentzVector p4 = TLorentzVector(p3.Px(), p3.Py(), p3.Pz(), energy); // mass is not accurate here IdType newid = Id::makeRecParticleId(); SimParticle particle{newid, pdgId, 0., p4, vertex}; // TODO discuss with Colin particle.path()->addPoint(papas::Position::kEcalIn, cluster.position()); if (layer == papas::Layer::kHcal) { // alice not sure particle.path()->addPoint(papas::Position::kHcalIn, cluster.position()); } // alice: Colin this may be a bit strange // because we can make a photon with a // path where the point is actually that // of the hcal? // nb this only is problem if the cluster and the assigned layer are different // particle.setPath(path); // particle.clusters[layer] = cluster # not sure about this either when hcal is used to make an ecal cluster? m_locked[cluster.id()] = true; // alice : just OK but not nice if hcal used to make ecal. // TODO make more flexible and able to detect what type of cluster PDebug::write("Made Reconstructed{} from Merged{}", particle, cluster); return particle; }
double PFReconstructor::neutralHadronEnergyResolution(const Cluster& hcal) const { /*WARNING CMS SPECIFIC! //http://cmslxr.fnal.gov/source/RecoParticleFlow/PFProducer/src/PFAlgo.cc#3350 */ double energy = fmax(hcal.energy(), 1.); double stoch = 1.02; double kconst = 0.065; if (fabs(hcal.position().Eta()) > 1.48) { stoch = 1.2; kconst = 0.028; } double resol = sqrt(pow(stoch, 2) / energy + pow(kconst, 2)); return resol; }
/* Decides whether a cluster will be seen by a detector @param cluster the cluster to be analysed @return true is cluster is detected, false it if is too small to be seen */ bool CMSHCAL::acceptance(const Cluster& cluster) const { double energy = cluster.energy(); double eta = fabs(cluster.eta()); bool accept = false; auto rUniform = randomgen::RandUniform(0, 1); if (eta < m_etaCrack) { if (energy > 1.) accept = rUniform.next() < (1 / (1 + exp((energy - 1.93816) / (-1.75330)))); } else if (eta < 3.) { if (energy > 1.1) { if (energy < 10.) accept = rUniform.next() < (1.05634 - 1.66943e-01 * energy + 1.05997e-02 * (pow(energy, 2))); else accept = rUniform.next() < (8.09522e-01 / (1 + exp((energy - 9.90855) / -5.30366))); } } else if (eta < 5. && energy > 7) accept = true; return accept; }