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