001 #include "AtlfastAlgs/PionBinData.h"
002
003 namespace Atlfast
004 {
005
006
007
008
009
010
011
012
013
014
015
016
017
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
051
052
053
054
055
056
057
058
059
060
061
062
063
064
065
066
067
068 HepSymMatrix PionBinData::getMatrix( const TrackTrajectory& traj ) const
069 {
070 HepSymMatrix Sigma(5,0);
071
072 double fraction, random[5];
073
074
075
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
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
093
094
095
096
097
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
103
104 double det3 = 1 - rho13 * rho13 - rho15 * rho15 - rho35 * rho35 - 2 * rho13 * rho15 * rho35;
105 if ( det3 < 0 ) rho13 = rho15 = rho35 = 0;
106
107
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
118 double rho24 = m_correlations[3]->resolution(traj);
119
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
124 return Sigma;
125
126 }
127
128 }
129
| 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.
|
|