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