Report problems to ATLAS LXR Team (with time and IP address indicated)

The LXR Cross Referencer

source navigation ]
diff markup ]
identifier search ]
general search ]
 
 
Architecture: linux ]
Version: head ] [ nightly ] [ GaudiDev ]
  Links to LXR source navigation pages for stable releases [ 12.*.* ]   [ 13.*.* ]   [ 14.*.* ]   [ 15.*.* ] 

001 #include "AtlfastAlgs/ElectronBinData.h"
002 
003 namespace Atlfast 
004 {
005 
006 /** @brief Class to hold smearing matrix data.
007    *
008    * The data is provided through the constructor
009    * in the format found in the flat file and the
010    * correlation matrix corresponding to the bin
011    * can be calculated and returned via public methods.
012    */
013 
014 
015   //-----------------------------------------------
016   // PUBLIC - Constructor
017   //-----------------------------------------------
018   ElectronBinData::ElectronBinData( BinID& id,
019                                     vector< ParameterResolutions* > core,
020                                     vector< ParameterResolutions* > tails,
021                                     vector< ParameterResolutions* > fractions,
022                                     vector< ParameterResolutions* > correlations,
023                                     int randSeed
024                                   ) :
025                    m_id(id),
026                    m_cores(core),    
027                    m_tails(tails),
028                    m_fractions(fractions),
029                    m_correlations(correlations)
030   {
031     m_randomEngine = new HepJamesRandom(randSeed);
032   }    
033 
034   ElectronBinData::~ElectronBinData()
035   {
036     for (size_t i = 0; i < m_cores.size(); i++)
037       delete m_cores[i];
038     for (size_t i = 0; i < m_tails.size(); i++)
039       delete m_tails[i];
040     for (size_t i = 0; i < m_fractions.size(); i++)
041       delete m_fractions[i];
042     for (size_t i = 0; i < m_correlations.size(); i++)
043       delete m_correlations[i];
044     delete m_randomEngine;
045   }
046   
047   
048   //--------------------------------------------------------------------
049   // PUBLIC - HepSymMatrix getMatrix(random)
050   // returns appropriate Sigma (=covariance) matrix
051   //
052   // NOTE: the representation of Sigma is determined by the track 
053   //       representation implicitly given in the parameter files,
054   //       i.e., (d0, z0, phi0, cot(theta0), q/pT), which is for 
055   //       internal use only.
056   //
057   //       The main advantage of this representation is that in 
058   //       the context of the ID, for a solenoidal field, the three
059   //       transverse track parameters (d0, phi0, q/pT) are to a 
060   //       good approximation uncorrelated with the two longitudinal 
061   //       ones (z0, cot(theta0)).  
062   //
063   //       Sigma has to be converted into the representation used 
064   //       by Common Tracking, i.e. (d0, z0, phi0, theta0, q/p), 
065   //       when it is written to CBNTs or AODs.  
066   //--------------------------------------------------------------------
067   HepSymMatrix ElectronBinData::getMatrix( const TrackTrajectory& traj ) const
068   {
069     HepSymMatrix Sigma(5,0);
070 
071     double fraction, random[5];
072 
073     // order of parameters: d0, z0, phi0, cot(theta0), q/pT
074     random[0] = m_randomEngine->flat();
075     random[1] = m_randomEngine->flat();
076     random[2] = m_randomEngine->flat();
077     random[3] = m_randomEngine->flat();
078     random[4] = m_randomEngine->flat();
079 
080     // diagonals
081     for ( int param = 0; param < 5; param++ )
082     {
083       fraction = m_fractions[param]->resolution(traj);
084       if ( fraction > 1.0 )  fraction = 1.0;      
085       Sigma[param][param] = ( random[param] < fraction )  ?
086                             std::pow( m_cores[param]->resolution(traj), 2 )  :
087                             std::pow( m_tails[param]->resolution(traj), 2 );
088     }
089     
090     // off-diagonals 
091     // NOTE: m_correlations[] holds correlation coefficients, need covariances
092     
093     // (1,3) ... cov(d0,phi0)
094     // (1,5) ... cov(d0,q/pT)
095     // (3,5) ... cov(phi0,q/pT)
096     double rho13 = m_correlations[0]->resolution(traj);
097     double rho15 = m_correlations[1]->resolution(traj);
098     double rho35 = m_correlations[2]->resolution(traj);
099 
100     // covariance sub-matrix of transverse parameters needs to be positive definite
101     // in order that its square root (cf. ElectronMatrixManager) exists
102     double det3 = 1 - rho13 * rho13 - rho15 * rho15 - rho35 * rho35 - 2 * rho13 * rho15 * rho35;
103     if ( det3 < 0 )  rho13 = rho15 = rho35 = 0;
104 
105     // make sure that correlation coefficients stay within [-1,+1]
106     if ( std::abs(rho13) > 1 )  rho13 *= 0.99 / std::abs(rho13);
107     if ( std::abs(rho15) > 1 )  rho15 *= 0.99 / std::abs(rho15);
108     if ( std::abs(rho35) > 1 )  rho35 *= 0.99 / std::abs(rho35);
109 
110     Sigma(1,3) = Sigma(3,1) = rho13 * std::sqrt( Sigma(1,1) * Sigma(3,3) );
111     Sigma(1,5) = Sigma(5,1) = rho15 * std::sqrt( Sigma(1,1) * Sigma(5,5) );
112     Sigma(3,5) = Sigma(5,3) = rho35 * std::sqrt( Sigma(3,3) * Sigma(5,5) );
113 
114     // (2,4) ... cov(z0,cot(theta0))
115     double rho24 = m_correlations[3]->resolution(traj);
116     // make sure that correlation coefficient stays within [-1,+1]
117     if ( std::abs(rho24) > 1 )  rho24 *= 0.99 / std::abs(rho24);
118     Sigma(2,4) = Sigma(4,2) = rho24 * std::sqrt( Sigma(2,2) * Sigma(4,4) );
119 
120     // DONE!
121     return Sigma;
122     
123   }
124   
125 } //namespace bracket
126 

source navigation ] diff markup ] identifier search ] general search ]

Due to the LXR bug, the updates fail sometimes to remove references to deleted files. The Saturday's full rebuilds fix these problems
This page was automatically generated by the LXR engine. Valid HTML 4.01!