1 |
|
#include<iostream> |
2 |
|
#include<math.h> |
3 |
+ |
#include<string> |
4 |
|
|
5 |
+ |
#include "TSystem.h" |
6 |
|
#include "TFile.h" |
7 |
|
#include "TTree.h" |
8 |
|
#include "TChain.h" |
9 |
< |
#include "TString.h" |
9 |
> |
#include "TH1F.h" |
10 |
|
|
11 |
|
#include "SusyEvent.h" |
12 |
|
#include "TreeObjects.h" |
13 |
|
|
14 |
|
class TreeWriter { |
15 |
|
public : |
16 |
< |
TreeWriter(TString inputName, TString outputName, int loggingVerbosity_ ); |
16 |
> |
TreeWriter(std::string inputName, std::string outputName, int loggingVerbosity_); |
17 |
> |
TreeWriter(TChain* inputName, std::string outputName, int loggingVerbosity_); |
18 |
> |
void Init( std::string outputName, int loggingVerbosity_ ); |
19 |
|
virtual ~TreeWriter(); |
20 |
|
virtual void Loop(); |
21 |
|
|
23 |
|
void SetReportEvents(int nEvents) { reportEvery = nEvents; } |
24 |
|
void SetLoggingVerbosity(int logVerb) { loggingVerbosity = logVerb; } |
25 |
|
void SkimEvents(bool skim_){ skim = skim_; } |
26 |
+ |
void PileUpWeightFile( std::string pileupFileName ); |
27 |
|
|
28 |
|
TChain *inputTree; |
29 |
|
susy::Event *event; |
30 |
|
|
31 |
|
TFile *outFile; |
32 |
|
TTree *tree; |
33 |
< |
|
29 |
< |
float getPtFromMatchedJet( susy::Photon, susy::Event ); |
30 |
< |
float deltaR( TLorentzVector, TLorentzVector ); |
33 |
> |
TH1F *eventNumbers; |
34 |
|
|
35 |
|
private: |
36 |
|
int processNEvents; // number of events to be processed |
38 |
|
int loggingVerbosity; |
39 |
|
bool skim; |
40 |
|
|
41 |
+ |
// important dataset information |
42 |
+ |
TH1F* pileupHisto; |
43 |
+ |
|
44 |
|
// variables which will be stored in the tree |
45 |
|
std::vector<tree::Photon> photon; |
46 |
|
std::vector<tree::Jet> jet; |
47 |
+ |
std::vector<tree::Particle> electron; |
48 |
+ |
std::vector<tree::Particle> muon; |
49 |
+ |
|
50 |
|
float met; |
51 |
+ |
float met_phi; |
52 |
+ |
float type1met; |
53 |
+ |
float type1met_phi; |
54 |
|
float ht; |
55 |
|
int nVertex; |
56 |
< |
int nElectron; |
56 |
> |
float pu_weight; |
57 |
|
}; |
58 |
|
|