FairRoot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FairMCList.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  * FairMCList.h
10  *
11  * Created on: Dec 3, 2009
12  * Author: stockman
13  */
14 
15 #ifndef FAIRMCLIST_H_
16 #define FAIRMCLIST_H_
17 
18 #include <Rtypes.h> // for Int_t, FairMCList::Class, etc
19 #include <TObject.h> // for TObject
20 #include <vector> // for vector
21 
22 class FairMCList : public TObject
23 {
24  public:
25  FairMCList();
26  FairMCList(Int_t type, Int_t entry)
27  : TObject()
28  , fList()
29  , fEntry(entry)
30  , fType(type)
31  {}
32 
33  FairMCList(Int_t type, Int_t entry, std::vector<Int_t> list)
34  : TObject()
35  , fList(list)
36  , fEntry(entry)
37  , fType(type)
38  {}
39 
40  virtual ~FairMCList();
41 
42  void SetType(Int_t type) { fType = type; }
43  void SetEntry(Int_t entry) { fEntry = entry; }
44  void AddElement(Int_t element) { fList.push_back(element); }
45 
46  Int_t GetType() const { return fType; }
47  Int_t GetEntry() const { return fEntry; }
48  Int_t GetNElements() const { return fList.size(); }
49  Int_t GetElement(Int_t index) const { return fList.at(index); }
50  std::vector<Int_t> GetElements() const { return fList; }
51 
52  void Reset() { fList.clear(); }
53 
54  private:
55  std::vector<Int_t> fList;
56  Int_t fEntry;
57  Int_t fType;
58 
59  ClassDef(FairMCList, 1);
60 };
61 
62 #endif /* FAIRMCLIST_H_ */
Int_t GetNElements() const
Definition: FairMCList.h:48
FairMCList(Int_t type, Int_t entry)
Definition: FairMCList.h:26
FairMCList(Int_t type, Int_t entry, std::vector< Int_t > list)
Definition: FairMCList.h:33
Int_t GetEntry() const
Definition: FairMCList.h:47
virtual ~FairMCList()
Definition: FairMCList.cxx:26
void SetEntry(Int_t entry)
Definition: FairMCList.h:43
void AddElement(Int_t element)
Definition: FairMCList.h:44
Int_t GetElement(Int_t index) const
Definition: FairMCList.h:49
Int_t GetType() const
Definition: FairMCList.h:46
void SetType(Int_t type)
Definition: FairMCList.h:42
std::vector< Int_t > GetElements() const
Definition: FairMCList.h:50
void Reset()
Definition: FairMCList.h:52