CMS 3D CMS Logo

Classes | Functions | Variables
PPSTools Namespace Reference

Classes

struct  FullBeamInfo
 
struct  LimitedBeamInfo
 

Functions

void Get_t_and_xi (const TLorentzVector *proton, double &t, double &xi, LimitedBeamInfo const &bi)
 
TLorentzVector HectorParticle2LorentzVector (H_BeamParticle hp, int)
 
void LorentzBoost (H_BeamParticle &h_p, int dir, const std::string &frame, FullBeamInfo const &bi)
 
void LorentzBoost (TLorentzVector &p_out, const std::string &frame, FullBeamInfo const &bi)
 
void LorentzBoost (HepMC::GenParticle &p_out, const std::string &frame, FullBeamInfo const &bi)
 
H_BeamParticle LorentzVector2HectorParticle (TLorentzVector p)
 

Variables

const double ProtonMass = CLHEP::proton_mass_c2 / GeV
 
const double ProtonMassSQ = pow(ProtonMass, 2)
 
const double urad = 1. / 1000000.
 

Function Documentation

◆ Get_t_and_xi()

void PPSTools::Get_t_and_xi ( const TLorentzVector *  proton,
double &  t,
double &  xi,
LimitedBeamInfo const &  bi 
)

Definition at line 72 of file PPSUtilities.cc.

References funct::cos(), hcalRecHitTable_cff::energy, PPSTools::LimitedBeamInfo::fBeamEnergy, PPSTools::LimitedBeamInfo::fBeamMomentum, Pi, ProtonMassSQ, mathSSE::sqrt(), submitPVValidationJobs::t, theta(), and protons_cff::xi.

Referenced by CTPPSFastTrackingProducer::FastReco().

72  {
73  t = 0.;
74  xi = -1.;
75  if (!proton)
76  return;
77  double mom =
78  sqrt((proton->Px()) * (proton->Px()) + (proton->Py()) * (proton->Py()) + (proton->Pz()) * (proton->Pz()));
79  if (mom > bi.fBeamMomentum)
80  mom = bi.fBeamMomentum;
81  double energy = proton->E();
82  double theta = (proton->Pz() > 0) ? proton->Theta() : TMath::Pi() - proton->Theta();
83  t = -2. * (ProtonMassSQ - bi.fBeamEnergy * energy + bi.fBeamMomentum * mom * cos(theta));
84  xi = (1.0 - energy / bi.fBeamEnergy);
85 }
const double Pi
T sqrt(T t)
Definition: SSEVec.h:19
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
static const double ProtonMassSQ
Geom::Theta< T > theta() const

◆ HectorParticle2LorentzVector()

TLorentzVector PPSTools::HectorParticle2LorentzVector ( H_BeamParticle  hp,
int  direction 
)

Definition at line 6 of file PPSUtilities.cc.

References funct::cos(), trackingPlots::hp, conifer::pow(), ProtonMassSQ, multPhiCorr_741_25nsDY_cfi::px, multPhiCorr_741_25nsDY_cfi::py, mathSSE::sqrt(), funct::tan(), theta(), and urad.

6  {
7  double partP = sqrt(pow(hp.getE(), 2) - ProtonMassSQ);
8  double theta = sqrt(pow(hp.getTX(), 2) + pow(hp.getTY(), 2)) * urad;
9  double pz = partP * cos(theta);
10  double px = tan((double)hp.getTX() * urad) * pz; //it is equivalente to PartP*sin(theta)*cos(phi);
11  double py = tan((double)hp.getTY() * urad) * pz; //it is equivalente to partP*sin(theta)*sin(phi);
12  pz *= direction;
13  return TLorentzVector(px, py, pz, hp.getE());
14 }
constexpr int pow(int x)
Definition: conifer.h:24
static const double urad
T sqrt(T t)
Definition: SSEVec.h:19
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
static const double ProtonMassSQ
Geom::Theta< T > theta() const

◆ LorentzBoost() [1/3]

void PPSTools::LorentzBoost ( H_BeamParticle &  h_p,
int  dir,
const std::string &  frame,
FullBeamInfo const &  bi 
)

◆ LorentzBoost() [2/3]

void PPSTools::LorentzBoost ( TLorentzVector &  p_out,
const std::string &  frame,
FullBeamInfo const &  bi 
)

◆ LorentzBoost() [3/3]

void PPSTools::LorentzBoost ( HepMC::GenParticle &  p_out,
const std::string &  frame,
FullBeamInfo const &  bi 
)

◆ LorentzVector2HectorParticle()

H_BeamParticle PPSTools::LorentzVector2HectorParticle ( TLorentzVector  p)

Definition at line 16 of file PPSUtilities.cc.

References funct::abs(), and AlCaHLTBitMon_ParallelJobs::p.

16  {
17  H_BeamParticle h_p;
18  h_p.set4Momentum(p.Px(), p.Py(), abs(p.Pz()), p.E());
19  return h_p;
20 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

Variable Documentation

◆ ProtonMass

const double PPSTools::ProtonMass = CLHEP::proton_mass_c2 / GeV

Definition at line 30 of file PPSUtilities.h.

◆ ProtonMassSQ

const double PPSTools::ProtonMassSQ = pow(ProtonMass, 2)

◆ urad

const double PPSTools::urad = 1. / 1000000.

Definition at line 29 of file PPSUtilities.h.