EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CbmMCStage.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file CbmMCStage.h
1 /*
2  * CbmMCStage.h
3  *
4  * Created on: Dec 1, 2009
5  * Author: stockman
6  */
7 
8 #ifndef CBMMCSTAGE_H_
9 #define CBMMCSTAGE_H_
10 
11 #include "CbmDetectorList.h"
12 #include "CbmMCObject.h"
13 
14 #include<iostream>
15 
16 class CbmMCStage: public CbmMCObject {
17 public:
18  CbmMCStage();
19  CbmMCStage(DataType id, std::string fileName, std::string branchName, Double_t weight = 1.0);
20  CbmMCStage(const CbmMCStage& mcStage):
21  CbmMCObject((CbmMCObject)mcStage),
22  fBranchName(mcStage.GetBranchName()),
23  fFileName(mcStage.GetFileName()),
24  fWeight(mcStage.GetWeight()),
25  fLoaded(mcStage.GetLoaded()),
26  fFill(mcStage.GetFill())
27  {}
28 
29  virtual ~CbmMCStage();
30 
31  void SetBranchName(std::string branchName) { fBranchName = branchName; }
32  void SetFileName(std::string fileName) { fFileName = fileName; }
33  void SetWeight(Double_t weight) { fWeight = weight; }
34  void SetLoaded(Bool_t loaded) { fLoaded = loaded; }
35  void SetFill(Bool_t fill) { fFill = fill; }
36 
37  std::string GetBranchName(void) const {return fBranchName;}
38  std::string GetFileName(void) const {return fFileName;}
39  Double_t GetWeight(void) const {return fWeight;}
40  Bool_t GetLoaded(void) const {return fLoaded;}
41  Bool_t GetFill(void) const {return fFill;}
42 
43  CbmMCStage& operator=(const CbmMCStage& result){
44  CbmMCObject::operator=(result);
45  fBranchName = result.GetBranchName();
46  fFileName = result.GetFileName();
47  fWeight = result.GetWeight();
48  fLoaded = result.fLoaded;
49  fFill = result.fFill;
50  return *this;
51  // SetStage(result.GetEntryVector());
52  }
53 
54  virtual void ClearEntries()
55  {
57  fLoaded = kFALSE;
58  }
59 
60  virtual void Print(std::ostream& out){out << *this;}
61 
62  friend std::ostream& operator<< (std::ostream& out, const CbmMCStage& stage){
63  out << stage.GetStageId() << ": " << stage.GetBranchName() << " // " << stage.GetFileName() << std::endl; //" with weight: " << stage.GetWeight() << std::endl;
64  ((CbmMCObject)stage).Print(out);
65  return out;
66  }
67 
68 private:
69  std::string fBranchName;
70  std::string fFileName;
71  Double_t fWeight;
72  Bool_t fLoaded;
73  Bool_t fFill;
74 
75 
76  ClassDef(CbmMCStage, 1);
77 };
78 
79 #endif /* PNDMCSTAGE_H_ */