#include <MagField.h>
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 |
|
Definition at line 23 of file MagField.h.
|
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()) {} |
|
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 } |
|
Definition at line 36 of file MagField.h. Referenced by operator()(). |
|
Definition at line 37 of file MagField.h. Referenced by operator()(). |
|
Definition at line 40 of file MagField.h. |