ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/kiesel/TreeWriter/treeWriter.h
Revision: 1.5
Committed: Mon Apr 15 09:02:50 2013 UTC (12 years ago) by kiesel
Content type: text/plain
Branch: MAIN
Changes since 1.4: +2 -0 lines
Log Message:
added second constructon function to handle input TChains

File Contents

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