ATLAS Offline Software
Functions
InputConverter.cxx File Reference
#include "InputConverter.h"
#include <memory>
#include "GaudiKernel/IPartPropSvc.h"
#include "GaudiKernel/PhysicalConstants.h"
#include "ISF_Event/TruthBinding.h"
#include "ISF_HepMC_Interfaces/IGenParticleFilter.h"
#include "ISF_Event/ISFParticle.h"
#include "ISF_Event/ISFParticleContainer.h"
#include "ISF_Event/ParticleUserInformation.h"
#include "MCTruth/PrimaryParticleInformation.h"
#include "MCTruth/AtlasG4EventUserInfo.h"
#include "GeneratorObjects/McEventCollection.h"
#include "G4PrimaryParticle.hh"
#include "G4Event.hh"
#include "G4Geantino.hh"
#include "G4ChargedGeantino.hh"
#include "G4ParticleTable.hh"
#include "G4LorentzVector.hh"
#include "G4TransportationManager.hh"
#include "AtlasHepMC/GenParticle.h"
#include "AtlasHepMC/GenEvent.h"
#include "AtlasHepMC/GenVertex.h"
#include "CLHEP/Geometry/Point3D.h"
#include "CLHEP/Geometry/Vector3D.h"
#include "CLHEP/Units/SystemOfUnits.h"
#include "HepPDT/ParticleID.hh"
#include "HepPDT/DecayData.hh"
#include "HepPDT/ParticleDataTable.hh"
#include "TruthUtils/HepMCHelpers.h"

Go to the source code of this file.

Functions

double SetProperTimeFromDetectorFrameDecayLength (G4PrimaryParticle &g4particle, const double GeneratorDecayLength)
 

Function Documentation

◆ SetProperTimeFromDetectorFrameDecayLength()

double SetProperTimeFromDetectorFrameDecayLength ( G4PrimaryParticle &  g4particle,
const double  GeneratorDecayLength 
)

Definition at line 522 of file InputConverter.cxx.

523 {
524  //particle with velocity v travels distance l in time t=l/v
525  //proper time: c^2 tau^2 = c^2 t^2 - l^2 = l^2/c^2 * (1/beta^2 -1)
526  //beta^2 = p^2/E^2 with particle momentum p and energy E; E^2=m^2 + p^2
527  //tau^2 = l^2/c^2 * m^2/p^2
528  const double p2=std::pow(g4particle.GetTotalMomentum(),2); //magnitude of particle momentum squared
529  const double m2=std::pow(g4particle.GetMass(),2); //mass^2 of particle
530  const double l2=std::pow(GeneratorDecayLength,2); //distance^2 of particle decay length
531  const double tau2=l2*m2/p2/CLHEP::c_squared;
532  const double tau=std::sqrt(tau2);
533  g4particle.SetProperTime( tau );
534  return tau;
535 }
python.SystemOfUnits.m2
int m2
Definition: SystemOfUnits.py:92
TRTCalib_cfilter.p2
p2
Definition: TRTCalib_cfilter.py:131
skel.l2
l2
Definition: skel.GENtoEVGEN.py:399
python.PhysicalConstants.c_squared
float c_squared
Definition: PhysicalConstants.py:64
pow
constexpr int pow(int base, int exp) noexcept
Definition: ap_fixedTest.cxx:15