27 double ptot[4]={0.,0.,0.,0.};
28 double cth, invR, pp2,
pt;
32 int usedNTRK = usedParticles.size();
35 for( itc=0; itc<usedNTRK; itc++){
36 it = usedParticles[itc];
39 ptot[0] += pp[itc][0];
40 ptot[1] += pp[itc][1];
41 ptot[2] += pp[itc][2];
42 ptot[3] += pp[itc][3];
46 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;
47 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;
48 int id=4;
for(
int i=0;
i<3;
i++)
if(
i!=
ip &&
i!=
im)
id=
i;
50 std::cout<<
"ERROR in mass constraint!!!"<<
'\n';
51 temp=ptot[3]*ptot[3]-ptot[0]*ptot[0]-ptot[1]*ptot[1]-ptot[2]*ptot[2];
53 temp = sqrt( (ptot[3]-ptot[
ip])*(ptot[3]+ptot[
ip]) );
67 for( itc=0; itc<usedNTRK; itc++){
68 it = usedParticles[itc];
72 pt = sqrt(pp[itc][0]*pp[itc][0] + pp[itc][1]*pp[itc][1]);
73 pp2 = pp[itc][0]*pp[itc][0] + pp[itc][1]*pp[itc][1] + pp[itc][2]*pp[itc][2];
74 base_cnst->
f0t[
it][numCNST].X = ptot[3] * (-pp2* cth / pp[itc][3])
75 - ptot[2] * (-
pt * (cth*cth + 1.));
76 base_cnst->
f0t[
it][numCNST].Y = -ptot[0] * (-pp[itc][1])
77 - ptot[1] * pp[itc][0];
78 base_cnst->
f0t[
it][numCNST].Z = ptot[3] * (-pp2/ (invR * pp[itc][3]))
79 - ptot[0] * (-pp[itc][0] / invR)
80 - ptot[1] * (-pp[itc][1] / invR)
81 - ptot[2] * (-pp[itc][2] / invR);
84 base_cnst->
h0t[numCNST].X = 0.;
85 base_cnst->
h0t[numCNST].Y = 0.;
86 base_cnst->
h0t[numCNST].Z = 0.;
95 base_cnst->
aa[numCNST] *=
Scale;