Changeset 419 in svn
- Timestamp:
- May 28, 2009, 10:50:31 AM (16 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/interface/DataConverter.h
r380 r419 52 52 virtual ~DataConverter() {}; 53 53 54 pr ivate:54 protected: 55 55 int Nevt; // number of events to read; -1 means "all of them" 56 56 -
trunk/src/HEPEVTConverter.cc
r380 r419 36 36 #include <sstream> 37 37 #include <fstream> 38 #include <cmath> 38 39 39 40 #include "TROOT.h" … … 212 213 213 214 TRootC::GenParticle *element; 214 215 allEntries = (Nevt<0)?allEntries:min((int)allEntries,Nevt); // do not miss the "+1" 215 216 // Loop over all events 216 217 for(entry = 0; entry < allEntries; ++entry) -
trunk/src/HepMCConverter.cc
r380 r419 298 298 HepMC::IO_GenEvent ascii_in(filename,std::ios::in); 299 299 // get the first event 300 300 301 evt = ascii_in.read_next_event(); 301 302 302 303 while ( evt ) 303 304 { 305 if(Nevt>0 && entry>=Nevt) break; 306 304 307 treeWriter->Clear(); 305 308 AnalyseEvent(branchGenEvent, *evt,entry+1); -
trunk/src/LHEFConverter.cc
r413 r419 111 111 112 112 //------------------------------------------------------------------------------ 113 //Nevents not yet implemented! 08.03.2009114 113 LHEFConverter::LHEFConverter(const string& inputFileList, const string& outputFileName, const PdgTable& pdg, const int& Nevents) : 115 114 DataConverter(pdg,Nevents) { … … 151 150 152 151 Long64_t allEntries = inputReader->getNumberOfEvents(); 153 152 allEntries = (Nevt<0)?allEntries:min((int)allEntries,Nevt); // do not miss the "+1" 153 154 154 if(allEntries > 0) { 155 155 // Loop over all events … … 161 161 treeWriter->Fill(); 162 162 ++entry; 163 if(allEntries<entry+1) break; 163 164 } 164 165 } -
trunk/src/STDHEPConverter.cc
r380 r419 33 33 #include <iostream> 34 34 #include <fstream> 35 #include <cmath> 35 36 #include "TLorentzVector.h" 36 37 #include "BlockClasses.h" … … 158 159 break; 159 160 } 160 161 Long64_t allEntries = nevt; 162 161 162 Long64_t allEntries = (Nevt<0)?nevt:min(nevt,Nevt+1); // do not miss the "+1" 163 163 if(allEntries > 0) 164 164 {
Note:
See TracChangeset
for help on using the changeset viewer.