4 #include "AbsSmearJet.hh"
5 #include "PythiaJetGun.hh"
9 using namespace PythiaJetGun;
12 double AbsSmearJet::calorimeterEtUncertainty(
13 const double S,
const double N,
const double C,
const double Et)
16 return sqrt(Et*S*S + N*N + Et*Et*C*C);
19 PseudoJet AbsSmearJet::smear4Mom(
const PseudoJet& p4,
const double sigmaPt,
20 const double sigmaEtaPhi,
21 const bool makePtPositive)
23 const double originalPt = p4.pt();
24 double pt = originalPt + gaussRandom(0.0, sigmaPt);
27 while (makePtPositive && pt <= 0.0)
28 pt = originalPt + gaussRandom(0.0, sigmaPt);
29 const double eta = p4.eta() + gaussRandom(0.0, sigmaEtaPhi);
30 const double phi = p4.phi() + gaussRandom(0.0, sigmaEtaPhi);
31 const double pE = p4.E();
32 const double m = p4.m();
33 const double px = pt*cos(phi);
34 const double py = pt*sin(phi);
35 const double pz = pt*sinh(eta);
36 const double E = sqrt(m*m+pt*pt+pz*pz);
37 PseudoJet smearedPart(px, py, pz, E);
43 void AbsSmearJet::smear(Event & smearedEvent)
45 const unsigned nPart = m_event.size();
47 smearedEvent.reserve(nPart);
49 for (
unsigned i=0; i<nPart; ++i)
51 const PseudoJet & part = m_event[i];
54 const int code = info.
pdgId();
55 const double charge = info.
charge();
56 if (code == CODE_GAMMA)
57 processPhoton(part, info, &smearedEvent);
58 else if (charge == 0.0)
61 processNeutralHadron(part,info, &smearedEvent);
63 processTrack(part, info, &smearedEvent);
65 assert( smearedEvent.size() );
int pdgId() const
return the pdgId of the particle
double charge() const
return the charge of the particle