Atlfast::TransportedSMParticle Class Reference

#include <TransportedSMParticle.h>

Inheritance diagram for Atlfast::TransportedSMParticle:

Inheritance graph
[legend]
Collaboration diagram for Atlfast::TransportedSMParticle:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TransportedSMParticle (const HepMC::GenParticle *const &p)
 ~TransportedSMParticle ()
void deflect ()
Phi phi () const
double eta () const
double E () const
const HepMC::GenParticle * particle () const

Protected Attributes

Phi m_phi
double m_eta
double m_energy
const HepMC::GenParticle * m_particle

Detailed Description

Definition at line 14 of file TransportedSMParticle.h.


Constructor & Destructor Documentation

Atlfast::TransportedSMParticle::TransportedSMParticle ( const HepMC::GenParticle *const &  p  )  [inline]

Definition at line 16 of file TransportedSMParticle.h.

Atlfast::TransportedSMParticle::~TransportedSMParticle (  )  [inline]

Definition at line 18 of file TransportedSMParticle.h.

00018 {};


Member Function Documentation

void Atlfast::TransportedSMParticle::deflect (  )  [virtual]

Implements Atlfast::ITransportedParticle.

Definition at line 16 of file TransportedSMParticle.cxx.

00016                                      {
00017 
00018     // A Phi object is held as a member
00019     double phi=m_phi.val();
00020   
00021     // Use ChargeService to get particle's charge
00022     double charge;
00023     ChargeService cs;
00024     try{
00025       charge=cs(m_particle);
00026     }catch(std::string errMsg){
00027       throw errMsg;
00028     }
00029     
00030     
00031     MagField *bfield = MagField::Instance();
00032     
00033     if( bfield->is_on() && !(charge==0.) ) {
00034       
00035       //cout << "deflect phi: " << phi << flush;
00036 
00037       assert(std::abs(charge)>0.5);
00038       
00039       double def=0.;
00040       double theta = m_particle->momentum().theta();
00041       double eta = m_particle->momentum().eta();
00042       double pt = m_particle->momentum().perp();
00043       
00044 
00045       if (abs(eta) < 1.4) {
00046 
00047         // Conversion factor of 3.0: 
00048         //     3e8 (from c in MeV/c, for pT) /
00049         //     100 (calorimeter radius measured in cm) /
00050         //     1e6 (from MeV in MeV/c, for pT)
00051         // Don't understand the factor of 2.0 at end of expression
00052 
00053         def = -150. * bfield->strength() * 3.0 / ( pt * 2.0 );
00054       } else { 
00055         def = -350.*abs(tan(theta)) * bfield->strength() * 3.0 / ( pt * 2.0 );
00056       }
00057       
00058       if(double turns =(def/(2*M_PI))>5.0) {
00059         cout<<"MagField: particle has spun  "<<turns<<" pt= "<<pt<<endl;
00060       } 
00061       
00062       // Replace member Phi with deflected version
00063       m_phi = phi + def*charge;
00064       
00065       //cout << " ==> " << m_phi.val() << endl;
00066       
00067     }
00068     
00069     return;
00070     
00071   }

Phi Atlfast::TransportedParticle::phi (  )  const [virtual, inherited]

Implements Atlfast::ITransportedParticle.

Definition at line 14 of file TransportedParticle.cxx.

00014 {return m_phi;}

double Atlfast::TransportedParticle::eta (  )  const [virtual, inherited]

Implements Atlfast::ITransportedParticle.

Definition at line 15 of file TransportedParticle.cxx.

00015 {return m_eta;}

double Atlfast::TransportedParticle::E (  )  const [virtual, inherited]

Implements Atlfast::ITransportedParticle.

Definition at line 16 of file TransportedParticle.cxx.

00016 {return m_energy;}

const HepMC::GenParticle * Atlfast::TransportedParticle::particle (  )  const [virtual, inherited]

Implements Atlfast::ITransportedParticle.

Definition at line 18 of file TransportedParticle.cxx.

00018                                                               {
00019 
00020     return m_particle;
00021 
00022   }


Member Data Documentation

Phi Atlfast::TransportedParticle::m_phi [protected, inherited]

Definition at line 24 of file TransportedParticle.h.

double Atlfast::TransportedParticle::m_eta [protected, inherited]

Definition at line 25 of file TransportedParticle.h.

double Atlfast::TransportedParticle::m_energy [protected, inherited]

Definition at line 26 of file TransportedParticle.h.

const HepMC::GenParticle* Atlfast::TransportedParticle::m_particle [protected, inherited]

Definition at line 27 of file TransportedParticle.h.


The documentation for this class was generated from the following files:
Generated on Fri Sep 21 13:00:24 2007 for AtlfastEvent by  doxygen 1.5.1