Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

Atlfast::MagField Class Reference

Models magnetic field in the detector as a parameterised adjustment in phi of charged particles. More...

#include <MagField.h>

List of all members.


Public Methods

 MagField (bool fieldOn)
 Constructor: if the field is off, there is no adjustment in phi.

void operator() (const MCparticleCollection &, TransportedParticleCollection &) const
 takes HepMC::GenParticles and bends them in the B field.


Private Attributes

const bool m_fieldOn
const ChargeService m_chargeService
ChargeService lnkChargeService
 


Detailed Description

Models magnetic field in the detector as a parameterised adjustment in phi of charged particles.

Definition at line 23 of file MagField.h.


Constructor & Destructor Documentation

Atlfast::MagField::MagField bool    fieldOn
 

Constructor: if the field is off, there is no adjustment in phi.

Definition at line 16 of file MagField.cxx.

00016                                 : 
00017     m_fieldOn(fieldOn), m_chargeService(ChargeService()) {}

Member Function Documentation

void Atlfast::MagField::operator() const MCparticleCollection &   ,
TransportedParticleCollection  
const
 

takes HepMC::GenParticles and bends them in the B field.

Definition at line 19 of file MagField.cxx.

References m_chargeService, m_fieldOn, and Atlfast::TransportedParticleCollection::push_back().

00020                                                                          {
00021     
00022     // calculation of phi deflection due to B-field - from L. Poggioli
00023     MCparticleCollectionCIter ip= p.begin();
00024     for(; ip<p.end(); ++ip){
00025       double phi;
00026       phi=(*ip)->momentum().phi();
00027       double charge=m_chargeService(*ip);
00028       if(m_fieldOn && !(charge==0.) ) {
00029         
00030         double def=0.;
00031         double theta = (*ip)->momentum().theta();
00032         double eta = (*ip)->momentum().pseudoRapidity();
00033         double pt = (*ip)->momentum().perp();
00034         
00035         if (abs(eta) < 1.4) {def = -150. * 0.006/pt/2.0;}
00036         else { def = -350. * abs(tan(theta))* 0.006/pt/2.0;}
00037         
00038         if(double turns =(def/(2*M_PI))>5.0) {
00039           cout<<"MagField: particle has spun  "<<turns<<" pt= "<<pt<<endl;
00040         } 
00041         
00042         phi = Phi(phi + def*charge);
00043       }
00044       //      std::pair<double, HepMC::GenParticle*>* temp = 
00045       //new std::pair<double, HepMC::GenParticle*>(phi,*ip);
00046       //atCal.push_back( *temp );
00047       //delete temp;
00048       atCal.push_back( new TransportedParticle(phi, *ip));
00049     }
00050     
00051   }

Member Data Documentation

const bool Atlfast::MagField::m_fieldOn [private]
 

Definition at line 36 of file MagField.h.

Referenced by operator()().

const ChargeService Atlfast::MagField::m_chargeService [private]
 

Definition at line 37 of file MagField.h.

Referenced by operator()().

ChargeService Atlfast::MagField::lnkChargeService [private]
 

Definition at line 40 of file MagField.h.


The documentation for this class was generated from the following files:
Generated on Tue Mar 18 11:18:57 2003 for AtlfastAlgs by doxygen1.3-rc1