Fork me on GitHub

Changeset c1780a5 in git


Ignore:
Timestamp:
May 26, 2021, 4:48:19 PM (3 years ago)
Author:
Michele Selvaggi <michele.selvaggi@…>
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.
Message:

Merge branch 'master' of https://github.com/delphes/delphes

Files:
3 added
6 edited
3 moved

Legend:

Unmodified
Added
Removed
  • Makefile

    rb03c0d0 rc1780a5  
    103103        classes/DelphesClasses.h \
    104104        classes/DelphesFactory.h \
    105         classes/DelphesHepMCReader.h \
     105        classes/DelphesHepMC2Reader.h \
    106106        classes/DelphesPileUpWriter.h \
    107107        external/ExRootAnalysis/ExRootProgressBar.h \
     
    213213        tmp/validation/DelphesValidation.$(ObjSuf)
    214214
    215 DelphesHepMC$(ExeSuf): \
    216         tmp/readers/DelphesHepMC.$(ObjSuf)
    217 
    218 tmp/readers/DelphesHepMC.$(ObjSuf): \
    219         readers/DelphesHepMC.cpp \
    220         classes/DelphesClasses.h \
    221         classes/DelphesFactory.h \
    222         classes/DelphesHepMCReader.h \
     215DelphesHepMC2$(ExeSuf): \
     216        tmp/readers/DelphesHepMC2.$(ObjSuf)
     217
     218tmp/readers/DelphesHepMC2.$(ObjSuf): \
     219        readers/DelphesHepMC2.cpp \
     220        classes/DelphesClasses.h \
     221        classes/DelphesFactory.h \
     222        classes/DelphesHepMC2Reader.h \
     223        modules/Delphes.h \
     224        external/ExRootAnalysis/ExRootProgressBar.h \
     225        external/ExRootAnalysis/ExRootTreeBranch.h \
     226        external/ExRootAnalysis/ExRootTreeWriter.h
     227DelphesHepMC3$(ExeSuf): \
     228        tmp/readers/DelphesHepMC3.$(ObjSuf)
     229
     230tmp/readers/DelphesHepMC3.$(ObjSuf): \
     231        readers/DelphesHepMC3.cpp \
     232        classes/DelphesClasses.h \
     233        classes/DelphesFactory.h \
     234        classes/DelphesHepMC3Reader.h \
    223235        modules/Delphes.h \
    224236        external/ExRootAnalysis/ExRootProgressBar.h \
     
    263275        external/ExRootAnalysis/ExRootTreeWriter.h
    264276EXECUTABLE +=  \
    265         DelphesHepMC$(ExeSuf) \
     277        DelphesHepMC2$(ExeSuf) \
     278        DelphesHepMC3$(ExeSuf) \
    266279        DelphesLHEF$(ExeSuf) \
    267280        DelphesROOT$(ExeSuf) \
     
    269282
    270283EXECUTABLE_OBJ +=  \
    271         tmp/readers/DelphesHepMC.$(ObjSuf) \
     284        tmp/readers/DelphesHepMC2.$(ObjSuf) \
     285        tmp/readers/DelphesHepMC3.$(ObjSuf) \
    272286        tmp/readers/DelphesLHEF.$(ObjSuf) \
    273287        tmp/readers/DelphesROOT.$(ObjSuf) \
     
    516530        classes/DelphesFormula.h \
    517531        classes/DelphesClasses.h
    518 tmp/classes/DelphesHepMCReader.$(ObjSuf): \
    519         classes/DelphesHepMCReader.$(SrcSuf) \
    520         classes/DelphesHepMCReader.h \
     532tmp/classes/DelphesHepMC2Reader.$(ObjSuf): \
     533        classes/DelphesHepMC2Reader.$(SrcSuf) \
     534        classes/DelphesHepMC2Reader.h \
     535        classes/DelphesClasses.h \
     536        classes/DelphesFactory.h \
     537        classes/DelphesStream.h \
     538        external/ExRootAnalysis/ExRootTreeBranch.h
     539tmp/classes/DelphesHepMC3Reader.$(ObjSuf): \
     540        classes/DelphesHepMC3Reader.$(SrcSuf) \
     541        classes/DelphesHepMC3Reader.h \
    521542        classes/DelphesClasses.h \
    522543        classes/DelphesFactory.h \
     
    11451166        tmp/classes/DelphesFactory.$(ObjSuf) \
    11461167        tmp/classes/DelphesFormula.$(ObjSuf) \
    1147         tmp/classes/DelphesHepMCReader.$(ObjSuf) \
     1168        tmp/classes/DelphesHepMC2Reader.$(ObjSuf) \
     1169        tmp/classes/DelphesHepMC3Reader.$(ObjSuf) \
    11481170        tmp/classes/DelphesLHEFReader.$(ObjSuf) \
    11491171        tmp/classes/DelphesModule.$(ObjSuf) \
  • cards/delphes_card_MuonColliderDet.tcl

    rb03c0d0 rc1780a5  
    12001200    set ResolutionFormula {
    12011201        (abs(eta) <= 0.78 )  * sqrt(energy^2*0.01^2 + energy*0.156^2)+
    1202         (abs(eta) > 0.78 && abs(eta) <=0.83 ) * sqrt( energy^0.01^2 + energy*0.175^2  ) +
     1202        (abs(eta) > 0.78 && abs(eta) <=0.83 ) * sqrt( energy^2*0.01^2 + energy*0.175^2  ) +
    12031203        (abs(eta) <= 2.5 && abs(eta) > 0.83) * sqrt( energy^2*0.01^2 + energy*0.151^2  )}
    12041204}
  • classes/DelphesHepMC2Reader.cc

    rb03c0d0 rc1780a5  
    1717 */
    1818
    19 /** \class DelphesHepMCReader
     19/** \class DelphesHepMC2Reader
    2020 *
    2121 *  Reads HepMC file
     
    2525 */
    2626
    27 #include "classes/DelphesHepMCReader.h"
     27#include "classes/DelphesHepMC2Reader.h"
    2828
    2929#include <iostream>
     
    5454//---------------------------------------------------------------------------
    5555
    56 DelphesHepMCReader::DelphesHepMCReader() :
     56DelphesHepMC2Reader::DelphesHepMC2Reader() :
    5757  fInputFile(0), fBuffer(0), fPDG(0),
    5858  fVertexCounter(-1), fInCounter(-1), fOutCounter(-1),
     
    6666//---------------------------------------------------------------------------
    6767
    68 DelphesHepMCReader::~DelphesHepMCReader()
     68DelphesHepMC2Reader::~DelphesHepMC2Reader()
    6969{
    7070  if(fBuffer) delete[] fBuffer;
     
    7373//---------------------------------------------------------------------------
    7474
    75 void DelphesHepMCReader::SetInputFile(FILE *inputFile)
     75void DelphesHepMC2Reader::SetInputFile(FILE *inputFile)
    7676{
    7777  fInputFile = inputFile;
     
    8080//---------------------------------------------------------------------------
    8181
    82 void DelphesHepMCReader::Clear()
     82void DelphesHepMC2Reader::Clear()
    8383{
    8484  fStateSize = 0;
     
    9898//---------------------------------------------------------------------------
    9999
    100 bool DelphesHepMCReader::EventReady()
     100bool DelphesHepMC2Reader::EventReady()
    101101{
    102102  return (fVertexCounter == 0) && (fInCounter == 0) && (fOutCounter == 0);
     
    105105//---------------------------------------------------------------------------
    106106
    107 bool DelphesHepMCReader::ReadBlock(DelphesFactory *factory,
     107bool DelphesHepMC2Reader::ReadBlock(DelphesFactory *factory,
    108108  TObjArray *allParticleOutputArray,
    109109  TObjArray *stableParticleOutputArray,
     
    202202    }
    203203  }
    204 
    205204  else if(key == 'C')
    206205  {
    207206    rc = bufferStream.ReadDbl(fCrossSection)
    208207      && bufferStream.ReadDbl(fCrossSectionError);
    209   }
    210 
     208
     209    if(!rc)
     210    {
     211      cerr << "** ERROR: "
     212           << "invalid cross section format" << endl;
     213      return kFALSE;
     214    }
     215  }
    211216  else if(key == 'F')
    212217  {
     
    317322//---------------------------------------------------------------------------
    318323
    319 void DelphesHepMCReader::AnalyzeEvent(ExRootTreeBranch *branch, long long eventNumber,
     324void DelphesHepMC2Reader::AnalyzeEvent(ExRootTreeBranch *branch, long long eventNumber,
    320325  TStopwatch *readStopWatch, TStopwatch *procStopWatch)
    321326{
     
    348353//---------------------------------------------------------------------------
    349354
    350 void DelphesHepMCReader::AnalyzeWeight(ExRootTreeBranch *branch)
     355void DelphesHepMC2Reader::AnalyzeWeight(ExRootTreeBranch *branch)
    351356{
    352357  Weight *element;
     
    363368//---------------------------------------------------------------------------
    364369
    365 void DelphesHepMCReader::AnalyzeParticle(DelphesFactory *factory,
     370void DelphesHepMC2Reader::AnalyzeParticle(DelphesFactory *factory,
    366371  TObjArray *allParticleOutputArray,
    367372  TObjArray *stableParticleOutputArray,
     
    430435//---------------------------------------------------------------------------
    431436
    432 void DelphesHepMCReader::FinalizeParticles(TObjArray *allParticleOutputArray)
     437void DelphesHepMC2Reader::FinalizeParticles(TObjArray *allParticleOutputArray)
    433438{
    434439  Candidate *candidate;
  • classes/DelphesHepMC2Reader.h

    rb03c0d0 rc1780a5  
    1717 */
    1818
    19 #ifndef DelphesHepMCReader_h
    20 #define DelphesHepMCReader_h
     19#ifndef DelphesHepMC2Reader_h
     20#define DelphesHepMC2Reader_h
    2121
    22 /** \class DelphesHepMCReader
     22/** \class DelphesHepMC2Reader
    2323 *
    2424 *  Reads HepMC file
     
    3939class DelphesFactory;
    4040
    41 class DelphesHepMCReader
     41class DelphesHepMC2Reader
    4242{
    4343public:
    44   DelphesHepMCReader();
    45   ~DelphesHepMCReader();
     44  DelphesHepMC2Reader();
     45  ~DelphesHepMC2Reader();
    4646
    4747  void SetInputFile(FILE *inputFile);
     
    102102};
    103103
    104 #endif // DelphesHepMCReader_h
     104#endif // DelphesHepMC2Reader_h
  • classes/DelphesStream.cc

    rb03c0d0 rc1780a5  
    106106
    107107//------------------------------------------------------------------------------
     108
     109bool 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
     127bool 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  
    3535  bool ReadDbl(double &value);
    3636  bool ReadInt(int &value);
     37  bool FindChr(int value);
     38  bool FindStr(const char *value);
    3739
    3840private:
  • converters/hepmc2pileup.cpp

    rb03c0d0 rc1780a5  
    3535#include "classes/DelphesClasses.h"
    3636#include "classes/DelphesFactory.h"
    37 #include "classes/DelphesHepMCReader.h"
     37#include "classes/DelphesHepMC2Reader.h"
    3838#include "classes/DelphesPileUpWriter.h"
    3939
     
    6565  Candidate *candidate = 0;
    6666  DelphesPileUpWriter *writer = 0;
    67   DelphesHepMCReader *reader = 0;
     67  DelphesHepMC2Reader *reader = 0;
    6868  Int_t i;
    6969  Long64_t length, eventCounter;
     
    9898    itParticle = stableParticleOutputArray->MakeIterator();
    9999
    100     reader = new DelphesHepMCReader;
     100    reader = new DelphesHepMC2Reader;
    101101
    102102    i = 2;
  • doc/genMakefile.tcl

    rb03c0d0 rc1780a5  
    292292executableDeps {converters/*.cpp} {examples/*.cpp} {validation/*.cpp}
    293293
    294 executableDeps {readers/DelphesHepMC.cpp} {readers/DelphesLHEF.cpp} {readers/DelphesSTDHEP.cpp} {readers/DelphesROOT.cpp}
     294executableDeps {readers/DelphesHepMC2.cpp} {readers/DelphesHepMC3.cpp} {readers/DelphesLHEF.cpp} {readers/DelphesSTDHEP.cpp} {readers/DelphesROOT.cpp}
    295295
    296296puts {ifeq ($(HAS_CMSSW),true)}
  • readers/DelphesHepMC2.cpp

    rb03c0d0 rc1780a5  
    3535#include "classes/DelphesClasses.h"
    3636#include "classes/DelphesFactory.h"
    37 #include "classes/DelphesHepMCReader.h"
     37#include "classes/DelphesHepMC2Reader.h"
    3838#include "modules/Delphes.h"
    3939
     
    5757int main(int argc, char *argv[])
    5858{
    59   char appName[] = "DelphesHepMC";
     59  char appName[] = "DelphesHepMC2";
    6060  stringstream message;
    6161  FILE *inputFile = 0;
     
    6868  DelphesFactory *factory = 0;
    6969  TObjArray *stableParticleOutputArray = 0, *allParticleOutputArray = 0, *partonOutputArray = 0;
    70   DelphesHepMCReader *reader = 0;
     70  DelphesHepMC2Reader *reader = 0;
    7171  Int_t i, maxEvents, skipEvents;
    7272  Long64_t length, eventCounter;
     
    132132    partonOutputArray = modularDelphes->ExportArray("partons");
    133133
    134     reader = new DelphesHepMCReader;
     134    reader = new DelphesHepMC2Reader;
    135135
    136136    modularDelphes->InitTask();
Note: See TracChangeset for help on using the changeset viewer.