ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/kiesel/TreeWriter/treeWriter.cc
(Generate patch)

Comparing UserCode/kiesel/TreeWriter/treeWriter.cc (file contents):
Revision 1.2 by kiesel, Wed Mar 20 11:04:30 2013 UTC vs.
Revision 1.3 by kiesel, Thu Mar 21 09:01:14 2013 UTC

# Line 3 | Line 3
3   #include "TFile.h"
4   #include "TTree.h"
5   #include "TString.h"
6 #include "TLorentzVector.h"
6  
7   #include "SusyEvent.h"
8 + #include "TreeObjects.h"
9  
10  
11 namespace tree {
12 // In this namespace classes for the trees are defined.
13
14 class Particle {
15        public:
16                float pt, eta, phi;
17 };
18
19 class Photon : public Particle {
20        public:
21                float r9, sigmaIetaIeta, hadTowOverEm, pixelseed;
22                float chargedIso, neutralIso, photonIso;
23 };
24
25 class Jet : public Particle{
26        public:
27                float pt, eta;
28 };
29
30 bool EtGreater(const tree::Particle p1, const tree::Particle p2) {
31  return p1.pt > p2.pt;
32 }
33
34 } // end namespace definition
35
11   class TreeWriter {
12          public :
13                  TreeWriter(TString inputName, TString outputName );
# Line 60 | Line 35 | class TreeWriter {
35                  float met;
36                  int nVertex;
37                  float weight;
38 +                float leadingPhotonPt;
39   };
40  
41  
# Line 106 | Line 82 | void TreeWriter::Loop() {
82          tree->Branch("met", &met, "met/F");
83          tree->Branch("nVertex", &nVertex, "nVertex/I");
84          tree->Branch("weigth", &weight, "weight/F");
85 +        tree->Branch("photonPt", &leadingPhotonPt, "photonPt/F");
86  
87  
88          for (long jentry=0; jentry < processNEvents; jentry++) {
# Line 140 | Line 117 | void TreeWriter::Loop() {
117                  if( photon.size() == 0 )
118                          continue;
119                  std::sort( photon.begin(), photon.end(), tree::EtGreater);
120 +                //leadingPhotonPt = photon.at(0)->pt;
121  
122  
123                  // jets
# Line 191 | Line 169 | void TreeWriter::Loop() {
169          outFile->Write();
170          outFile->Close();
171   }
172 < /*
172 >
173   int main(int argc, char** argv) {
174          TreeWriter *tw = new TreeWriter("qcd-1000-nTuple-test.root", "myQCDTree.root");
175          tw->SetProcessNEvents(10);
176          tw->Loop();
177   }
178 < */
178 >

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines