12 const int seed_method,
13 const int hemisphere_association_method)
14 : Object(componentPtr_),
18 seed_meth(seed_method),
19 hemi_meth(hemisphere_association_method),
49 LogDebug(
"HemisphereAlgo") <<
" HemisphereAlgo method ";
55 for (
int j = 0;
j < vsize;
j++) {
59 for (
int j = 0;
j < 5;
j++) {
64 for (
int i = 0;
i < vsize;
i++) {
67 <<
" less than P = " << (*
Object[
i]).
p();
77 float DeltaRP_Max = 0.;
80 for (
int i = 0;
i < vsize;
i++) {
95 for (
int i = 0;
i < vsize;
i++) {
100 if (DeltaRP > DeltaRP_Max) {
101 DeltaRP_Max = DeltaRP;
117 LogDebug(
"HemisphereAlgo") <<
" Axis 1 is Object = " << I_Max;
118 LogDebug(
"HemisphereAlgo") <<
" Axis 2 is Object = " << J_Max;
122 float InvariantMass = 0.;
125 for (
int i = 0;
i < vsize;
i++) {
128 for (
int j =
i + 1;
j < vsize;
j++) {
145 if (Mass_Max < InvariantMass) {
146 Mass_Max = InvariantMass;
173 LogDebug(
"HemisphereAlgo") <<
" Axis 1 is Object = " << I_Max;
174 LogDebug(
"HemisphereAlgo") <<
" Axis 2 is Object = " << J_Max;
177 throw cms::Exception(
"Configuration") <<
"Please give a valid seeding method!";
188 while (I_Move && (numLoop < 100)) {
191 LogDebug(
"HemisphereAlgo") <<
" Iteration = " << numLoop;
203 for (
int i = 0;
i < vsize;
i++) {
206 if (P_Long1 >= P_Long2) {
228 for (
int i = 0;
i < vsize;
i++) {
235 }
else if (
i == J_Max) {
246 float NewAxis1_E =
Axis1[4];
251 float NewAxis2_E =
Axis2[4];
254 NewAxis1_Px = NewAxis1_Px - (*
Object[
i]).
px();
255 NewAxis1_Py = NewAxis1_Py - (*
Object[
i]).
py();
256 NewAxis1_Pz = NewAxis1_Pz - (*
Object[
i]).pz();
260 NewAxis2_Px = NewAxis2_Px - (*
Object[
i]).
px();
261 NewAxis2_Py = NewAxis2_Py - (*
Object[
i]).
py();
262 NewAxis2_Pz = NewAxis2_Pz - (*
Object[
i]).pz();
277 mass1 *= NewAxis1_E / ((NewAxis1_E + (*
Object[
i]).
energy()) * (NewAxis1_E + (*
Object[
i]).energy()));
279 mass2 *= NewAxis2_E / ((NewAxis2_E + (*
Object[
i]).
energy()) * (NewAxis2_E + (*
Object[
i]).energy()));
320 throw cms::Exception(
"Configuration") <<
"Please give a valid hemisphere association method!";
325 Axis1[3] =
sqrt(Sum1_Px * Sum1_Px + Sum1_Py * Sum1_Py + Sum1_Pz * Sum1_Pz);
326 if (
Axis1[3] < 0.0001) {
335 Axis2[3] =
sqrt(Sum2_Px * Sum2_Px + Sum2_Py * Sum2_Py + Sum2_Pz * Sum2_Pz);
336 if (
Axis2[3] < 0.0001) {
345 LogDebug(
"HemisphereAlgo") <<
" Grouping = ";
346 for (
int i = 0;
i < vsize;
i++) {
349 LogTrace(
"HemisphereAlgo") << std::endl;
std::vector< int > Object_Noseed
std::vector< float > Axis2
std::vector< float > Axis1
std::vector< int > Object_Group
std::vector< float > getAxis1()
HemisphereAlgo(const std::vector< reco::CandidatePtr > &componentRefs_, const int seed_method=0, const int hemisphere_association_method=0)
std::vector< int > getGrouping()
std::vector< reco::CandidatePtr > Object
Log< level::Warning, false > LogWarning
std::vector< float > getAxis2()