-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMAReweight.C
57 lines (47 loc) · 1.54 KB
/
MAReweight.C
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
#include <algorithm>
#include <array>
#include <fstream>
#include <functional>
#include <memory>
#include <string>
#include <vector>
#include <iostream>
#include <cmath>
#include <TChain.h>
#include <TCanvas.h>
#include <TFile.h>
#include <TGraph.h>
#include <TH1.h>
#include <TH2.h>
#include <THStack.h>
#include <TF1.h>
#include <TLegend.h>
#include <TLine.h>
#include <TAxis.h>
#include <TSpline.h>
#include <TGraphAsymmErrors.h>
#include <TEfficiency.h>
const double Pi = 3.14159265358979323846; // Pi
void MAReweight()
{
size_t NumberOfBins = 20;
int TrkID;
float TrackTheta[5000];
double HistogramWeight;
TChain* Chain = new TChain("anatree");
Chain -> Add("/home/christoph/anatrees/CCInclusiveNote/Hist_Track_pandoraNu_Vertex_pandoraNu_MA_v05_08_00_Mod.root");
Chain -> SetBranchAddress("TrackCand", &TrkID);
Chain -> SetBranchAddress("trktheta_pandoraNu", TrackTheta);
Chain -> SetBranchAddress("eventWeight_MA", &HistogramWeight);
TH1F* SelectionTheta = new TH1F("#theta-Angle","#theta-Angle",NumberOfBins,0,180);
SelectionTheta -> SetStats(0);
SelectionTheta -> GetXaxis() -> SetTitle("Muon #theta-Angle [#circ]");
SelectionTheta -> GetYaxis() -> SetTitle("No. of events");
for(unsigned int tree_index = 0; tree_index < Chain -> GetEntries(); tree_index++)
{
Chain -> GetEntry(tree_index);
SelectionTheta -> Fill(TrackTheta[TrkID]/Pi*180, HistogramWeight);
// std::cout << HistogramWeight << std:: endl;
}
SelectionTheta -> Draw();
}