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.5 by kiesel, Tue Apr 9 07:28:02 2013 UTC vs.
Revision 1.6 by kiesel, Tue Apr 9 08:24:40 2013 UTC

# Line 7 | Line 7
7  
8   using namespace std;
9  
10 < TreeWriter::TreeWriter(TString inputName, TString outputName) {
10 > TreeWriter::TreeWriter(TString inputName, TString outputName, int loggingVerbosity_ ) {
11          // read the input file
12        //TFile *inputFile = TFile::Open( inputName, "read" );
12          inputTree = new TChain("susyTree");
13 +        if (loggingVerbosity_ > 0)
14 +                std::cout << "Add files to chain" << std::endl;
15          inputTree->Add( inputName );
16  
17 +        if (loggingVerbosity_ > 0)
18 +                std::cout << "Set Branch Address of susy::Event" << std::endl;
19          event = new susy::Event;
20          inputTree->SetBranchAddress("susyEvent", &event);
21  
# Line 23 | Line 26 | TreeWriter::TreeWriter(TString inputName
26          // set default parameter
27          processNEvents = -1;
28          reportEvery = 1000;
29 <        loggingVerbosity = 0;
29 >        loggingVerbosity = loggingVerbosity_;
30          skim = true;
31  
32   }
# Line 88 | Line 91 | float TreeWriter::getPtFromMatchedJet( s
91          }
92  
93          // testing
94 <        if( nearJets.size() > 1 )
94 >        if( nearJets.size() > 1 && loggingVerbosity > 0 )
95                  std::cout << "There are several jets matching to this photon. "
96 <                                        << "Please check if the upper assumtion is reasonable" << std::endl;
96 >                                        << "Please check if jet-matching is correct." << std::endl;
97          return pt;
98   }
99  
# Line 130 | Line 133 | void TreeWriter::Loop() {
133  
134                  // photons
135                  if( loggingVerbosity > 1 )
136 <                        std::cout << std::endl << "Process photons" << std::endl;
136 >                        std::cout << "Process photons" << std::endl;
137                  std::map<TString, std::vector<susy::Photon> >::iterator phoMap = event->photons.find("photons");
138                  for(std::vector<susy::Photon>::iterator it = phoMap->second.begin();
139                                  it != phoMap->second.end() && phoMap != event->photons.end(); it++ ) {
# Line 153 | Line 156 | void TreeWriter::Loop() {
156                          photon.push_back( *thisphoton );
157                          ht += thisphoton->pt;
158                          if( loggingVerbosity > 2 )
159 <                                std::cout << " photonpt = " << thisphoton->pt << std::endl;
159 >                                std::cout << " p_T, gamma = " << thisphoton->pt << std::endl;
160                  }
161  
162                  if( photon.size() == 0 && skim )

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines