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
0013 namespace HepMC
0014 {
0015 class GenEvent;
0016 }
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
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
0036
0037 int SyncIt(const SyncObject * ) override { return Fun4AllReturnCodes::SYNC_OK; }
0038 int GetSyncObject(SyncObject ** ) 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
0050 int skipEvents, skippedEvents;
0051
0052
0053 std::ifstream *filestream;
0054 std::istream *unzipstream;
0055 std::ifstream theOscarFile;
0056
0057 bool isCompressed;
0058 };
0059
0060 #endif