CMS 3D CMS Logo

HemisphereAlgo.h
Go to the documentation of this file.
1 #ifndef HemisphereAlgo_h
2 #define HemisphereAlgo_h
3 
4 /* \class HemisphereAlgo
5 *
6 * Class that, given the 4-momenta of the objects in the event,
7 * allows to split up the event into two "hemispheres" according
8 * to different criteria (see below)/
9 *
10 * Authors: Luc Pape & Filip Moortgat Date: July 2005
11 * Updated: July 2006
12 * Updated: 15 Sept 2006
13 
14 Transported to PAT by Wolfgang Adam and Tanja Rommerskirchen
15 *
16 */
18 
19 #include <vector>
20 #include <iostream>
21 #include <cmath>
22 
24 public:
25  // There are 2 constructors:
26  // 1. Constructor taking as argument vectors of Px, Py, Pz and E of the objects in
27  // the event that should be separated, the seeding method and the hemisphere
28  // association method,
29  // 2. Constructor taking as argument vectors of Px, Py, Pz and E of the objects in
30  // the event that should be separated. The seeding method and the hemisphere
31  // association method should then be defined by SetMethod(seeding_method, association_method).
32  //
33  // Seeding method: choice of 2 inital axes
34  // 1: 1st: max P ; 2nd: max P * delta R wrt first one
35  // 2: 2 objects who give maximal invariant mass (recommended)
36  //
37  // HemisphereAlgo association method:
38  // 1: maximum pt longitudinal projected on the axes
39  // 2: minimal mass squared sum of the hemispheres
40  // 3: minimal Lund distance (recommended)
41  //
42  // Note that SetMethod also allows the seeding and/or association method to be
43  // redefined for an existing hemisphere object. The GetAxis or GetGrouping is
44  // then recomputed using the newly defined methods.
45  //
46 
47  HemisphereAlgo(const std::vector<reco::CandidatePtr>& componentRefs_,
48  const int seed_method = 0,
49  const int hemisphere_association_method = 0);
50 
51  // Destructor
53 
54  std::vector<float> getAxis1(); // returns Nx, Ny, Nz, P, E of the axis of group 1
55  std::vector<float> getAxis2(); // returns Nx, Ny, Nz, P, E of the axis of group 2
56 
57  // where Nx, Ny, Nz are the direction cosines e.g. Nx = Px/P,
58  // P is the momentum, E is the energy
59 
60  std::vector<int> getGrouping(); // returns vector with "1" and "2"'s according to
61  // which group the object belongs
62  // (order of objects in vector is same as input)
63 
64  void SetMethod(int seed_method, int hemisphere_association_method) {
65  seed_meth = seed_method;
66  hemi_meth = hemisphere_association_method;
67  status = 0;
68  } // sets or overwrites the seed and association methods
69 
70  void SetNoSeed(int object_number) {
71  Object_Noseed[object_number] = 1;
72  status = 0;
73  }
74  // prevents an object from being used as a seed
75  // (method introduced on 15/09/06)
76 
77 private:
78  int reconstruct(); // the hemisphere separation algorithm
79  std::vector<reco::CandidatePtr> Object;
80 
81  std::vector<int> Object_Group;
82  std::vector<int> Object_Noseed;
83 
84  std::vector<float> Axis1;
85  std::vector<float> Axis2;
86 
87  //static const float hemivsn = 1.01;
88  int seed_meth;
89  int hemi_meth;
90  int status;
91 };
92 
93 #endif
HemisphereAlgo::SetNoSeed
void SetNoSeed(int object_number)
Definition: HemisphereAlgo.h:70
HemisphereAlgo::Axis1
std::vector< float > Axis1
Definition: HemisphereAlgo.h:84
HemisphereAlgo::SetMethod
void SetMethod(int seed_method, int hemisphere_association_method)
Definition: HemisphereAlgo.h:64
HemisphereAlgo::getAxis1
std::vector< float > getAxis1()
Definition: HemisphereAlgo.cc:26
HemisphereAlgo::reconstruct
int reconstruct()
Definition: HemisphereAlgo.cc:46
HemisphereAlgo::status
int status
Definition: HemisphereAlgo.h:90
HemisphereAlgo::Object_Noseed
std::vector< int > Object_Noseed
Definition: HemisphereAlgo.h:82
HemisphereAlgo::Axis2
std::vector< float > Axis2
Definition: HemisphereAlgo.h:85
HemisphereAlgo::HemisphereAlgo
HemisphereAlgo(const std::vector< reco::CandidatePtr > &componentRefs_, const int seed_method=0, const int hemisphere_association_method=0)
Definition: HemisphereAlgo.cc:11
HemisphereAlgo::Object_Group
std::vector< int > Object_Group
Definition: HemisphereAlgo.h:81
HemisphereAlgo::getGrouping
std::vector< int > getGrouping()
Definition: HemisphereAlgo.cc:39
HemisphereAlgo::hemi_meth
int hemi_meth
Definition: HemisphereAlgo.h:89
HemisphereAlgo
Definition: HemisphereAlgo.h:23
HemisphereAlgo::Object
std::vector< reco::CandidatePtr > Object
Definition: HemisphereAlgo.h:79
HemisphereAlgo::~HemisphereAlgo
~HemisphereAlgo()
Definition: HemisphereAlgo.h:52
Candidate.h
HemisphereAlgo::getAxis2
std::vector< float > getAxis2()
Definition: HemisphereAlgo.cc:32
HemisphereAlgo::seed_meth
int seed_meth
Definition: HemisphereAlgo.h:88