FairRoot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FairMCResult.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  * FairMCResult.h
10  *
11  * Created on: Dec 1, 2009
12  * Author: stockman
13  */
14 
15 #ifndef FAIRMCRESULT_H_
16 #define FAIRMCRESULT_H_
17 
18 #include "FairMCEntry.h" // for FairMCEntry
19 #include "FairMCObject.h" // for FairMCObject
20 
21 #include <Rtypes.h> // for Int_t, FairMCResult::Class, etc
22 #include <iostream> // for operator<<, ostream, etc
23 
24 class FairMCResult : public FairMCObject
25 {
26  public:
27  FairMCResult();
28  FairMCResult(Int_t start, Int_t stop);
29 
30  FairMCResult(const FairMCResult& result)
31  : FairMCObject(result.GetStartType(), result.GetEntryVector())
32  , fStartType(result.GetStartType())
33  , fStopType(result.GetStopType())
34  {}
35 
37  {
38 
39  if (this == &result) {
40  return *this;
41  }
42 
44  fStartType = result.fStartType;
45  fStopType = result.fStopType;
46 
47  return *this;
48  }
49 
50  virtual ~FairMCResult();
51 
52  void SetStartType(Int_t start) { fStartType = start; }
53  void SetStopType(Int_t stop) { fStopType = stop; }
54 
55  Int_t GetStartType(void) const { return fStartType; }
56  Int_t GetStopType(void) const { return fStopType; }
57 
58  virtual void PrintInfo(std::ostream& out = std::cout) { out << *this; }
59 
60  friend std::ostream& operator<<(std::ostream& out, const FairMCResult& result)
61  {
62  out << "MC Link from: " << result.GetStartType() << " to " << result.GetStopType() << ":" << std::endl;
63  (static_cast<FairMCObject>(result)).PrintInfo(out);
64  return out;
65  }
66 
67  private:
68  Int_t fStartType;
69  Int_t fStopType;
70 
71  ClassDef(FairMCResult, 2);
72 };
73 
74 #endif /* FairMCResult_H_ */
void SetStartType(Int_t start)
Definition: FairMCResult.h:52
void SetStopType(Int_t stop)
Definition: FairMCResult.h:53
std::vector< FairMCEntry > GetEntryVector() const
Definition: FairMCObject.h:82
friend std::ostream & operator<<(std::ostream &out, const FairMCResult &result)
Definition: FairMCResult.h:60
FairMCObject & operator=(const FairMCObject &from)
Definition: FairMCObject.h:48
virtual void PrintInfo(std::ostream &out=std::cout)
Definition: FairMCResult.h:58
Int_t GetStartType(void) const
Definition: FairMCResult.h:55
FairMCResult(const FairMCResult &result)
Definition: FairMCResult.h:30
Int_t GetStopType(void) const
Definition: FairMCResult.h:56
FairMCResult & operator=(const FairMCResult &result)
Definition: FairMCResult.h:36
virtual ~FairMCResult()