14 Hemisphere::Hemisphere(vector<float> Px_vector,
15 vector<float> Py_vector,
16 vector<float> Pz_vector,
17 vector<float> E_vector,
19 int hemisphere_association_method)
20 : Object_Px(Px_vector),
24 seed_meth(seed_method),
25 hemi_meth(hemisphere_association_method),
31 rejectISRPtmax(10000.),
45 vector<float> Py_vector,
46 vector<float> Pz_vector,
47 vector<float> E_vector)
118 cout <<
"WARNING!!!!! Input vectors have different size! Fix it!" << endl;
123 cout <<
" Hemisphere method " << endl;
137 for (
int j = 0;
j < vsize; ++
j) {
144 for (
int j = 0;
j < 5; ++
j) {
151 for (
int i = 0;
i < vsize; ++
i) {
155 <<
" *** Fix it!" << endl;
166 theta = theta + 3.141592654;
186 float DeltaRP_Max = 0.;
189 for (
int i = 0;
i < vsize; ++
i) {
211 for (
int i = 0;
i < vsize; ++
i) {
219 if (DeltaRP > DeltaRP_Max) {
220 DeltaRP_Max = DeltaRP;
237 cout <<
" Axis 1 is Object = " << I_Max << endl;
238 cout <<
" Axis 2 is Object = " << J_Max << endl;
247 for (
int i = 0;
i < vsize; ++
i) {
250 for (
int j =
i + 1;
j < vsize; ++
j) {
265 if (Mass_Max < InvariantMass) {
266 Mass_Max = InvariantMass;
293 cout <<
" Axis 1 is Object = " << I_Max << endl;
294 cout <<
" Axis 2 is Object = " << J_Max << endl;
302 for (
int i = 0;
i < vsize; ++
i) {
313 for (
int i = 0;
i < vsize; ++
i) {
345 cout <<
" Axis 1 is Object = " << I_Max <<
" with Pt " <<
Object_Pt[I_Max] << endl;
346 cout <<
" Axis 2 is Object = " << J_Max <<
" with Pt " <<
Object_Pt[J_Max] << endl;
350 cout <<
"Please give a valid seeding method!" << endl;
374 cout <<
" Hemishpere: warning - reaching max number of iterations " << endl;
389 for (
int i = 0;
i < vsize; ++
i) {
393 if (P_Long1 >= P_Long2) {
417 for (
int i = 0;
i < vsize; ++
i) {
425 }
else if (
i == J_Max) {
439 float NewAxis1_Py = Axis1[1] * Axis1[3];
440 float NewAxis1_Pz = Axis1[2] * Axis1[3];
441 float NewAxis1_E = Axis1[4];
443 float NewAxis2_Py = Axis2[1] * Axis2[3];
444 float NewAxis2_Pz = Axis2[2] * Axis2[3];
445 float NewAxis2_E = Axis2[4];
460 float mass1 = NewAxis1_E -
463 float mass2 = NewAxis2_E -
513 cout <<
"Please give a valid hemisphere association method!" << endl;
519 Axis1[3] =
sqrt(Sum1_Px * Sum1_Px + Sum1_Py * Sum1_Py + Sum1_Pz * Sum1_Pz);
520 if (
Axis1[3] < 0.0001) {
521 cout <<
"ZERO objects in group 1! " << endl;
528 Axis2[3] =
sqrt(Sum2_Px * Sum2_Px + Sum2_Py * Sum2_Py + Sum2_Pz * Sum2_Pz);
529 if (
Axis2[3] < 0.0001) {
530 cout <<
" ZERO objects in group 2! " << endl;
539 cout <<
" Grouping = ";
540 for (
int i = 0;
i < vsize;
i++) {
554 for (
int i = 0;
i < vsize; ++
i) {
562 float sumdiff = fabs(sumtot - 2 *
Object_E[0]);
564 int ibest = 0, jbest = 0;
570 for (
int i = 0;
i < vsize - 1; ++
i) {
578 for (
int j =
i + 1;
j < vsize; ++
j) {
587 float sum2_E = sumtot - sum1_E;
588 if (sumdiff >= fabs(sum1_E - sum2_E)) {
589 sumdiff = fabs(sum1_E - sum2_E);
598 float Sum1_Px = 0, Sum1_Py = 0, Sum1_Pz = 0, Sum1_E = 0;
599 float Sum2_Px = 0, Sum2_Py = 0, Sum2_Pz = 0, Sum2_E = 0;
600 for (
int i = 0;
i < vsize; ++
i) {
603 else if (
i <= ibest ||
i == jbest) {
617 Axis1[3] =
sqrt(Sum1_Px * Sum1_Px + Sum1_Py * Sum1_Py + Sum1_Pz * Sum1_Pz);
622 Axis2[3] =
sqrt(Sum2_Px * Sum2_Px + Sum2_Py * Sum2_Py + Sum2_Pz * Sum2_Pz);
654 float newAxis1_Py = Axis1[1] * Axis1[3];
655 float newAxis1_Pz = Axis1[2] * Axis1[3];
658 float newAxis2_Py = Axis2[1] * Axis2[3];
659 float newAxis2_Pz = Axis2[2] * Axis2[3];
664 for (
int i = 0;
i < vsize; ++
i) {
691 sqrt(newPx * newPx + newPy * newPy + newPz * newPz);
693 ptHemi =
sqrt(pObjsq - plHemi * plHemi);
694 if (ptHemi > valmax) {
699 float theta = 1.570796327;
703 if (fabs(newPz) > 0.001) {
704 theta = atan(
sqrt(newPx * newPx + newPy * newPy) / newPz);
707 theta = theta + 3.141592654;
709 hemiEta = -
log(
tan(0.5 * theta));
710 hemiPhi = atan2(newPy, newPx);
716 if (DeltaR > valmax) {
std::vector< float > getAxis1()
std::vector< float > Object_Phi
std::vector< float > Object_P
Geom::Theta< T > theta() const
std::vector< float > Axis2
std::vector< int > getGrouping()
std::vector< float > Object_Eta
std::vector< float > Object_Py
std::vector< int > Object_Noseed
Tan< T >::type tan(const T &t)
TAKEN FROM http://cmssw.cvs.cern.ch/cgi-bin/cmssw.cgi/CMSSW/ElectroWeakAnalysis/Utilities/src/PdfWeig...
std::vector< float > Object_E
std::vector< float > Object_Pt
std::vector< int > Object_Noassoc
std::vector< float > getAxis2()
std::vector< float > Object_Pz
std::vector< float > Object_Px
std::vector< float > Axis1
std::vector< int > Object_Group
void SetNoAssoc(int object_number)