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