-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakeTree.C
More file actions
30 lines (28 loc) · 908 Bytes
/
makeTree.C
File metadata and controls
30 lines (28 loc) · 908 Bytes
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
TTree* makeTree() {
TTree* tree;
std::string isSignal = "isSignal";
std::string jetPt = "jetPt";
std::string jetEta = "jetEta";
std::string jetPhi = "jetPhi";
std::string delim = ":";
std::string varType = "/D";
std::string branchDescriptor =
isSignal + varType + delim +
jetPt + delim +
jetEta + delim +
jetPhi + delim;
char buffer[256];
//std::cout << branchDescriptor << std::endl;
for(int i=0; i!=200; ++i) {
if(i!=199)
sprintf (buffer,"relPt%i%sdEta%i%sdPhi%i%s",i,delim.c_str(),i,delim.c_str(),i,delim.c_str());
else
sprintf (buffer,"relPt%i%sdEta%i%sdPhi%i",i,delim.c_str(),i,delim.c_str(),i);
string tempString(buffer);
branchDescriptor = branchDescriptor + tempString;
}
std::cout << branchDescriptor << std::endl;
tree = new TTree("jets","Jets");
tree->ReadFile("mixed_new.txt",branchDescriptor.c_str());
return tree;
}