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.1 by kiesel, Wed Mar 20 09:58:55 2013 UTC vs.
Revision 1.13 by kiesel, Tue Apr 16 18:53:55 2013 UTC

# Line 1 | Line 1
1 < #include "TFile.h"
2 < #include "TTree.h"
3 < #include "TString.h"
4 < #include "TLorentzVector.h"
1 > #include<iostream>
2 > #include<math.h>
3 > #include<string>
4  
5 < #include "SusyEvent.h"
5 > #include "TSystem.h"
6  
7 + #include "treeWriter.h"
8  
9 < namespace tree {
10 < // In this namespace classes for the trees are defined.
9 > using namespace std;
10  
11 < class Particle {
12 <        public:
13 <                float pt, eta, phi;
14 < };
15 <
16 < class Photon : public Particle {
17 <        public:
19 <                float r9, sigmaIetaIeta, hadTowOverEm, pixelseed;
20 <                float chargedIso, neutralIso, photonIso;
21 < };
22 <
23 < class Jet : public Particle{
24 <        public:
25 <                float pt, eta;
26 < };
27 <
28 < bool EtGreater(const tree::Particle p1, const tree::Particle p2) {
29 <  return p1.pt > p2.pt;
11 > TreeWriter::TreeWriter( TString inputName, TString outputName, int loggingVerbosity_ ) {
12 >        // read the input file
13 >        inputTree = new TChain("susyTree");
14 >        if (loggingVerbosity_ > 0)
15 >                std::cout << "Add files to chain" << std::endl;
16 >        inputTree->Add( inputName );
17 >        Init( outputName, loggingVerbosity_ );
18   }
19  
20 < } // end namespace definition
21 <
22 < class TreeWriter {
23 <        public :
36 <                TreeWriter(TString inputName, TString outputName );
37 <                virtual ~TreeWriter();
38 <                virtual void Loop();
39 <
40 <                void SetProcessNEvents(int nEvents) { processNEvents = nEvents; }
41 <                void SetReportEvents(int nEvents) { reportEvery = nEvents; }
42 <
43 <                TFile *inputFile;
44 <                TTree *inputTree;
45 <                susy::Event *event;
46 <
47 <                TFile *outFile;
48 <                TTree *tree;
49 <
50 <        private:
51 <                int processNEvents; // number of events to be processed
52 <                int reportEvery;
53 <                int loggingVerbosity;
20 > TreeWriter::TreeWriter( TChain* inputTree_, TString outputName, int loggingVerbosity_ ) {
21 >        inputTree = inputTree_;
22 >        Init( outputName, loggingVerbosity_ );
23 > }
24  
55                // variables which will be stored in the tree
56                std::vector<tree::Photon> photon;
57                std::vector<tree::Jet> jet;
58                float met;
59                int nVertex;
60                float weight;
61 };
25  
26 + void TreeWriter::Init( TString outputName, int loggingVerbosity_ ) {
27  
28 < TreeWriter::TreeWriter(TString inputName, TString outputName) {
29 <        // read the input file
66 <        inputFile = new TFile( inputName, "read" );
67 <        inputTree = (TTree*) inputFile->Get("susyTree");
28 >        if (loggingVerbosity_ > 0)
29 >                std::cout << "Set Branch Address of susy::Event" << std::endl;
30          event = new susy::Event;
31          inputTree->SetBranchAddress("susyEvent", &event);
32  
33          // open the output file
34 +        if (loggingVerbosity_>0)
35 +                std::cout << "Open file " << outputName << " for writing." << std::endl;
36          outFile = new TFile( outputName, "recreate" );
37          tree = new TTree("susyTree","Tree for single photon analysis");
38  
39          // set default parameter
40          processNEvents = -1;
41          reportEvery = 1000;
42 <        loggingVerbosity = 0;
42 >        loggingVerbosity = loggingVerbosity_;
43 >        skim = true;
44 >        pileupHisto = 0;
45 > }
46  
47 + void TreeWriter::PileUpWeightFile( string pileupFileName ) {
48 +        TFile *puFile = new TFile( pileupFileName.c_str() );
49 +        pileupHisto = (TH1F*) puFile->Get("pileup");
50   }
51  
52   TreeWriter::~TreeWriter() {
53 <        if (!inputTree) return;
54 <        delete inputTree->GetCurrentFile();
53 >        if (pileupHisto != 0 )
54 >                delete pileupHisto;
55 >        inputTree->GetCurrentFile()->Close();
56 > }
57 >
58 > // useful functions
59 > float TreeWriter::deltaR( TLorentzVector v1, TLorentzVector v2 ) {
60 >        return sqrt(pow(v1.Eta() - v2.Eta(), 2) + pow(v1.Phi() - v2.Phi(), 2) );
61 > }
62 >
63 > float effectiveAreaElectron( float eta ) {
64 >        // see https://twiki.cern.ch/twiki/bin/view/CMS/EgammaEARhoCorrection
65 >        // only for Delta R = 0.3 on 2012 Data
66 >        eta = fabs( eta );
67 >        float ea;
68 >        if( eta < 1.0 ) ea = 0.13;
69 >        else if( eta < 1.479 ) ea = 0.14;
70 >        else if( eta < 2.0 ) ea = 0.07;
71 >        else if( eta < 2.2 ) ea = 0.09;
72 >        else if( eta < 2.3 ) ea = 0.11;
73 >        else if( eta < 2.4 ) ea = 0.11;
74 >        else ea = 0.14;
75 >        return ea;
76 > }
77 >
78 > // correct iso, see https://twiki.cern.ch/twiki/bin/view/CMS/CutBasedPhotonID2012
79 > float chargedHadronIso_corrected(susy::Photon gamma, float rho) {
80 >        float eta = fabs(gamma.caloPosition.Eta());
81 >        float ea;
82 >
83 >        if(eta < 1.0) ea = 0.012;
84 >        else if(eta < 1.479) ea = 0.010;
85 >        else if(eta < 2.0) ea = 0.014;
86 >        else if(eta < 2.2) ea = 0.012;
87 >        else if(eta < 2.3) ea = 0.016;
88 >        else if(eta < 2.4) ea = 0.020;
89 >        else ea = 0.012;
90 >
91 >        float iso = gamma.chargedHadronIso;
92 >        iso = max(iso - rho*ea, (float)0.);
93 >
94 >        return iso;
95 > }
96 >
97 > float neutralHadronIso_corrected(susy::Photon gamma, float rho) {
98 >        float eta = fabs(gamma.caloPosition.Eta());
99 >        float ea;
100 >
101 >        if(eta < 1.0) ea = 0.030;
102 >        else if(eta < 1.479) ea = 0.057;
103 >        else if(eta < 2.0) ea = 0.039;
104 >        else if(eta < 2.2) ea = 0.015;
105 >        else if(eta < 2.3) ea = 0.024;
106 >        else if(eta < 2.4) ea = 0.039;
107 >        else ea = 0.072;
108 >
109 >        float iso = gamma.neutralHadronIso;
110 >        iso = max(iso - rho*ea, (float)0.);
111 >
112 >        return iso;
113 > }
114 >
115 > float photonIso_corrected(susy::Photon gamma, float rho) {
116 >        float eta = fabs(gamma.caloPosition.Eta());
117 >        float ea;
118 >
119 >        if(eta < 1.0) ea = 0.148;
120 >        else if(eta < 1.479) ea = 0.130;
121 >        else if(eta < 2.0) ea = 0.112;
122 >        else if(eta < 2.2) ea = 0.216;
123 >        else if(eta < 2.3) ea = 0.262;
124 >        else if(eta < 2.4) ea = 0.260;
125 >        else ea = 0.266;
126 >
127 >        float iso = gamma.photonIso;
128 >        iso = max(iso - rho*ea, (float)0.);
129 >
130 >        return iso;
131 > }
132 >
133 > float TreeWriter::getPtFromMatchedJet( susy::Photon myPhoton, susy::Event myEvent ) {
134 >        /**
135 >         * \brief Takes jet p_T as photon p_T
136 >         *
137 >         * At first all jets with DeltaR < 0.3 (isolation cone) are searched.
138 >         * If several jets are found, take the one with the minimal pt difference
139 >         * compared to the photon. If no such jets are found, keep the photon_pt
140 >         * TODO: remove photon matched jet from jet-selection?
141 >         */
142 >        std::vector<susy::PFJet> nearJets;
143 >        nearJets.clear();
144 >
145 >        std::map<TString,susy::PFJetCollection>::iterator pfJets_it = myEvent.pfJets.find("ak5");
146 >        if(pfJets_it == myEvent.pfJets.end()){
147 >                if(myEvent.pfJets.size() > 0) std::cout << "JetCollection is not available!!!" << std::endl;
148 >        } else {
149 >                susy::PFJetCollection& jetColl = pfJets_it->second;
150 >                for(std::vector<susy::PFJet>::iterator it = jetColl.begin();
151 >                                it != jetColl.end(); ++it) {
152 >                        std::map<TString,Float_t>::iterator s_it = it->jecScaleFactors.find("L2L3");
153 >                        if (s_it == it->jecScaleFactors.end()) {
154 >                                std::cout << "JEC is not available for this jet!!!" << std::endl;
155 >                                continue;
156 >                        }
157 >                        float scale = s_it->second;
158 >                        TLorentzVector corrP4 = scale * it->momentum;
159 >                        float deltaR_ = deltaR(myPhoton.momentum, corrP4 );
160 >                        if (deltaR_ > 0.3) continue;
161 >                        if( loggingVerbosity > 0 )
162 >                                std::cout << "gamma pt jet matching factor = " << it->momentum.Et() / myPhoton.momentum.Et() << std::endl;
163 >                        nearJets.push_back( *it );
164 >                }// for jet
165 >        }// if, else
166 >
167 >        if ( nearJets.size() == 0 ) {
168 >                if( loggingVerbosity > 1 )
169 >                        std::cout << "No jet with deltaR < .3 found, do not change photon_pt" << std::endl;
170 >                return myPhoton.momentum.Et();
171 >        }
172 >
173 >        float pt = 0;
174 >        float minPtDifferenz = 1E20; // should be very high
175 >        for( std::vector<susy::PFJet>::iterator it = nearJets.begin(), jetEnd = nearJets.end();
176 >                        it != jetEnd; ++it ) {
177 >                float ptDiff = fabs(myPhoton.momentum.Et() - it->momentum.Et());
178 >                if (  ptDiff < minPtDifferenz ) {
179 >                        minPtDifferenz = ptDiff;
180 >                        pt = it->momentum.Et();
181 >                }
182 >        }
183 >
184 >        // testing
185 >        if( nearJets.size() > 1 && loggingVerbosity > 0 )
186 >                std::cout << "There are several jets matching to this photon. "
187 >                                        << "Please check if jet-matching is correct." << std::endl;
188 >        return pt;
189   }
190  
191 +
192   void TreeWriter::Loop() {
193 +
194          // here the event loop is implemented and the tree is filled
195          if (inputTree == 0) return;
196  
# Line 101 | Line 207 | void TreeWriter::Loop() {
207  
208          tree->Branch("photon", &photon);
209          tree->Branch("jet", &jet);
210 +        tree->Branch("electron", &electron);
211 +        tree->Branch("muon", &muon);
212          tree->Branch("met", &met, "met/F");
213 +        tree->Branch("metPhi", &met_phi, "metPhi/F");
214 +        tree->Branch("type1met", &type1met, "type1met/F");
215 +        tree->Branch("type1metPhi", &type1met_phi, "type1metPhi/F");
216 +        tree->Branch("ht", &ht, "ht/F");
217          tree->Branch("nVertex", &nVertex, "nVertex/I");
218 <        tree->Branch("weigth", &weight, "weight/F");
218 >        tree->Branch("pu_weight", &pu_weight, "pu_weight/F");
219  
220  
221 <        for (long jentry=0; jentry < processNEvents; jentry++) {
222 <                if (jentry%reportEvery==0)
221 >        for (long jentry=0; jentry < processNEvents; ++jentry) {
222 >                if ( loggingVerbosity>0 && jentry%reportEvery==0 )
223                          std::cout << jentry << " / " << processNEvents << std :: endl;
224                  inputTree->GetEntry(jentry);
225  
226                  photon.clear();
227                  jet.clear();
228 +                electron.clear();
229 +                muon.clear();
230 +                ht = 0;
231 +
232 +                // weights
233 +                if (pileupHisto == 0) {
234 +                        pu_weight = 1.;
235 +                } else {
236 +                        float trueNumInteractions = -1;
237 +                        for( susy::PUSummaryInfoCollection::const_iterator iBX = event->pu.begin();
238 +                                        iBX != event->pu.end() && trueNumInteractions < 0; ++iBX) {
239 +                                if (iBX->BX == 0)
240 +                                        trueNumInteractions = iBX->trueNumInteractions;
241 +                        }
242 +                        pu_weight = pileupHisto->GetBinContent( pileupHisto->FindBin( trueNumInteractions ) );
243 +                }
244 +
245  
246                  // photons
247 +                if( loggingVerbosity > 1 )
248 +                        std::cout << "Process photons" << std::endl;
249                  std::map<TString, std::vector<susy::Photon> >::iterator phoMap = event->photons.find("photons");
250                  for(std::vector<susy::Photon>::iterator it = phoMap->second.begin();
251 <                                it != phoMap->second.end() && phoMap != event->photons.end(); it++ ) {
252 <                        if( ! it->isEB() )
251 >                                it != phoMap->second.end() && phoMap != event->photons.end(); ++it ) {
252 >                        if( !(it->isEB() || it->isEE()) && skim )
253                                  continue;
254 <                        thisphoton->pt = it->momentum.Et();
255 <                        if( thisphoton->pt < 80 )
254 >                        thisphoton->pt = getPtFromMatchedJet( *it, *event );
255 >
256 >                        thisphoton->chargedIso = chargedHadronIso_corrected(*it, event->rho25);
257 >                        thisphoton->neutralIso = neutralHadronIso_corrected(*it, event->rho25);
258 >                        thisphoton->photonIso = photonIso_corrected(*it, event->rho25);
259 >
260 >                        bool loose_photon_barrel = thisphoton->pt>20
261 >                                && it->isEB()
262 >                                && it->passelectronveto
263 >                                && it->hadTowOverEm<0.05
264 >                                && it->sigmaIetaIeta<0.012
265 >                                && thisphoton->chargedIso<2.6
266 >                                && thisphoton->neutralIso<3.5+0.04*thisphoton->pt
267 >                                && thisphoton->photonIso<1.3+0.005*thisphoton->pt;
268 >                        bool loose_photon_endcap = thisphoton->pt > 20
269 >                                && it->isEE()
270 >                                && it->passelectronveto
271 >                                && it->hadTowOverEm<0.05
272 >                                && it->sigmaIetaIeta<0.034
273 >                                && thisphoton->chargedIso<2.3
274 >                                && thisphoton->neutralIso<2.9+0.04*thisphoton->pt;
275 >                        if(!(loose_photon_endcap || loose_photon_barrel || thisphoton->pt > 75 ) && skim )
276                                  continue;
277                          thisphoton->eta = it->momentum.Eta();
278 <                        thisphoton->chargedIso = it->chargedHadronIso;
128 <                        thisphoton->neutralIso = it->neutralHadronIso;
129 <                        thisphoton->photonIso = it->photonIso;
130 <                        if ( it->r9 > 1 ) // if == 1 ?
131 <                                continue;
278 >                        thisphoton->phi = it->momentum.Phi();
279                          thisphoton->r9 = it->r9;
280                          thisphoton->sigmaIetaIeta = it->sigmaIetaIeta;
281                          thisphoton->hadTowOverEm = it->hadTowOverEm;
282                          thisphoton->pixelseed = it->nPixelSeeds;
283 +                        thisphoton->conversionSafeVeto = it->passelectronveto;
284                          photon.push_back( *thisphoton );
285 +                        if( loggingVerbosity > 2 )
286 +                                std::cout << " p_T, gamma = " << thisphoton->pt << std::endl;
287                  }
288 <                if( photon.size() == 0 )
288 >
289 >                if( photon.size() == 0 && skim )
290                          continue;
291                  std::sort( photon.begin(), photon.end(), tree::EtGreater);
292 <
292 >                if( loggingVerbosity > 1 )
293 >                        std::cout << "Found " << photon.size() << " photons" << std::endl;
294  
295                  // jets
296                  std::map<TString,susy::PFJetCollection>::iterator pfJets_it = event->pfJets.find("ak5");
# Line 149 | Line 301 | void TreeWriter::Loop() {
301                          susy::PFJetCollection& jetColl = pfJets_it->second;
302  
303                          for(std::vector<susy::PFJet>::iterator it = jetColl.begin();
304 <                                        it != jetColl.end(); it++) {
304 >                                        it != jetColl.end(); ++it) {
305                                  std::map<TString,Float_t>::iterator s_it = it->jecScaleFactors.find("L2L3");
306                                  if (s_it == it->jecScaleFactors.end()) {
307                                          std::cout << "JEC is not available for this jet!!!" << std::endl;
# Line 158 | Line 310 | void TreeWriter::Loop() {
310                                  float scale = s_it->second;
311                                  TLorentzVector corrP4 = scale * it->momentum;
312  
313 <                                if(std::abs(corrP4.Eta()) > 3.0) continue;
313 >                                if(std::abs(corrP4.Eta()) > 3.0 && skim ) continue;
314 >                                if(corrP4.Et() < 30 && skim ) continue;
315                                  thisjet->pt = corrP4.Et();
316                                  thisjet->eta = corrP4.Eta();
317 +                                thisjet->phi = corrP4.Phi();
318 +                                thisjet->bCSV = it->bTagDiscriminators[susy::kCSV];
319 +                                // jet composition
320 +                                thisjet->chargedHadronEnergy = it->chargedHadronEnergy;
321 +                                thisjet->neutralHadronEnergy = it->neutralHadronEnergy;
322 +                                thisjet->photonEnergy = it->photonEnergy;
323 +                                thisjet->electronEnergy = it->electronEnergy;
324 +                                thisjet->muonEnergy = it->muonEnergy;
325 +                                thisjet->HFHadronEnergy = it->HFHadronEnergy;
326 +                                thisjet->HFEMEnergy = it->HFEMEnergy;
327 +                                thisjet->chargedEmEnergy = it->chargedEmEnergy;
328 +                                thisjet->chargedMuEnergy = it->chargedMuEnergy;
329 +                                thisjet->neutralEmEnergy = it->neutralEmEnergy;
330 +
331 +                                if( loggingVerbosity > 2 )
332 +                                        std::cout << " p_T, jet = " << thisjet->pt << std::endl;
333 +
334                                  jet.push_back( *thisjet );
335 +                                ht += thisjet->pt;
336                          }// for jet
337                  }// if, else
338 <                if( jet.size() == 0 )
339 <                        std::cout << "error, no jets found " << std::endl;
340 <                else
341 <                        std::sort( jet.begin(), jet.end(), tree::EtGreater);
338 >                if( jet.size() < 2 && skim )
339 >                        continue;
340 >                std::sort( jet.begin(), jet.end(), tree::EtGreater);
341 >                if( loggingVerbosity > 1 )
342 >                        std::cout << "Found " << jet.size() << " jets" << std::endl;
343 >
344  
345                  // met
346                  std::map<TString, susy::MET>::iterator met_it = event->metMap.find("pfMet");
347                  susy::MET* metobj = &(met_it->second);
348                  met = metobj->met();
349 +                met_phi = metobj->mEt.Phi();
350 +                if( loggingVerbosity > 2 )
351 +                        std::cout << " met = " << met << std::endl;
352 +
353 +                std::map<TString, susy::MET>::iterator type1met_it = event->metMap.find("pfType1CorrectedMet");
354 +                susy::MET* type1metobj = &(type1met_it->second);
355 +                type1met = type1metobj->met();
356 +                type1met_phi = type1metobj->mEt.Phi();
357 +                if( loggingVerbosity > 2 )
358 +                        std::cout << " type1met = " << type1met << std::endl;
359 +
360 +                // electrons
361 +                tree::Particle* thiselectron = new tree::Particle();
362 +                map<TString, vector<susy::Electron> >::iterator eleMap = event->electrons.find("gsfElectrons");
363 +                if(eleMap == event->electrons.end() && loggingVerbosity > 0) {
364 +                        cout << "gsfElectrons not found!" << endl;
365 +                } else {
366 +                        for(vector<susy::Electron>::iterator it = eleMap->second.begin(); it < eleMap->second.end(); ++it) {
367 +                                // for cuts see https://twiki.cern.ch/twiki/bin/viewauth/CMS/EgammaCutBasedIdentification
368 +                                if( loggingVerbosity > 0)
369 +                                        std::cout << "TODO: piAtVtx is not calculated correctly" << std::endl;
370 +                                //float pAtVtx = it->trackMomentums.find("AtVtxWithConstraint")->second.P();
371 +                                float pAtVtx = it->ecalEnergy;
372 +                                if( it->momentum.Pt() < 1  || it->momentum.Pt() > 1e6 || pAtVtx == 0 )
373 +                                        continue;
374 +                                float iso = ( it->chargedHadronIso + max(it->neutralHadronIso+it->photonIso
375 +                                                                                                                        - effectiveAreaElectron(it->momentum.Eta())*event->rho25, (Float_t)0. )
376 +                                                        ) / it->momentum.Pt();
377 +                                if ( it->isEE() ){
378 +                                        if ( fabs(it->deltaEtaSuperClusterTrackAtVtx) > 0.007
379 +                                                        || fabs(it->deltaPhiSuperClusterTrackAtVtx) > 0.15
380 +                                                        || it->sigmaIetaIeta > 0.01
381 +                                                        || it->hcalOverEcalBc > 0.12
382 +                                                        || it->vertex.Perp() > 0.02
383 +                                                        || it->vertex.Z() > 0.2
384 +                                                        || fabs(1./it->ecalEnergy - 1./pAtVtx ) > 0.05
385 +                                                        || iso > 0.15 )
386 +                                                continue;
387 +                                        }
388 +                                else if( it->isEB() ) {
389 +                                        if ( fabs(it->deltaEtaSuperClusterTrackAtVtx) > 0.009
390 +                                                        || fabs(it->deltaPhiSuperClusterTrackAtVtx) > 0.10
391 +                                                        || it->sigmaIetaIeta > 0.03
392 +                                                        || it->hcalOverEcalBc > 0.10
393 +                                                        || it->vertex.Perp() > 0.02
394 +                                                        || it->vertex.Z() > 0.2
395 +                                                        || fabs(1./it->ecalEnergy - 1./pAtVtx) > 0.05
396 +                                                        || iso > 0.15 )
397 +                                                continue;
398 +                                        }
399 +                                else // not in barrel nor in endcap
400 +                                        continue;
401 +                                // TODO: conversion rejection information not implemented yet, see twiki for more details
402 +
403 +                                thiselectron->pt = it->momentum.Pt();
404 +                                if( thiselectron->pt < 20 )
405 +                                        continue;
406 +                                if( loggingVerbosity > 2 )
407 +                                        std::cout << " p_T, electron = " << it->momentum.Et() << std::endl;
408 +                                thiselectron->eta = it->momentum.Eta();
409 +                                thiselectron->phi = it->momentum.Phi();
410 +                                electron.push_back( *thiselectron );
411 +                        }
412 +                }
413 +                if( loggingVerbosity > 1 )
414 +                        std::cout << "Found " << electron.size() << " electrons" << std::endl;
415 +
416 +                // muons
417 +                std::vector<susy::Muon> mVector = event->muons["muons"];
418 +                tree::Particle* thismuon = new tree::Particle();
419 +                for( std::vector<susy::Muon>::iterator it = mVector.begin(); it != mVector.end(); ++it) {
420 +                        if( !( it->isPFMuon() && ( it->isGlobalMuon() || it->isTrackerMuon() ) ) )
421 +                                continue; // see https://twiki.cern.ch/twiki/bin/view/CMSPublic/SWGuideMuonId#Loose_Muon
422 +                        thismuon->pt = it->momentum.Et();
423 +                        if( thismuon->pt < 20 )
424 +                                continue;
425 +                        thismuon->eta = it->momentum.Eta();
426 +                        thismuon->phi = it->momentum.Phi();
427 +                        muon.push_back( *thismuon );
428 +                }
429 +                if( loggingVerbosity > 1 )
430 +                        std::cout << "Found " << muon.size() << " muons" << std::endl;
431  
177                // vertices
432  
433 +                // vertices
434                  nVertex = event->vertices.size();
435 <                weight = 1;
435 >
436 >                if( ht < 450 && skim)
437 >                        continue;
438  
439                  tree->Fill();
440          } // for jentry
441  
442  
186
187        tree->Write();
443          outFile->cd();
444 +        tree->Write();
445          outFile->Write();
446          outFile->Close();
447   }
448 < /*
193 < int main(int argc, char** argv) {
194 <        TreeWriter *tw = new TreeWriter("qcd-1000-nTuple-test.root", "myQCDTree.root");
195 <        tw->SetProcessNEvents(10);
196 <        tw->Loop();
197 < }
198 < */
448 >

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines