FairRoot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FairMCStage.h
Go to the documentation of this file.
1 /********************************************************************************
2  * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
3  * *
4  * This software is distributed under the terms of the *
5  * GNU Lesser General Public Licence (LGPL) version 3, *
6  * copied verbatim in the file "LICENSE" *
7  ********************************************************************************/
8 /*
9  * FairMCStage.h
10  *
11  * Created on: Dec 1, 2009
12  * Author: stockman
13  */
14 
15 #ifndef FAIRMCSTAGE_H_
16 #define FAIRMCSTAGE_H_
17 
18 #include "FairMCObject.h" // for FairMCObject
19 
20 #include <Rtypes.h> // for Bool_t, Double_t, etc
21 #include <iostream> // for ostream, basic_ostream, etc
22 #include <string> // for string, operator<<, etc
23 
24 class FairMCStage : public FairMCObject
25 {
26  public:
27  FairMCStage();
28  FairMCStage(Int_t id, const std::string& fileName, const std::string& branchName, Double_t weight = 1.0);
29 
30  FairMCStage(const FairMCStage& mcStage)
31  : FairMCObject(mcStage)
32  , fBranchName(mcStage.fBranchName)
33  , fFileName(mcStage.fFileName)
34  , fWeight(mcStage.fWeight)
35  , fLoaded(mcStage.fLoaded)
36  , fFill(mcStage.fFill)
37  {}
38 
40  {
41 
42  if (this == &result) {
43  return *this;
44  }
45 
47  fBranchName = result.fBranchName;
48  fFileName = result.fFileName;
49  fWeight = result.fWeight;
50  fLoaded = result.fLoaded;
51  fFill = result.fFill;
52 
53  return *this;
54  }
55 
56  virtual ~FairMCStage();
57 
58  void SetBranchName(const std::string& branchName) { fBranchName = branchName; }
59  void SetFileName(const std::string& fileName) { fFileName = fileName; }
60  void SetWeight(Double_t weight) { fWeight = weight; }
61  void SetLoaded(Bool_t loaded) { fLoaded = loaded; }
62  void SetFill(Bool_t fill) { fFill = fill; }
63 
64  std::string GetBranchName(void) const { return fBranchName; }
65  std::string GetFileName(void) const { return fFileName; }
66  Double_t GetWeight(void) const { return fWeight; }
67  Bool_t GetLoaded(void) const { return fLoaded; }
68  Bool_t GetFill(void) const { return fFill; }
69 
70  virtual void ClearEntries()
71  {
73  fLoaded = kFALSE;
74  }
75 
76  virtual void PrintInfo(std::ostream& out) { out << *this; }
77 
78  friend std::ostream& operator<<(std::ostream& out, const FairMCStage& stage)
79  {
80  out << stage.GetStageId() << ": " << stage.GetBranchName() << " // " << stage.GetFileName()
81  << std::endl; //" with weight: " << stage.GetWeight() << std::endl;
82  (static_cast<FairMCObject>(stage)).PrintInfo(out);
83  return out;
84  }
85 
86  private:
87  std::string fBranchName;
88  std::string fFileName;
89  Double_t fWeight;
90  Bool_t fLoaded;
91  Bool_t fFill;
92 
93  ClassDef(FairMCStage, 1);
94 };
95 
96 #endif /* FAIRMCSTAGE_H_ */
void SetWeight(Double_t weight)
Definition: FairMCStage.h:60
virtual ~FairMCStage()
Definition: FairMCStage.cxx:28
std::string GetFileName(void) const
Definition: FairMCStage.h:65
friend std::ostream & operator<<(std::ostream &out, const FairMCStage &stage)
Definition: FairMCStage.h:78
void SetFill(Bool_t fill)
Definition: FairMCStage.h:62
FairMCObject & operator=(const FairMCObject &from)
Definition: FairMCObject.h:48
void SetLoaded(Bool_t loaded)
Definition: FairMCStage.h:61
Bool_t GetFill(void) const
Definition: FairMCStage.h:68
Double_t GetWeight(void) const
Definition: FairMCStage.h:66
virtual void PrintInfo(std::ostream &out)
Definition: FairMCStage.h:76
virtual void ClearEntries()
Definition: FairMCObject.h:98
Bool_t GetLoaded(void) const
Definition: FairMCStage.h:67
void SetBranchName(const std::string &branchName)
Definition: FairMCStage.h:58
FairMCStage & operator=(const FairMCStage &result)
Definition: FairMCStage.h:39
void SetFileName(const std::string &fileName)
Definition: FairMCStage.h:59
virtual void ClearEntries()
Definition: FairMCStage.h:70
Int_t GetStageId(void) const
Definition: FairMCObject.h:76
std::string GetBranchName(void) const
Definition: FairMCStage.h:64
FairMCStage(const FairMCStage &mcStage)
Definition: FairMCStage.h:30