- Timestamp:
- May 26, 2021, 4:48:19 PM (3 years ago)
- Branches:
- master
- Children:
- c6f9311
- Parents:
- b03c0d0 (diff), b4786d3 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- classes
- Files:
-
- 2 added
- 2 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
classes/DelphesHepMC2Reader.cc
rb03c0d0 rc1780a5 17 17 */ 18 18 19 /** \class DelphesHepMC Reader19 /** \class DelphesHepMC2Reader 20 20 * 21 21 * Reads HepMC file … … 25 25 */ 26 26 27 #include "classes/DelphesHepMC Reader.h"27 #include "classes/DelphesHepMC2Reader.h" 28 28 29 29 #include <iostream> … … 54 54 //--------------------------------------------------------------------------- 55 55 56 DelphesHepMC Reader::DelphesHepMCReader() :56 DelphesHepMC2Reader::DelphesHepMC2Reader() : 57 57 fInputFile(0), fBuffer(0), fPDG(0), 58 58 fVertexCounter(-1), fInCounter(-1), fOutCounter(-1), … … 66 66 //--------------------------------------------------------------------------- 67 67 68 DelphesHepMC Reader::~DelphesHepMCReader()68 DelphesHepMC2Reader::~DelphesHepMC2Reader() 69 69 { 70 70 if(fBuffer) delete[] fBuffer; … … 73 73 //--------------------------------------------------------------------------- 74 74 75 void DelphesHepMC Reader::SetInputFile(FILE *inputFile)75 void DelphesHepMC2Reader::SetInputFile(FILE *inputFile) 76 76 { 77 77 fInputFile = inputFile; … … 80 80 //--------------------------------------------------------------------------- 81 81 82 void DelphesHepMC Reader::Clear()82 void DelphesHepMC2Reader::Clear() 83 83 { 84 84 fStateSize = 0; … … 98 98 //--------------------------------------------------------------------------- 99 99 100 bool DelphesHepMC Reader::EventReady()100 bool DelphesHepMC2Reader::EventReady() 101 101 { 102 102 return (fVertexCounter == 0) && (fInCounter == 0) && (fOutCounter == 0); … … 105 105 //--------------------------------------------------------------------------- 106 106 107 bool DelphesHepMC Reader::ReadBlock(DelphesFactory *factory,107 bool DelphesHepMC2Reader::ReadBlock(DelphesFactory *factory, 108 108 TObjArray *allParticleOutputArray, 109 109 TObjArray *stableParticleOutputArray, … … 202 202 } 203 203 } 204 205 204 else if(key == 'C') 206 205 { 207 206 rc = bufferStream.ReadDbl(fCrossSection) 208 207 && bufferStream.ReadDbl(fCrossSectionError); 209 } 210 208 209 if(!rc) 210 { 211 cerr << "** ERROR: " 212 << "invalid cross section format" << endl; 213 return kFALSE; 214 } 215 } 211 216 else if(key == 'F') 212 217 { … … 317 322 //--------------------------------------------------------------------------- 318 323 319 void DelphesHepMC Reader::AnalyzeEvent(ExRootTreeBranch *branch, long long eventNumber,324 void DelphesHepMC2Reader::AnalyzeEvent(ExRootTreeBranch *branch, long long eventNumber, 320 325 TStopwatch *readStopWatch, TStopwatch *procStopWatch) 321 326 { … … 348 353 //--------------------------------------------------------------------------- 349 354 350 void DelphesHepMC Reader::AnalyzeWeight(ExRootTreeBranch *branch)355 void DelphesHepMC2Reader::AnalyzeWeight(ExRootTreeBranch *branch) 351 356 { 352 357 Weight *element; … … 363 368 //--------------------------------------------------------------------------- 364 369 365 void DelphesHepMC Reader::AnalyzeParticle(DelphesFactory *factory,370 void DelphesHepMC2Reader::AnalyzeParticle(DelphesFactory *factory, 366 371 TObjArray *allParticleOutputArray, 367 372 TObjArray *stableParticleOutputArray, … … 430 435 //--------------------------------------------------------------------------- 431 436 432 void DelphesHepMC Reader::FinalizeParticles(TObjArray *allParticleOutputArray)437 void DelphesHepMC2Reader::FinalizeParticles(TObjArray *allParticleOutputArray) 433 438 { 434 439 Candidate *candidate; -
classes/DelphesHepMC2Reader.h
rb03c0d0 rc1780a5 17 17 */ 18 18 19 #ifndef DelphesHepMC Reader_h20 #define DelphesHepMC Reader_h19 #ifndef DelphesHepMC2Reader_h 20 #define DelphesHepMC2Reader_h 21 21 22 /** \class DelphesHepMC Reader22 /** \class DelphesHepMC2Reader 23 23 * 24 24 * Reads HepMC file … … 39 39 class DelphesFactory; 40 40 41 class DelphesHepMC Reader41 class DelphesHepMC2Reader 42 42 { 43 43 public: 44 DelphesHepMC Reader();45 ~DelphesHepMC Reader();44 DelphesHepMC2Reader(); 45 ~DelphesHepMC2Reader(); 46 46 47 47 void SetInputFile(FILE *inputFile); … … 102 102 }; 103 103 104 #endif // DelphesHepMC Reader_h104 #endif // DelphesHepMC2Reader_h -
classes/DelphesStream.cc
rb03c0d0 rc1780a5 106 106 107 107 //------------------------------------------------------------------------------ 108 109 bool DelphesStream::FindChr(int value) 110 { 111 char *position; 112 bool result = false; 113 114 position = strchr(fBuffer, value); 115 116 if(position) 117 { 118 result = true; 119 fBuffer = position + 1; 120 } 121 122 return result; 123 } 124 125 //------------------------------------------------------------------------------ 126 127 bool DelphesStream::FindStr(const char *value) 128 { 129 char *position; 130 bool result = false; 131 132 position = strstr(fBuffer, value); 133 134 if(position) 135 { 136 result = true; 137 fBuffer = position + strlen(value); 138 } 139 140 return result; 141 } 142 143 //------------------------------------------------------------------------------ -
classes/DelphesStream.h
rb03c0d0 rc1780a5 35 35 bool ReadDbl(double &value); 36 36 bool ReadInt(int &value); 37 bool FindChr(int value); 38 bool FindStr(const char *value); 37 39 38 40 private:
Note:
See TracChangeset
for help on using the changeset viewer.