1 |
bendavid |
1.1 |
//--------------------------------------------------------------------------------------------------
|
2 |
|
|
// $Id $
|
3 |
|
|
//
|
4 |
|
|
// VertexTools
|
5 |
|
|
//
|
6 |
|
|
// Helper Class for photon Identification decisions.
|
7 |
|
|
//
|
8 |
|
|
// Authors: J.Bendavid
|
9 |
|
|
//--------------------------------------------------------------------------------------------------
|
10 |
|
|
|
11 |
|
|
#ifndef MITPHYSICS_UTILS_VERTEXTOOLS_H
|
12 |
|
|
#define MITPHYSICS_UTILS_VERTEXTOOLS_H
|
13 |
|
|
|
14 |
|
|
#include "MitAna/DataTree/interface/Photon.h"
|
15 |
|
|
#include "MitAna/DataTree/interface/Electron.h"
|
16 |
|
|
#include "MitAna/DataTree/interface/ElectronCol.h"
|
17 |
|
|
#include "MitAna/DataTree/interface/BaseVertex.h"
|
18 |
|
|
#include "MitAna/DataTree/interface/DecayParticleCol.h"
|
19 |
|
|
#include "MitAna/DataTree/interface/VertexCol.h"
|
20 |
|
|
#include "MitAna/DataTree/interface/BeamSpotCol.h"
|
21 |
|
|
#include "MitAna/DataTree/interface/TriggerObjectCol.h"
|
22 |
|
|
#include "MitCommon/MathTools/interface/MathUtils.h"
|
23 |
|
|
#include "MitPhysics/Utils/interface/VertexMVA.h"
|
24 |
maxi |
1.2 |
#include "MitAna/DataTree/interface/PFCandidateCol.h"
|
25 |
bendavid |
1.1 |
|
26 |
maxi |
1.2 |
#include "TMVA/Reader.h"
|
27 |
bendavid |
1.1 |
|
28 |
bendavid |
1.6 |
namespace TMVA {//MVA
|
29 |
|
|
class Reader;
|
30 |
|
|
}
|
31 |
|
|
|
32 |
bendavid |
1.1 |
namespace mithep {
|
33 |
maxi |
1.2 |
typedef std::vector<double> VertexZarray;
|
34 |
maxi |
1.3 |
typedef std::vector<const Track*> TrackArray;
|
35 |
maxi |
1.2 |
|
36 |
bendavid |
1.1 |
class VertexTools {
|
37 |
maxi |
1.2 |
public:
|
38 |
bendavid |
1.6 |
|
39 |
|
|
VertexTools();
|
40 |
|
|
|
41 |
maxi |
1.2 |
static double NewMass(const Photon* ph1, const Photon* ph2, const BaseVertex* vert);
|
42 |
|
|
|
43 |
|
|
static VertexZarray ExtractZarray(const VertexCol* vcol, float zmin=-30, float zmax = 30,
|
44 |
|
|
const BaseVertex *fBeamSpot = NULL);
|
45 |
|
|
static VertexZarray ExtractZarray(float zmin=-30, float zmax=30, float step=0.05);
|
46 |
|
|
|
47 |
|
|
static const Vertex* BestVtx(const PFCandidateCol *fPFJets, const VertexCol *c,
|
48 |
|
|
const BaseVertex *fBeamSpot, FourVector diboso);
|
49 |
fabstoec |
1.4 |
|
50 |
|
|
|
51 |
maxi |
1.2 |
static double BestVtx(const PFCandidateCol *fPFJets, VertexZarray zcol,
|
52 |
|
|
const BaseVertex *fBeamSpot, FourVector diboso);
|
53 |
fabstoec |
1.4 |
|
54 |
maxi |
1.2 |
static double Prob(const PFCandidateCol *fPFJets, double zpos,
|
55 |
|
|
const BaseVertex *fBeamSpot, FourVector diboso);
|
56 |
|
|
|
57 |
|
|
static double VertexWidth(const Vertex*, const BaseVertex* );
|
58 |
maxi |
1.3 |
|
59 |
|
|
static void BanThisTrack(const Track*);
|
60 |
|
|
static void Reset();
|
61 |
maxi |
1.2 |
|
62 |
|
|
static VertexTools* instance(const char* str){
|
63 |
|
|
if(meobject == NULL){
|
64 |
bendavid |
1.6 |
meobject = new VertexTools();
|
65 |
|
|
meobject->InitM(str);
|
66 |
maxi |
1.2 |
}
|
67 |
|
|
return meobject;
|
68 |
fabstoec |
1.4 |
}
|
69 |
maxi |
1.2 |
|
70 |
fabstoec |
1.5 |
// ----------------------------------------------------------
|
71 |
|
|
// Methods (added by Fabian) on the EPS BaseLine Analysis
|
72 |
bendavid |
1.6 |
const Vertex* findVtxBasicRanking(const Photon* ph1,
|
73 |
fabstoec |
1.10 |
const Photon* ph2,
|
74 |
|
|
const BaseVertex* bsp,
|
75 |
|
|
const VertexCol* vtcs,
|
76 |
|
|
const DecayParticleCol* conv, Bool_t useMva, Double_t &vtxProb,
|
77 |
|
|
std::vector<int> * debugInds = NULL ,
|
78 |
|
|
std::vector<double>* debugVals = NULL ,
|
79 |
|
|
std::vector<int> * debugConv = NULL );
|
80 |
fabstoec |
1.5 |
// ----------------------------------------------------------
|
81 |
|
|
|
82 |
bendavid |
1.8 |
|
83 |
|
|
static std::pair<double,double> VtxZFromConversion(const Photon *p, const DecayParticle *c, const BaseVertex *bsp);
|
84 |
bendavid |
1.6 |
|
85 |
|
|
void InitM(const char* str);
|
86 |
bendavid |
1.9 |
void InitP(int version = 1);
|
87 |
bendavid |
1.6 |
|
88 |
|
|
Bool_t IsInitMvaM() const { return fIsInitMvaM; }
|
89 |
|
|
Bool_t IsInitMvaP() const { return fIsInitMvaP; }
|
90 |
|
|
|
91 |
bendavid |
1.7 |
static Double_t DeltaMassVtx(Double_t xp1, Double_t yp1, Double_t zp1,
|
92 |
|
|
Double_t xp2, Double_t yp2, Double_t zp2,
|
93 |
|
|
Double_t xv, Double_t yv, Double_t zv,
|
94 |
bendavid |
1.6 |
Double_t dz);
|
95 |
maxi |
1.2 |
|
96 |
|
|
private:
|
97 |
bendavid |
1.6 |
|
98 |
|
|
double VtxMvaP(float ptbal, float ptasym, float logsumpt2, float limPullToConv, float nConv) const;
|
99 |
|
|
|
100 |
maxi |
1.2 |
static VertexTools *meobject;
|
101 |
fabstoec |
1.4 |
|
102 |
bendavid |
1.6 |
|
103 |
maxi |
1.2 |
TString relname;
|
104 |
fabstoec |
1.4 |
|
105 |
maxi |
1.3 |
TrackArray excluded;
|
106 |
|
|
|
107 |
bendavid |
1.6 |
Bool_t fIsInitMvaM;
|
108 |
|
|
Bool_t fIsInitMvaP;
|
109 |
|
|
|
110 |
|
|
Float_t tmvar1, tmvar2, tmvar3, tmvar4, tmvar5, tmvar6;
|
111 |
|
|
TMVA::Reader* reader;
|
112 |
|
|
|
113 |
|
|
|
114 |
|
|
TMVA::Reader *readervtx;
|
115 |
|
|
TMVA::Reader *readerevt;
|
116 |
|
|
mutable Float_t fMvaPVars[5];
|
117 |
|
|
mutable Float_t fMvaPEvtVars[8];
|
118 |
|
|
|
119 |
bendavid |
1.9 |
TString fVtxProbMvaName;
|
120 |
|
|
|
121 |
bendavid |
1.1 |
ClassDef(VertexTools, 0) // Muon tools
|
122 |
maxi |
1.2 |
};
|
123 |
bendavid |
1.1 |
}
|
124 |
|
|
|
125 |
|
|
#endif
|