PhotonSignal.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 /// \brief Photon signal class
3 /// \author jpaley@indiana.edu
4 /// \date
5 ////////////////////////////////////////////////////////////////////////
6 #ifndef PHOTONSIGNAL_H
7 #define PHOTONSIGNAL_H
8 
9 #include <iomanip>
10 #include <iosfwd>
11 #include <iostream>
12 #include <vector>
13 
14 namespace sim
15 {
16  class PhotonSignal {
17  public:
18  PhotonSignal();
19  PhotonSignal(double time, int npe);
20  ~PhotonSignal();
21 
22  void SetTimeMean(double t) { fTimeMean = t; }
23  void SetNPhoton(int npe) { fNPhoton = npe; }
24  void SetPlaneCell(int plane, int cell) { fCell = cell; fPlane = plane;}
25  void SetTrackId(int t) { fTrackId = t; }
26  void SetPoissonLambda(double l) { fPoissonLambda = l; }
27  // void Print();
28 
29  double TimeMean() const { return fTimeMean; }
30  int NPhoton() const { return fNPhoton; }
31  int Cell() const { return fCell; }
32  int Plane() const { return fPlane; }
33  int TrackId() const { return fTrackId; }
34  double PoissonLambda() const { return fPoissonLambda; }
35 
36  friend std::ostream& operator<< (std::ostream& o, const PhotonSignal& ps);
37 
38  friend bool CompareByPlaneAndCell(const sim::PhotonSignal& a,
39  const sim::PhotonSignal& b);
40  private:
41  double fTimeMean; ///< time of PEs at APD (ns)
42  int fNPhoton; ///< number of PEs in this clump
43  int fCell; ///< cell number
44  int fPlane; ///< plane number
45  int fTrackId; ///< track ID of parent
46 
47  /// \brief The mean of the distribution \ref fNPhoton was drawn from.
48  ///
49  /// Useful for calibration studies.
51  };
52 
53  /// Helper for \ref SortByPlaneAndCell
55  const sim::PhotonSignal& b);
56 
57  /// Sort \a c by plane and cell.
58  /// ie guarantees hits on the same channel are adjacent.
59  void SortByPlaneAndCell(std::vector<sim::PhotonSignal>& c);
60 
61  /// Helper for \ref SortByNPhoton
63  const sim::PhotonSignal& b);
64 
65  /// Sort \a c by number of photons. Lowerst to highest.
66  void SortByNPhoton(std::vector<sim::PhotonSignal>& c);
67 
68 } // end namespace
69 
70 #endif // PHOTONSIGNAL_H
71 //////////////////////////////////////////////////////////////////
void SetPoissonLambda(double l)
Definition: PhotonSignal.h:26
void SortByPlaneAndCell(std::vector< sim::PhotonSignal > &c)
void SetTrackId(int t)
Definition: PhotonSignal.h:25
int TrackId() const
Definition: PhotonSignal.h:33
int fCell
cell number
Definition: PhotonSignal.h:43
friend bool CompareByPlaneAndCell(const sim::PhotonSignal &a, const sim::PhotonSignal &b)
Helper for SortByPlaneAndCell.
void SortByNPhoton(std::vector< sim::PhotonSignal > &c)
Sort c by number of photons. Lowerst to highest.
int fNPhoton
number of PEs in this clump
Definition: PhotonSignal.h:42
int NPhoton() const
Definition: PhotonSignal.h:30
void SetPlaneCell(int plane, int cell)
Definition: PhotonSignal.h:24
const double a
void SetNPhoton(int npe)
Definition: PhotonSignal.h:23
int Cell() const
Definition: PhotonSignal.h:31
double fTimeMean
time of PEs at APD (ns)
Definition: PhotonSignal.h:41
Example routine for calculating the "ultimate e-m mother" of a particle in a simulated event...
Definition: FillTruth.h:15
bool CompareByNPhoton(const sim::PhotonSignal &a, const sim::PhotonSignal &b)
Helper for SortByNPhoton.
int fPlane
plane number
Definition: PhotonSignal.h:44
const hit & b
Definition: hits.cxx:21
int fTrackId
track ID of parent
Definition: PhotonSignal.h:45
double PoissonLambda() const
Definition: PhotonSignal.h:34
double fPoissonLambda
The mean of the distribution fNPhoton was drawn from.
Definition: PhotonSignal.h:50
void SetTimeMean(double t)
Definition: PhotonSignal.h:22
friend std::ostream & operator<<(std::ostream &o, const PhotonSignal &ps)
double TimeMean() const
Definition: PhotonSignal.h:29
int Plane() const
Definition: PhotonSignal.h:32