Analysis Software
Documentation for sPHENIX simulation 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 // cppcheck-suppress virtualCallInConstructor
28  int fileclose() override;
29  int run(const int nevents = 0) override;
30  void Print(const std::string &what = "ALL") const override;
31  int ResetEvent() override;
32  int PushBackEvents(const int i) override;
33  int skip(const int i) override { return PushBackEvents(i); }
34 
35  // Effectivly turn off the synchronization checking
36  //
37  int SyncIt(const SyncObject * /*mastersync*/) override { return Fun4AllReturnCodes::SYNC_OK; }
38  int GetSyncObject(SyncObject ** /*mastersync*/) override { return Fun4AllReturnCodes::SYNC_NOOBJECT; }
39  int NoSyncPushBackEvents(const int nevt) override { return PushBackEvents(nevt); }
40  int ConvertFromOscar();
41 
42  protected:
48  HepMC::GenEvent *evt;
49  //HepMC::GenEvent *tmpEvt;
51 
52  // some pointers for use in decompression handling
53  std::ifstream *filestream; // holds compressed filestream
54  std::istream *unzipstream; // feed into HepMc
55  std::ifstream theOscarFile;
56 
58 };
59 
60 #endif /* PHHEPMC_FUN4ALLOSCARINPUTMANAGER_H */