/home/docs/checkouts/readthedocs.org/user_builds/ratpac/checkouts/latest/src/ds/include/RAT/DS/MCPMT.hh Source File

Ratpac-two: /home/docs/checkouts/readthedocs.org/user_builds/ratpac/checkouts/latest/src/ds/include/RAT/DS/MCPMT.hh Source File
Ratpac-two
MCPMT.hh
1 
11 #ifndef __RAT_DS_MCPMT__
12 #define __RAT_DS_MCPMT__
13 
14 #include <RAT/DS/MCPhoton.hh>
15 #include <RAT/Log.hh>
16 #include <vector>
17 
18 namespace RAT {
19 namespace DS {
20 
21 class MCPMT : public TObject {
22  public:
23  MCPMT() : TObject() {}
24  virtual ~MCPMT() {}
25 
27  virtual Int_t GetID() const { return id; };
28  virtual void SetID(Int_t _id) { id = _id; };
29 
31  virtual Double_t GetCharge() const;
32 
34  virtual std::string GetCreatorProcess() const;
35 
37  virtual Int_t GetType() const { return type; };
38  virtual void SetType(Int_t _type) { type = _type; };
39 
41  MCPhoton *GetMCPhoton(Int_t i) { return &photon[i]; }
42  Int_t GetMCPhotonCount() const { return photon.size(); }
43  MCPhoton *AddNewMCPhoton() {
44  photon.resize(photon.size() + 1);
45  return &photon.back();
46  }
47  void RemoveMCPhoton(Int_t i) { photon.erase(photon.begin() + i); }
48  void PruneMCPhoton() { photon.resize(0); }
49  void SortMCPhotons() { std::sort(photon.begin(), photon.end()); }
50 
51  void PruneNoiseMCPhotons() {
52  photon.erase(std::remove_if(photon.begin(), photon.end(), [](const MCPhoton ph) { return ph.IsDarkHit(); }),
53  photon.end());
54  }
55  void PruneAfterPulseMCPhotons() {
56  photon.erase(std::remove_if(photon.begin(), photon.end(), [](const MCPhoton ph) { return ph.IsAfterPulse(); }),
57  photon.end());
58  }
59 
60  ClassDef(MCPMT, 3);
61 
62  protected:
63  Int_t id;
64  Int_t type;
65  std::vector<MCPhoton> photon;
66 };
67 
68 } // namespace DS
69 } // namespace RAT
70 
71 #endif
Definition: MCPMT.hh:21
virtual Double_t GetCharge() const
Definition: MCPMT.cc:18
virtual std::string GetCreatorProcess() const
Definition: MCPMT.cc:6
MCPhoton * GetMCPhoton(Int_t i)
Definition: MCPMT.hh:41
virtual Int_t GetID() const
Definition: MCPMT.hh:27
virtual Int_t GetType() const
Definition: MCPMT.hh:37
Definition: MCPhoton.hh:25
Definition: CCCrossSecMessenger.hh:29