SwimdEdxAction Class Reference

#include <SwimdEdxAction.h>

Inheritance diagram for SwimdEdxAction:
SwimStepAction

List of all members.

Public Member Functions

 SwimdEdxAction ()
virtual ~SwimdEdxAction ()
virtual void Perform (SwimParticle &particle, SwimStepData *stepData)

Detailed Description

Definition at line 18 of file SwimdEdxAction.h.


Constructor & Destructor Documentation

SwimdEdxAction::SwimdEdxAction (  )  [inline]

Definition at line 21 of file SwimdEdxAction.h.

00021 {;}

virtual SwimdEdxAction::~SwimdEdxAction (  )  [inline, virtual]

Definition at line 22 of file SwimdEdxAction.h.

00022 {;}


Member Function Documentation

void SwimdEdxAction::Perform ( SwimParticle particle,
SwimStepData stepData 
) [virtual]

Implements SwimStepAction.

Definition at line 23 of file SwimdEdxAction.cxx.

References MuELoss::e, SwimdEdxTable::GetdEdx(), SwimParticle::GetEnergy(), SwimStepData::GetIsForward(), SwimParticle::GetMomentum(), SwimParticle::GetMomentumModulus(), SwimStepData::GetStepSize(), SwimStepData::GetSwimMaterial(), SwimGeo::kAir, Munits::m, and SwimParticle::SetMomentum().

00025 {
00026 
00027   SwimGeo::SwimMaterial_t material = stepData->GetSwimMaterial();
00028   // if the particle is not in Air
00029   if (material!=SwimGeo::kAir) {
00030     TVector3 momentum;
00031     double   energyDiff = 
00032       SwimdEdxTable::GetdEdx(particle,material)*
00033       stepData->GetStepSize()/(0.01*Munits::m);
00034 
00035     // Compute the fractional momentum loss
00036     double p = particle.GetMomentumModulus();
00037     double E = particle.GetEnergy();
00038     double fac;  // Fractional energy loss
00039 
00040     // apply corrections to make steel, scint agree with Groom.
00041     
00042     if (stepData->GetIsForward()==true)
00043       if( (-2*energyDiff*E + energyDiff*energyDiff)/(p*p)>-1.0){
00044         fac = TMath::Sqrt(1 + (-2*energyDiff*E + energyDiff*energyDiff)/(p*p));
00045       }
00046       else{
00047         fac = 1.e-6;
00048       }
00049     
00050     else
00051       fac = TMath::Sqrt(1 + (2*energyDiff*E + energyDiff*energyDiff)/(p*p));
00052 
00053     // Make sure that the fractional momentum loss is positive
00054     // Negative or zero means all energy is lost
00055     if ( (stepData->GetIsForward()==true) && (fac<=0.0) ) fac = 1e-6;
00056 
00057     // Apply gain/loss to each component
00058     double px = particle.GetMomentum().X()*fac;
00059     double py = particle.GetMomentum().Y()*fac;
00060     double pz = particle.GetMomentum().Z()*fac;
00061     
00062     momentum.SetXYZ(px,py,pz);
00063     particle.SetMomentum(momentum);
00064   }
00065   return;
00066 }


The documentation for this class was generated from the following files:

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1