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 523 of file InputConverter.cxx.

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