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 |
|
|
26 |
|
// set default parameter |
27 |
|
processNEvents = -1; |
28 |
|
reportEvery = 1000; |
29 |
< |
loggingVerbosity = 0; |
29 |
> |
loggingVerbosity = loggingVerbosity_; |
30 |
|
skim = true; |
31 |
|
|
32 |
|
} |
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 |
|
|
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++ ) { |
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 ) |