Changes in converters/lhco2root.cpp [341014c:1fa50c2] in git
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
converters/lhco2root.cpp
r341014c r1fa50c2 17 17 */ 18 18 19 #include <stdexcept> 19 20 #include <iostream> 20 21 #include <sstream> 21 #include <stdexcept> 22 22 23 #include <stdlib.h> 23 24 #include <signal.h> 24 25 #include <stdio.h> 25 #include <stdlib.h> 26 26 27 #include "TROOT.h" 27 28 #include "TApplication.h" 28 #include "TROOT.h" 29 29 30 #include "TFile.h" 31 #include "TObjArray.h" 32 #include "TStopwatch.h" 30 33 #include "TDatabasePDG.h" 31 #include "T File.h"34 #include "TParticlePDG.h" 32 35 #include "TLorentzVector.h" 33 #include "TObjArray.h" 34 #include "TParticlePDG.h" 35 #include "TStopwatch.h" 36 36 37 #include "modules/Delphes.h" 38 #include "classes/DelphesStream.h" 37 39 #include "classes/DelphesClasses.h" 38 40 #include "classes/DelphesFactory.h" 39 #include "classes/DelphesStream.h" 40 #include " modules/Delphes.h"41 41 42 #include "ExRootAnalysis/ExRootTreeWriter.h" 43 #include "ExRootAnalysis/ExRootTreeBranch.h" 42 44 #include "ExRootAnalysis/ExRootProgressBar.h" 43 #include "ExRootAnalysis/ExRootTreeBranch.h"44 #include "ExRootAnalysis/ExRootTreeWriter.h"45 45 46 46 using namespace std; 47 47 48 static const int kBufferSize = 1024;48 static const int kBufferSize = 1024; 49 49 50 50 /* … … 74 74 75 75 private: 76 76 77 void AddMissingEvents(); 77 78 … … 85 86 void AnalyseMissingET(ExRootTreeBranch *branch); 86 87 87 enum 88 { 89 kIntParamSize = 2, 90 kDblParamSize = 7 91 }; 88 enum {kIntParamSize = 2, kDblParamSize = 7}; 92 89 Int_t fIntParam[kIntParamSize]; 93 90 Double_t fDblParam[kDblParamSize]; … … 109 106 ExRootTreeBranch *fBranchJet; 110 107 ExRootTreeBranch *fBranchMissingET; 108 111 109 }; 112 110 … … 171 169 if(!rc) 172 170 { 173 cerr << "** ERROR: " 174 << "invalid event format" << endl; 171 cerr << "** ERROR: " << "invalid event format" << endl; 175 172 return kFALSE; 176 173 } … … 198 195 if(!rc) 199 196 { 200 cerr << "** ERROR: " 201 << "invalid object format" << endl; 197 cerr << "** ERROR: " << "invalid object format" << endl; 202 198 return kFALSE; 203 199 } … … 205 201 switch(fIntParam[1]) 206 202 { 207 case 0: AnalysePhoton(fBranchPhoton); break;208 case 1: AnalyseElectron(fBranchElectron); break;209 case 2: AnalyseMuon(fBranchMuon); break;210 case 3: AnalyseTau(fBranchJet); break;211 case 4: AnalyseJet(fBranchJet); break;212 case 6: AnalyseMissingET(fBranchMissingET); break;203 case 0: AnalysePhoton(fBranchPhoton); break; 204 case 1: AnalyseElectron(fBranchElectron); break; 205 case 2: AnalyseMuon(fBranchMuon); break; 206 case 3: AnalyseTau(fBranchJet); break; 207 case 4: AnalyseJet(fBranchJet); break; 208 case 6: AnalyseMissingET(fBranchMissingET); break; 213 209 } 214 210 } … … 232 228 LHCOEvent *element; 233 229 234 element = static_cast<LHCOEvent 230 element = static_cast<LHCOEvent*>(branch->NewEntry()); 235 231 236 232 element->Number = fEventNumber; … … 244 240 Photon *element; 245 241 246 element = static_cast<Photon 242 element = static_cast<Photon*>(branch->NewEntry()); 247 243 248 244 element->Eta = fDblParam[0]; … … 258 254 Electron *element; 259 255 260 element = static_cast<Electron 256 element = static_cast<Electron*>(branch->NewEntry()); 261 257 262 258 element->Eta = fDblParam[0]; … … 265 261 266 262 element->Charge = fDblParam[4] < 0.0 ? -1 : 1; 267 263 /* 268 264 element->Ntrk = TMath::Abs(fDblParam[4]); 269 265 */ … … 277 273 Muon *element; 278 274 279 element = static_cast<Muon 275 element = static_cast<Muon*>(branch->NewEntry()); 280 276 281 277 element->Eta = fDblParam[0]; … … 284 280 285 281 element->Charge = fDblParam[4] < 0.0 ? -1 : 1; 286 282 /* 287 283 element->Ntrk = TMath::Abs(fDblParam[4]); 288 284 … … 300 296 Jet *element; 301 297 302 element = static_cast<Jet 298 element = static_cast<Jet*>(branch->NewEntry()); 303 299 304 300 element->Eta = fDblParam[0]; … … 312 308 313 309 element->Charge = fDblParam[4] < 0 ? -1 : 1; 314 310 /* 315 311 element->Ntrk = TMath::Abs(fDblParam[4]); 316 312 */ … … 324 320 Jet *element; 325 321 326 element = static_cast<Jet 322 element = static_cast<Jet*>(branch->NewEntry()); 327 323 328 324 element->Eta = fDblParam[0]; … … 331 327 332 328 element->Mass = fDblParam[3]; 333 329 /* 334 330 element->Ntrk = TMath::Abs(Int_t(fDblParam[4])); 335 331 */ … … 340 336 341 337 element->EhadOverEem = fDblParam[6]; 342 338 /* 343 339 element->Index = fIntParam[0]; 344 340 */ … … 351 347 MissingET *element; 352 348 353 element = static_cast<MissingET 349 element = static_cast<MissingET*>(branch->NewEntry()); 354 350 355 351 element->Phi = fDblParam[1]; … … 380 376 if(argc < 2) 381 377 { 382 cout << " Usage: " << appName << " output_file" 383 << " [input_file(s)]" << endl; 378 cout << " Usage: " << appName << " output_file" << " [input_file(s)]" << endl; 384 379 cout << " output_file - output file in ROOT format," << endl; 385 380 cout << " input_file(s) - input file(s) in LHCO format," << endl; … … 461 456 462 457 ++i; 463 } while(i < argc); 458 } 459 while(i < argc); 464 460 465 461 cout << "** Exiting..." << endl; … … 478 474 } 479 475 } 476 477
Note:
See TracChangeset
for help on using the changeset viewer.