ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitHzz4l/Angles/src/makeMELATree.cc
Revision: 1.3
Committed: Tue Oct 23 10:11:47 2012 UTC (12 years, 6 months ago) by dkralph
Content type: text/plain
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +0 -0 lines
State: FILE REMOVED
Log Message:
no longer used

File Contents

# User Rev Content
1 khahn 1.1 #include "TFile.h"
2     #include "TTree.h"
3    
4     #include "KinematicsStruct.h"
5     #include "WeightStruct.h"
6     #include "Angles.h"
7    
8     #include <iostream>
9     #include <assert.h>
10    
11     using namespace std;
12    
13     int main(int argc, char ** argv) {
14    
15     assert(argc == 3);
16     const char * ifname = argv[1];
17     const char * ofname = argv[2];
18    
19     TFile * f = new TFile(ifname);
20     TTree * t = (TTree*)(f->Get("zznt"));
21     KinematicsStruct kin;
22     WeightStruct weights;
23     Angles angles;
24     float bdt;
25     t->SetBranchAddress("kinematics", &kin);
26     t->SetBranchAddress("weights", &weights);
27     t->SetBranchAddress("angles", &angles);
28     t->SetBranchAddress("BDT", &bdt );
29    
30     TFile * ff = new TFile(ofname, "RECREATE");
31     TTree * nt = new TTree("angles", "angles");
32    
33     unsigned channel;
34     double d_ZZpt, d_ZZy;
35     double d_mZ1, d_mZ2, d_m4l;
36     double d_costheta1, d_costheta2, d_costhetastar;
37     double d_Phi, d_Phi1;
38     double d_w, d_won, d_woff;
39    
40     nt->Branch("channel", &channel);
41 khahn 1.2 // nt->Branch("ZZpt", &d_ZZpt);
42     // nt->Branch("ZZrapidity", &d_ZZy);
43    
44 khahn 1.1 nt->Branch("costheta1", &d_costheta1);
45     nt->Branch("costheta2", &d_costheta2);
46     nt->Branch("costhetastar", &d_costhetastar);
47     nt->Branch("phi", &d_Phi);
48     nt->Branch("phistar1", &d_Phi1);
49 khahn 1.2 nt->Branch("mZ2", &d_mZ1);
50     nt->Branch("mZ2", &d_mZ2);
51     nt->Branch("m4l", &d_m4l);
52     // nt->Branch("BDT", &bdt);
53     // nt->Branch("w", &d_w);
54     // nt->Branch("won", &d_won);
55     // nt->Branch("woff", &d_woff);
56 khahn 1.1
57     for( int i=0; i<t->GetEntries(); i++ ) {
58    
59     if( !(i%10000) ) cout << "processed: " << i << endl;
60     t->GetEntry(i);
61    
62 khahn 1.2 // channel = kin.channel;
63 khahn 1.1 d_mZ1 = kin.mZ1;
64     d_mZ2 = kin.mZ2;
65     d_m4l = kin.m4l;
66 khahn 1.2 // d_ZZpt = kin.ZZpt;
67     // d_ZZy = kin.ZZy;
68 khahn 1.1 d_costheta1 = angles.costheta1;
69     d_costheta2 = angles.costheta2;
70     d_costhetastar = angles.costhetastar;
71     d_Phi = angles.Phi;
72     d_Phi1 = angles.Phi1;
73 khahn 1.2 // d_w = weights.w;
74     // d_won = weights.won;
75     // d_woff = weights.woff;
76 khahn 1.1 nt->Fill();
77     }
78    
79     nt->Write();
80     ff->Close();
81    
82     }