/* * FairMCStage.h * * Created on: Dec 1, 2009 * Author: stockman */ #ifndef FAIRMCSTAGE_H_ #define FAIRMCSTAGE_H_ #include "FairMCObject.h" #include "TObject.h" #include #include #include class FairMCStage: public FairMCObject { public: FairMCStage(); FairMCStage(Int_t id, std::string fileName, std::string branchName, Double_t weight = 1.0); FairMCStage(const FairMCStage& mcStage) : FairMCObject((FairMCObject)mcStage), fBranchName(mcStage.GetBranchName()), fFileName(mcStage.GetFileName()), fWeight(mcStage.GetWeight()), fLoaded(mcStage.GetLoaded()), fFill(mcStage.GetFill()) { } virtual ~FairMCStage(); void SetBranchName(std::string branchName) { fBranchName = branchName; } void SetFileName(std::string fileName) { fFileName = fileName; } void SetWeight(Double_t weight) { fWeight = weight; } void SetLoaded(Bool_t loaded) { fLoaded = loaded; } void SetFill(Bool_t fill) { fFill = fill; } std::string GetBranchName(void) const {return fBranchName;} std::string GetFileName(void) const {return fFileName;} Double_t GetWeight(void) const {return fWeight;} Bool_t GetLoaded(void) const {return fLoaded;} Bool_t GetFill(void) const {return fFill;} void operator=(const FairMCStage& result) { FairMCObject::operator=(result); fBranchName = result.GetBranchName(); fFileName = result.GetFileName(); fWeight = result.GetWeight(); SetStage(result.GetEntryVector()); } virtual void ClearEntries() { FairMCObject::ClearEntries(); fLoaded = kFALSE; } virtual void Print(std::ostream& out) {out << *this;} friend std::ostream& operator<< (std::ostream& out, const FairMCStage& stage) { out << stage.GetStageId() << ": " << stage.GetBranchName() << " // " << stage.GetFileName() << std::endl; //" with weight: " << stage.GetWeight() << std::endl; ((FairMCObject)stage).Print(out); return out; } private: std::string fBranchName; std::string fFileName; Double_t fWeight; Bool_t fLoaded; ///< indicates if this stage was loaded already from a Link file Bool_t fFill; ///< indicates if a corresponding DataFile with FairLinks exists to fill this stage ClassDef(FairMCStage, 1); }; #endif /* PNDMCSTAGE_H_ */