Changes in converters/root2lhco.cpp [c3547ed:341014c] in git
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
converters/root2lhco.cpp
rc3547ed r341014c 17 17 */ 18 18 19 #include <fstream> 20 #include <iostream> 21 #include <sstream> 19 22 #include <stdexcept> 20 #include <iostream>21 #include <fstream>22 #include <sstream>23 23 #include <string> 24 24 25 #include <stdlib.h>26 25 #include <signal.h> 27 26 #include <stdio.h> 28 27 #include <stdlib.h> 28 29 #include "TApplication.h" 29 30 #include "TROOT.h" 30 #include "TApplication.h" 31 31 32 #include "TClonesArray.h" 32 33 #include "TFile.h" 33 #include "TClonesArray.h"34 34 35 35 #include "classes/DelphesClasses.h" 36 36 37 #include "ExRootAnalysis/ExRootProgressBar.h" 37 38 #include "ExRootAnalysis/ExRootTreeReader.h" 38 #include "ExRootAnalysis/ExRootProgressBar.h"39 39 40 40 using namespace std; … … 62 62 63 63 private: 64 65 64 void Reset(); 66 65 void Write(); … … 76 75 void AnalyseMissingET(); 77 76 78 enum {kIntParamSize = 2, kDblParamSize = 9}; 77 enum 78 { 79 kIntParamSize = 2, 80 kDblParamSize = 9 81 }; 79 82 Int_t fIntParam[kIntParamSize]; 80 83 Double_t fDblParam[kDblParamSize]; … … 132 135 fBranchMissingET = fTreeReader->UseBranch("MissingET"); 133 136 134 if(!fBranchEvent || !fBranchTrack || !fBranchTower || !fBranchPhoton || 135 !fBranchElectron || !fBranchMuon || !fBranchJet || !fBranchMissingET) 137 if(!fBranchEvent || !fBranchTrack || !fBranchTower || !fBranchPhoton || !fBranchElectron || !fBranchMuon || !fBranchJet || !fBranchMissingET) 136 138 { 137 139 throw runtime_error("ROOT file doesn't contain all required branches"); … … 202 204 Event *element; 203 205 204 element = static_cast<Event *>(fBranchEvent->At(0));206 element = static_cast<Event *>(fBranchEvent->At(0)); 205 207 206 208 fprintf(fOutputFile, "%4d %13lld %8d\n", 0, element->Number, 0); … … 216 218 217 219 fItPhoton->Reset(); 218 while((element = static_cast<Photon *>(fItPhoton->Next())))220 while((element = static_cast<Photon *>(fItPhoton->Next()))) 219 221 { 220 222 Reset(); … … 239 241 240 242 fItElectron->Reset(); 241 while((element = static_cast<Electron *>(fItElectron->Next())))243 while((element = static_cast<Electron *>(fItElectron->Next()))) 242 244 { 243 245 Reset(); … … 270 272 muonCounter = 0; 271 273 fItMuon->Reset(); 272 while((element = static_cast<Muon *>(fItMuon->Next())))274 while((element = static_cast<Muon *>(fItMuon->Next()))) 273 275 { 274 276 Reset(); … … 276 278 sumPT = 0.0; 277 279 fItTrack->Reset(); 278 while((track = static_cast<Track *>(fItTrack->Next())))280 while((track = static_cast<Track *>(fItTrack->Next()))) 279 281 { 280 282 if(element->P4().DeltaR(track->P4()) < 0.5) sumPT += track->PT; … … 283 285 sumET = 0.0; 284 286 fItTower->Reset(); 285 while((tower = static_cast<Tower *>(fItTower->Next())))287 while((tower = static_cast<Tower *>(fItTower->Next()))) 286 288 { 287 289 if(element->P4().DeltaR(tower->P4()) < 0.5) sumET += tower->ET; … … 293 295 minDR = 1.0E9; 294 296 fItJet->Reset(); 295 while((jet = static_cast<Jet *>(fItJet->Next())))297 while((jet = static_cast<Jet *>(fItJet->Next()))) 296 298 { 297 299 if(jet->TauTag != 0) … … 325 327 } 326 328 327 ratET = sumET /element->PT;329 ratET = sumET / element->PT; 328 330 fDblParam[6] = Float_t(TMath::Nint(sumPT)) + (ratET < 1.0 ? ratET : 0.99); 329 331 … … 342 344 343 345 fItJet->Reset(); 344 while((element = static_cast<Jet *>(fItJet->Next())))346 while((element = static_cast<Jet *>(fItJet->Next()))) 345 347 { 346 348 if(element->TauTag == 0) continue; … … 350 352 counter = 1; 351 353 352 /*354 /* 353 355 fItTrack->Reset(); 354 356 while((track = static_cast<Track*>(fItTrack->Next()))) … … 380 382 381 383 fItJet->Reset(); 382 while((element = static_cast<Jet *>(fItJet->Next())))384 while((element = static_cast<Jet *>(fItJet->Next()))) 383 385 { 384 386 if(element->TauTag != 0) continue; … … 388 390 counter = 0; 389 391 fItTrack->Reset(); 390 while((track = static_cast<Track *>(fItTrack->Next())))392 while((track = static_cast<Track *>(fItTrack->Next()))) 391 393 { 392 394 if(element->P4().DeltaR(track->P4()) < 0.5) ++counter; … … 413 415 MissingET *element; 414 416 415 element = static_cast<MissingET *>(fBranchMissingET->At(0));417 element = static_cast<MissingET *>(fBranchMissingET->At(0)); 416 418 417 419 Reset(); … … 471 473 if(argc < 2 || argc > 4) 472 474 { 473 cerr << " Usage: " << appName << " input_file" << " [output_file] [--jet-branch=Jet]" << endl; 475 cerr << " Usage: " << appName << " input_file" 476 << " [output_file] [--jet-branch=Jet]" << endl; 474 477 cerr << " input_file - input file in ROOT format," << endl; 475 478 cerr << " output_file - output file in LHCO format," << endl;
Note:
See TracChangeset
for help on using the changeset viewer.