ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Fun4AllOscarInputManager.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Fun4AllOscarInputManager.h
1 #ifndef PHHEPMC_FUN4ALLOSCARINPUTMANAGER_H
2 #define PHHEPMC_FUN4ALLOSCARINPUTMANAGER_H
3 
4 #include "PHHepMCGenHelper.h"
5 
7 #include <fun4all/Fun4AllReturnCodes.h> // for SYNC_NOOBJECT, SYNC_OK
8 
9 #include <fstream>
10 #include <string>
11 
12 // forward declaration of classes in namespace
13 namespace HepMC
14 {
15  class GenEvent;
16 } // namespace HepMC
17 
18 class PHCompositeNode;
19 class SyncObject;
20 
22 {
23  public:
24  Fun4AllOscarInputManager(const std::string &name = "DUMMY", const std::string &topnodename = "TOP");
25  ~Fun4AllOscarInputManager() override;
26  int fileopen(const std::string &filenam) override;
27  int fileclose() override;
28  int run(const int nevents = 0) override;
29  void Print(const std::string &what = "ALL") const override;
30  int ResetEvent() override;
31  int PushBackEvents(const int i) override;
32  int skip(const int i) override { return PushBackEvents(i); }
33 
34  // Effectivly turn off the synchronization checking
35  //
36  int SyncIt(const SyncObject * /*mastersync*/) override { return Fun4AllReturnCodes::SYNC_OK; }
37  int GetSyncObject(SyncObject ** /*mastersync*/) override { return Fun4AllReturnCodes::SYNC_NOOBJECT; }
38  int NoSyncPushBackEvents(const int nevt) override { return PushBackEvents(nevt); }
39  int ConvertFromOscar();
40 
41  protected:
44  std::string filename;
45  std::string topNodeName;
47  HepMC::GenEvent *evt;
48  //HepMC::GenEvent *tmpEvt;
50 
51  // some pointers for use in decompression handling
52  std::ifstream *filestream; // holds compressed filestream
53  std::istream *unzipstream; // feed into HepMc
54  std::ifstream theOscarFile;
55 
57 };
58 
59 #endif /* PHHEPMC_FUN4ALLOSCARINPUTMANAGER_H */