-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRedEleIDOptimTree.cc
More file actions
71 lines (59 loc) · 2 KB
/
RedEleIDOptimTree.cc
File metadata and controls
71 lines (59 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#include "HiggsAnalysisTools/include/RedEleIDOptimTree.hh"
// C++
#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <cmath>
// Root
#include "TFile.h"
#include "TTree.h"
RedEleIDOptimTree::RedEleIDOptimTree(const char * filename) {
myFile = new TFile(filename,"RECREATE");
myTree = new TTree("T1","eleID tree");
myTree->Branch("H_deltaEta", &myH_DeltaEta, "H_deltaEta/F");
myTree->Branch("H_deltaPhi", &myH_DeltaPhi, "H_deltaPhi/F");
myTree->Branch("H_hoe", &myH_Hoe, "H_hoe/F");
myTree->Branch("H_s9s25", &myH_S9s25, "H_s9s25/F");
myTree->Branch("H_see", &myH_See, "H_see/F");
myTree->Branch("H_eopOut", &myH_EopOut, "H_eopOut/F");
myTree->Branch("H_class", &myH_Class, "H_class/I");
myTree->Branch("L_deltaEta", &myL_DeltaEta, "L_deltaEta/F");
myTree->Branch("L_deltaPhi", &myL_DeltaPhi, "L_deltaPhi/F");
myTree->Branch("L_hoe", &myL_Hoe, "L_hoe/F");
myTree->Branch("L_s9s25", &myL_S9s25, "L_s9s25/F");
myTree->Branch("L_see", &myL_See, "L_see/F");
myTree->Branch("L_eopOut", &myL_EopOut, "L_eopOut/F");
myTree->Branch("L_class", &myL_Class, "L_class/I");
}
RedEleIDOptimTree::~RedEleIDOptimTree()
{
delete myFile;
}
void RedEleIDOptimTree::store()
{
myTree->Fill();
}
void RedEleIDOptimTree::save()
{
myFile->cd();
myTree->Write();
myFile->Close();
}
void RedEleIDOptimTree::fillAll(float fhdeta, float fhdphi, float fhhoe, float fhs9s25, float fhsee, float fheopout, int fhclass, float fldeta, float fldphi, float flhoe, float fls9s25, float flsee, float fleopout, int flclass)
{
myH_DeltaEta = fhdeta;
myH_DeltaPhi = fhdphi;
myH_Hoe = fhhoe;
myH_S9s25 = fhs9s25;
myH_See = fhsee;
myH_EopOut = fheopout;
myH_Class = fhclass;
myL_DeltaEta = fldeta;
myL_DeltaPhi = fldphi;
myL_Hoe = flhoe;
myL_S9s25 = fls9s25;
myL_See = flsee;
myL_EopOut = fleopout;
myL_Class = flclass;
}