Atlfast::ElectronBinData Class Reference

#include <ElectronBinData.h>

Inheritance diagram for Atlfast::ElectronBinData:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ElectronBinData (BinID &, vector< ParameterResolutions * >, vector< ParameterResolutions * >, vector< ParameterResolutions * >, vector< ParameterResolutions * >, int randSeed)
virtual ~ElectronBinData ()
HepSymMatrix getMatrix (const TrackTrajectory &track) const

Private Attributes

BinID m_id
vector< ParameterResolutions * > m_cores
vector< ParameterResolutions * > m_tails
vector< ParameterResolutions * > m_fractions
vector< ParameterResolutions * > m_correlations
HepRandomEngine * m_randomEngine

Detailed Description

Definition at line 34 of file ElectronBinData.h.


Constructor & Destructor Documentation

Atlfast::ElectronBinData::ElectronBinData ( BinID ,
vector< ParameterResolutions * >  ,
vector< ParameterResolutions * >  ,
vector< ParameterResolutions * >  ,
vector< ParameterResolutions * >  ,
int  randSeed 
)

Constructor from flat file contents

Definition at line 9 of file ElectronBinData.cxx.

00015                                     :
00016                    m_id(id),
00017                    m_cores(core),    
00018                    m_tails(tails),
00019                    m_fractions(fractions),
00020                    m_correlations(correlations)
00021   {
00022     m_randomEngine = new HepJamesRandom(randSeed);
00023   }    

Atlfast::ElectronBinData::~ElectronBinData (  )  [virtual]

Definition at line 25 of file ElectronBinData.cxx.

00026   {
00027     for (size_t i = 0; i < m_cores.size(); i++)
00028       delete m_cores[i];
00029     for (size_t i = 0; i < m_tails.size(); i++)
00030       delete m_tails[i];
00031     for (size_t i = 0; i < m_fractions.size(); i++)
00032       delete m_fractions[i];
00033     for (size_t i = 0; i < m_correlations.size(); i++)
00034       delete m_correlations[i];
00035     delete m_randomEngine;
00036   }


Member Function Documentation

HepSymMatrix Atlfast::ElectronBinData::getMatrix ( const TrackTrajectory track  )  const [virtual]

returns the correlation matrix depending on an internally generated random number and track trajectory supplied as argument

Implements Atlfast::IBinData.

Definition at line 58 of file ElectronBinData.cxx.

00059   {
00060     HepSymMatrix Sigma(5,0);
00061 
00062     double fraction, random[5];
00063 
00064     // order of parameters: d0, z0, phi0, cot(theta0), q/pT
00065     random[0] = m_randomEngine->flat();
00066     random[1] = m_randomEngine->flat();
00067     random[2] = m_randomEngine->flat();
00068     random[3] = m_randomEngine->flat();
00069     random[4] = m_randomEngine->flat();
00070 
00071     // diagonals
00072     for ( int param = 0; param < 5; param++ )
00073     {
00074       fraction = m_fractions[param]->resolution(traj);
00075       if ( fraction > 1.0 )  fraction = 1.0;      
00076       Sigma[param][param] = ( random[param] < fraction )  ?
00077                             std::pow( m_cores[param]->resolution(traj), 2 )  :
00078                             std::pow( m_tails[param]->resolution(traj), 2 );
00079     }
00080     
00081     // off-diagonals 
00082     // NOTE: m_correlations[] holds correlation coefficients, need covariances
00083     
00084     // (1,3) ... cov(d0,phi0)
00085     // (1,5) ... cov(d0,q/pT)
00086     // (3,5) ... cov(phi0,q/pT)
00087     double rho13 = m_correlations[0]->resolution(traj);
00088     double rho15 = m_correlations[1]->resolution(traj);
00089     double rho35 = m_correlations[2]->resolution(traj);
00090 
00091     // covariance sub-matrix of transverse parameters needs to be positive definite
00092     // in order that its square root (cf. ElectronMatrixManager) exists
00093     double det3 = 1 - rho13 * rho13 - rho15 * rho15 - rho35 * rho35 - 2 * rho13 * rho15 * rho35;
00094     if ( det3 < 0 )  rho13 = rho15 = rho35 = 0;
00095 
00096     // make sure that correlation coefficients stay within [-1,+1]
00097     if ( std::abs(rho13) > 1 )  rho13 *= 0.99 / std::abs(rho13);
00098     if ( std::abs(rho15) > 1 )  rho15 *= 0.99 / std::abs(rho15);
00099     if ( std::abs(rho35) > 1 )  rho35 *= 0.99 / std::abs(rho35);
00100 
00101     Sigma(1,3) = Sigma(3,1) = rho13 * std::sqrt( Sigma(1,1) * Sigma(3,3) );
00102     Sigma(1,5) = Sigma(5,1) = rho15 * std::sqrt( Sigma(1,1) * Sigma(5,5) );
00103     Sigma(3,5) = Sigma(5,3) = rho35 * std::sqrt( Sigma(3,3) * Sigma(5,5) );
00104 
00105     // (2,4) ... cov(z0,cot(theta0))
00106     double rho24 = m_correlations[3]->resolution(traj);
00107     // make sure that correlation coefficient stays within [-1,+1]
00108     if ( std::abs(rho24) > 1 )  rho24 *= 0.99 / std::abs(rho24);
00109     Sigma(2,4) = Sigma(4,2) = rho24 * std::sqrt( Sigma(2,2) * Sigma(4,4) );
00110 
00111     // DONE!
00112     return Sigma;
00113     
00114   }


Member Data Documentation

BinID Atlfast::ElectronBinData::m_id [private]

Definition at line 59 of file ElectronBinData.h.

vector< ParameterResolutions* > Atlfast::ElectronBinData::m_cores [private]

Definition at line 61 of file ElectronBinData.h.

vector< ParameterResolutions* > Atlfast::ElectronBinData::m_tails [private]

Definition at line 62 of file ElectronBinData.h.

vector< ParameterResolutions* > Atlfast::ElectronBinData::m_fractions [private]

Definition at line 63 of file ElectronBinData.h.

vector< ParameterResolutions* > Atlfast::ElectronBinData::m_correlations [private]

Definition at line 64 of file ElectronBinData.h.

HepRandomEngine* Atlfast::ElectronBinData::m_randomEngine [private]

Definition at line 66 of file ElectronBinData.h.


The documentation for this class was generated from the following files:
Generated on Mon Sep 24 14:19:37 2007 for AtlfastAlgs by  doxygen 1.5.1