PandaRoot
PndGiBuuGenerator.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 // -------------------------------------------------------------------------
14 // ----- PndGiBuuGenerator header file -----
15 // ----- Created 02/08/12 by T.Stockmanns -----
16 // -------------------------------------------------------------------------
17 
26 #ifndef PND_GiBuuGENERATOR_H
27 #define PND_GiBuuGENERATOR_H
28 
29 #include "FairGenerator.h"
30 #include "PndGiBuuDecayerAbs.h"
31 
32 #include "TString.h"
33 #include <fstream>
34 #include <map>
35 
36 class FairPrimaryGenerator;
37 
38 class PndGiBuuGenerator : public FairGenerator {
39 
40  public:
45  PndGiBuuGenerator(const Char_t *fileName, const Char_t *pidDataFileName);
46 
48  virtual ~PndGiBuuGenerator();
49 
54  virtual Bool_t ReadEvent(FairPrimaryGenerator *primGen);
55 
56  void RegisterDecayer(Int_t pdgCode, PndGiBuuDecayerAbs *decayer) { fDecayerMap[pdgCode] = decayer; }
57 
58  protected:
59  Bool_t Init();
60 
61  private:
64 
65  void FillPidMap();
66  Int_t GetPdgParticleId(Int_t GiBuuId, Int_t charge);
67  void WriteoutDecayParticle(Int_t oldEventNr, Int_t oldRunId, FairPrimaryGenerator *primGen);
68 
69  std::map<std::pair<Int_t, Int_t>, Int_t> fMapGiBuuToPdg;
70 
71  Int_t fEvent;
72  Int_t fRunId;
73  TString fFileName;
74  TString fPidDataFileName;
75  std::ifstream *fInputAsciiFile;
76 
77  std::map<Int_t, PndGiBuuDecayerAbs *> fDecayerMap;
78 
79  Double_t fPx, fPy, fPz;
80  Int_t fPdg;
81 
82  void CloseInput();
83 
84  ClassDef(PndGiBuuGenerator, 1);
85 };
86 
87 #endif
virtual Bool_t ReadEvent(FairPrimaryGenerator *primGen)
void RegisterDecayer(Int_t pdgCode, PndGiBuuDecayerAbs *decayer)
virtual ~PndGiBuuGenerator()