Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:15:59

0001 #ifndef PHHEPMC_FUN4ALLOSCARINPUTMANAGER_H
0002 #define PHHEPMC_FUN4ALLOSCARINPUTMANAGER_H
0003 
0004 #include "PHHepMCGenHelper.h"
0005 
0006 #include <fun4all/Fun4AllInputManager.h>
0007 #include <fun4all/Fun4AllReturnCodes.h>  // for SYNC_NOOBJECT, SYNC_OK
0008 
0009 #include <fstream>
0010 #include <string>
0011 
0012 // forward declaration of classes in namespace
0013 namespace HepMC
0014 {
0015   class GenEvent;
0016 }  // namespace HepMC
0017 
0018 class PHCompositeNode;
0019 class SyncObject;
0020 
0021 class Fun4AllOscarInputManager : public Fun4AllInputManager, public PHHepMCGenHelper
0022 {
0023  public:
0024   Fun4AllOscarInputManager(const std::string &name = "DUMMY", const std::string &topnodename = "TOP");
0025   ~Fun4AllOscarInputManager() override;
0026   int fileopen(const std::string &filenam) override;
0027 // cppcheck-suppress virtualCallInConstructor
0028   int fileclose() override;
0029   int run(const int nevents = 0) override;
0030   void Print(const std::string &what = "ALL") const override;
0031   int ResetEvent() override;
0032   int PushBackEvents(const int i) override;
0033   int skip(const int i) override { return PushBackEvents(i); }
0034 
0035   // Effectivly turn off the synchronization checking
0036   //
0037   int SyncIt(const SyncObject * /*mastersync*/) override { return Fun4AllReturnCodes::SYNC_OK; }
0038   int GetSyncObject(SyncObject ** /*mastersync*/) override { return Fun4AllReturnCodes::SYNC_NOOBJECT; }
0039   int NoSyncPushBackEvents(const int nevt) override { return PushBackEvents(nevt); }
0040   int ConvertFromOscar();
0041 
0042  protected:
0043   int events_total;
0044   int events_thisfile;
0045   std::string filename;
0046   std::string topNodeName;
0047   PHCompositeNode *topNode;
0048   HepMC::GenEvent *evt;
0049   //HepMC::GenEvent *tmpEvt;
0050   int skipEvents, skippedEvents;
0051 
0052   // some pointers for use in decompression handling
0053   std::ifstream *filestream;  // holds compressed filestream
0054   std::istream *unzipstream;  // feed into HepMc
0055   std::ifstream theOscarFile;
0056 
0057   bool isCompressed;
0058 };
0059 
0060 #endif /* PHHEPMC_FUN4ALLOSCARINPUTMANAGER_H */