StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StMCFilter.h
1 // @(#)STAR/eg:$Id: StMCFilter.h,v 1.10 2018/02/21 02:04:41 perev Exp $
2 // Author: V.Perev Mar/2009
13 #ifndef STAR_StMCFilter
14 #define STAR_StMCFilter
15 #include <string>
16 #include <map>
17 class StMCFilter;
18 typedef std::map<std::string, StMCFilter *> myMap_t;
20 class StG3ParticleMaster;
22 
23 class StMCFilter
24 {
25  public:
26  // ****** constructors and destructor
27  StMCFilter(const char *name);
28  virtual ~StMCFilter();
30  virtual int RejectEG(const StGenParticleMaster &ptl) const {return 0;}
32  virtual int RejectGT(const StGenParticleMaster &ptl) const {return 0;}
34  virtual int RejectGE(const StGenParticleMaster &ptl) const {return 0;}
36  virtual void Finish() const{;}
37 
38  const std::string &GetName() const { return fName;}
39 
41  double &User(int idx) {return fUser[idx];}
43  double User(int idx) const {return fUser[idx];}
44 
47  virtual void parseConfig(std::string key, float value){ /* nada */ };
48 
50  static StMCFilter *selected(){ return fgSelected; }
51 
52  private:
55  static int Select(const char *name);
57  static int REJECTEG();
59  static int REJECTGT();
61  static int REJECTGE();
63  static void SetEG(void *hepEvt);
65  static void SetG3(void *gfKine,void *gfVert);
68  static int Action(int kase, void *par1,void *par2);
69 
70  static int Config(std::string key, const float value );
71 
72  protected:
74  static int GetNTotEG() { return fgSelected->fCnt[0][0];}
76  static int GetNTotGT() { return fgSelected->fCnt[1][0];}
78  static int GetNTotGE() { return fgSelected->fCnt[2][0];}
80  static int GetNRejEG() { return fgSelected->fCnt[0][1];}
82  static int GetNRejGT() { return fgSelected->fCnt[1][1];}
84  static int GetNRejGE() { return fgSelected->fCnt[2][1];}
86  static void FINISH();
87 
88  private:
89 
92  static StMCFilter *fgSelected;
94  static StHepParticleMaster *fgHepParticle;
96  static StG3ParticleMaster *fgG3Particle;
97 
98 protected:
99  std::string fName;
100  char fBeg[1];
101  int fCnt[3][2];
102  double fUser[20];
103  char fEnd[1];
104 static myMap_t *mgMap;
105 
106 };
107 
108 #endif
109 
static StMCFilter * selected()
Returns a pointer to the selected filter.
Definition: StMCFilter.h:50
Master class for StGimParticle filled from GEANT3 internal structures.
Definition: StG3Particle.h:26
static int GetNRejEG()
Number of rejected GE events.
Definition: StMCFilter.h:80
virtual int RejectGT(const StGenParticleMaster &ptl) const
Rejection of GEANT Tracking.
Definition: StMCFilter.h:32
double User(int idx) const
Returns one of the 10 user words.
Definition: StMCFilter.h:43
static int GetNRejGT()
Number of rejected GT events.
Definition: StMCFilter.h:82
virtual int RejectGE(const StGenParticleMaster &ptl) const
Rejection at GEANT End, No GEANT output.
Definition: StMCFilter.h:34
static int GetNTotGE()
Number of total GE events.
Definition: StMCFilter.h:78
double & User(int idx)
Return a reference to one of 10 user words.
Definition: StMCFilter.h:41
static int GetNRejGE()
Number of rejected GE events.
Definition: StMCFilter.h:84
virtual void parseConfig(std::string key, float value)
Definition: StMCFilter.h:47
virtual int RejectEG(const StGenParticleMaster &ptl) const
Rejection inside of EventGenerator (Pythia)
Definition: StMCFilter.h:30
virtual void Finish() const
Finish called at the end of GEANT.
Definition: StMCFilter.h:36
static int GetNTotGT()
Number of total GT events.
Definition: StMCFilter.h:76
static void FINISH()
Print of numbers above at the end of STARSIM.
Definition: StMCFilter.cxx:172
static int GetNTotEG()
Number of total EG events.
Definition: StMCFilter.h:74