94 cout <<
"WARNING!!!!! Input vectors have different size! Fix it!" << endl;
99 cout <<
" Hemisphere method " << endl;
113 for(
int j = 0;
j < vsize; ++
j){
120 for(
int j = 0;
j < 5; ++
j){
127 for (
int i = 0;
i <vsize; ++
i){
131 <<
" less than P = " <<
Object_P[
i] <<
" *** Fix it!" << endl;
142 if (theta < 0.) {theta = theta + 3.141592654;}
163 float DeltaRP_Max = 0.;
166 for (
int i = 0; i < vsize; ++
i){
188 for (
int i = 0; i < vsize; ++
i){
195 if (DeltaRP > DeltaRP_Max){
196 DeltaRP_Max = DeltaRP;
213 cout <<
" Axis 1 is Object = " << I_Max << endl;
214 cout <<
" Axis 2 is Object = " << J_Max << endl;
224 for (
int i = 0; i < vsize; ++
i){
227 for (
int j = i+1;
j < vsize; ++
j){
243 if (Mass_Max < InvariantMass){
271 cout <<
" Axis 1 is Object = " << I_Max << endl;
272 cout <<
" Axis 2 is Object = " << J_Max << endl;
281 for (
int i = 0; i < vsize; ++
i){
288 if(I_Max < 0)
return 0;
291 for (
int i = 0; i < vsize; ++
i){
292 if( i == I_Max)
continue;
300 if(J_Max < 0)
return 0;
321 cout <<
" Axis 1 is Object = " << I_Max <<
" with Pt " <<
Object_Pt[I_Max]<< endl;
322 cout <<
" Axis 2 is Object = " << J_Max <<
" with Pt " <<
Object_Pt[J_Max]<< endl;
326 cout <<
"Please give a valid seeding method!" << endl;
352 cout <<
" Hemishpere: warning - reaching max number of iterations " << endl;
368 for (
int i = 0; i < vsize; ++
i){
372 if (P_Long1 >= P_Long2){
397 for (
int i = 0; i < vsize; ++
i){
405 }
else if (i == J_Max) {
419 float NewAxis1_Px = Axis1[0] * Axis1[3];
420 float NewAxis1_Py = Axis1[1] * Axis1[3];
421 float NewAxis1_Pz = Axis1[2] * Axis1[3];
422 float NewAxis1_E = Axis1[4];
423 float NewAxis2_Px = Axis2[0] * Axis2[3];
424 float NewAxis2_Py = Axis2[1] * Axis2[3];
425 float NewAxis2_Pz = Axis2[2] * Axis2[3];
426 float NewAxis2_E = Axis2[4];
441 float mass1 = NewAxis1_E
444 float mass2 = NewAxis2_E
494 cout <<
"Please give a valid hemisphere association method!" << endl;
500 Axis1[3] =
sqrt(Sum1_Px*Sum1_Px + Sum1_Py*Sum1_Py + Sum1_Pz*Sum1_Pz);
501 if (Axis1[3] < 0.0001) {
502 cout <<
"ZERO objects in group 1! " << endl;
504 Axis1[0] = Sum1_Px / Axis1[3];
505 Axis1[1] = Sum1_Py / Axis1[3];
506 Axis1[2] = Sum1_Pz / Axis1[3];
509 Axis2[3] =
sqrt(Sum2_Px*Sum2_Px + Sum2_Py*Sum2_Py + Sum2_Pz*Sum2_Pz);
510 if (Axis2[3] < 0.0001) {
511 cout <<
" ZERO objects in group 2! " << endl;
513 Axis2[0] = Sum2_Px / Axis2[3];
514 Axis2[1] = Sum2_Py / Axis2[3];
515 Axis2[2] = Sum2_Pz / Axis2[3];
520 cout <<
" Grouping = ";
521 for (
int i=0;i<vsize;i++){
527 if (
numLoop <= 1) I_Move =
true;
534 for (
int i = 0; i < vsize; ++
i){
539 float sumdiff = fabs(sumtot - 2*
Object_E[0]);
541 int ibest = 0, jbest = 0;
547 for (
int i = 0; i < vsize-1; ++
i){
551 for (
int j = i+1; j < vsize; ++
j){
559 float sum2_E = sumtot - sum1_E;
560 if(sumdiff >= fabs(sum1_E - sum2_E)) {
561 sumdiff = fabs(sum1_E - sum2_E);
570 float Sum1_Px=0, Sum1_Py=0, Sum1_Pz=0, Sum1_E=0;
571 float Sum2_Px=0, Sum2_Py=0, Sum2_Pz=0, Sum2_E=0;
572 for (
int i = 0; i < vsize; ++
i){
574 else if (i <= ibest || i == jbest) {
588 Axis1[3] =
sqrt(Sum1_Px*Sum1_Px + Sum1_Py*Sum1_Py + Sum1_Pz*Sum1_Pz);
589 Axis1[0] = Sum1_Px / Axis1[3];
590 Axis1[1] = Sum1_Py / Axis1[3];
591 Axis1[2] = Sum1_Pz / Axis1[3];
593 Axis2[3] =
sqrt(Sum2_Px*Sum2_Px + Sum2_Py*Sum2_Py + Sum2_Pz*Sum2_Pz);
594 Axis2[0] = Sum2_Px / Axis2[3];
595 Axis2[1] = Sum2_Py / Axis2[3];
596 Axis2[2] = Sum2_Pz / Axis2[3];
std::vector< float > Object_Phi
std::vector< float > Object_P
Geom::Theta< T > theta() const
VDouble InvariantMass(Tau)
std::vector< float > Axis2
std::vector< float > Object_Eta
std::vector< float > Object_Py
std::vector< int > Object_Noseed
Tan< T >::type tan(const T &t)
std::vector< float > Object_E
double deltaR(double eta1, double eta2, double phi1, double phi2)
std::vector< float > Object_Pt
std::vector< int > Object_Noassoc
std::vector< float > Object_Pz
std::vector< float > Object_Px
std::vector< float > Axis1
std::vector< int > Object_Group