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

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!