28 double ptot[4]={0.,0.,0.,0.};
29 double cth, invR, pp2, pt;
33 int usedNTRK = usedParticles.size();
36 for( itc=0; itc<usedNTRK; itc++){
37 it = usedParticles[itc];
41 ptot[0] += pp[itc][0];
42 ptot[1] += pp[itc][1];
43 ptot[2] += pp[itc][2];
44 ptot[3] += pp[itc][3];
48 int ip=0;
if( std::abs(ptot[1]) > std::abs(ptot[ip]) )ip=1;
if( std::abs(ptot[2]) > std::abs(ptot[ip]) )ip=2;
49 int im=0;
if( std::abs(ptot[1]) < std::abs(ptot[im]) )im=1;
if( std::abs(ptot[2]) < std::abs(ptot[im]) )im=2;
50 int id=4;
for(
int i=0;i<3;i++)
if(i!=ip && i!=im)
id=i;
52 std::cout<<
"ERROR in mass constraint!!!"<<
'\n';
53 temp=ptot[3]*ptot[3]-ptot[0]*ptot[0]-ptot[1]*ptot[1]-ptot[2]*ptot[2];
55 temp = sqrt( (ptot[3]-ptot[ip])*(ptot[3]+ptot[ip]) );
72 for( itc=0; itc<usedNTRK; itc++){
73 it = usedParticles[itc];
77 cth = 1. / tan( trk->
cnstP[0] );
78 pt = sqrt(pp[itc][0]*pp[itc][0] + pp[itc][1]*pp[itc][1]);
79 pp2 = pp[itc][0]*pp[itc][0] + pp[itc][1]*pp[itc][1] + pp[itc][2]*pp[itc][2];
80 base_cnst->
f0t[it][numCNST].X = ptot[3] * (-pp2* cth / pp[itc][3])
81 - ptot[2] * (-pt * (cth*cth + 1.));
82 base_cnst->
f0t[it][numCNST].Y = -ptot[0] * (-pp[itc][1])
83 - ptot[1] * pp[itc][0];
84 base_cnst->
f0t[it][numCNST].Z = ptot[3] * (-pp2/ (invR * pp[itc][3]))
85 - ptot[0] * (-pp[itc][0] / invR)
86 - ptot[1] * (-pp[itc][1] / invR)
87 - ptot[2] * (-pp[itc][2] / invR);
90 base_cnst->
h0t[numCNST].X = 0.;
91 base_cnst->
h0t[numCNST].Y = 0.;
92 base_cnst->
h0t[numCNST].Z = 0.;
93 for (it = 0; it < (int)vk->
TrackList.size(); ++it) {
94 base_cnst->
f0t[it][numCNST].X *=
Scale * 2;
95 base_cnst->
f0t[it][numCNST].Y *=
Scale * 2;
96 base_cnst->
f0t[it][numCNST].Z *=
Scale * 2;
98 base_cnst->
aa[numCNST] *=
Scale;