PandaRoot
PndSdsDigiStrip.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 // --------------------------------------------------------
14 // ---- PndSdsDigiStrip header file ---
15 // ---- Created 10.07.07 by Ralf Kliemt ---
16 // --------------------------------------------------------
17 
22 #ifndef PNDSDSDIGISTRIP_H
23 #define PNDSDSDIGISTRIP_H
24 
25 #include "PndSdsDigi.h"
26 #include "PndDetectorList.h"
27 
28 #include "TObject.h"
29 #include "TString.h"
30 #include <iostream>
31 
33 
39 class PndSdsDigiStrip : public PndSdsDigi {
40  public:
42 
43  PndSdsDigiStrip(std::vector<Int_t> index, Int_t detID, Int_t sensorID, Int_t fe, Int_t chan, Double_t charge, Double_t timestamp = -1);
44  PndSdsDigiStrip(Int_t index, Int_t detID, Int_t sensorID, Int_t fe, Int_t chan, Double_t charge, Double_t timestamp = -1);
46 
47  friend std::ostream &operator<<(std::ostream &out, const PndSdsDigiStrip &digi);
48 
49  // Int_t GetIndex() const { return fIndex; }
50  // Int_t GetDetID() const { return fDetID;}
51  // TString GetDetName() const { return fDetName; }
52  // Int_t GetFE() const { return fFE; }
53  Int_t GetChannel() const { return fChannel; }
54  // Int_t GetTimestamp() const { return fTimestamp; }
55  // Double_t GetCharge() const { return fCharge; }
56  // Int_t GetMCID() const { return fMCID; }
57 
58  // void SetIndex ( Int_t index ) { fIndex = index; }
59  // void SetDetID ( Int_t detID ) { fDetID = detID; }
60  // void SetDetName ( const TString& detName ) { fDetName = detName; }
61  // void SetFE ( Int_t fe ) { fFE = fe; }
62  // void SetChannel ( Int_t channel ) { fChannel = channel; }
63  // void SetCharge ( Double_t charge ) { fCharge = charge; }
64  // void SetMCID ( Int_t mcID ) { fMCID = mcID; }
65 
66  // const void Print();
67 
68  Bool_t operator==(const PndSdsDigiStrip &d2) const;
69  // Bool_t const HasNeighbour(const PndSdsDigiStrip& d2);
70 
71  virtual bool equal(FairTimeStamp *data);
72 
73  virtual bool operator<(const PndSdsDigiStrip &myDigi) const
74  {
75  if (fDetID < myDigi.GetDetID())
76  return true;
77  else if (fDetID > myDigi.GetDetID())
78  return false;
79  if (fSensorID < myDigi.GetSensorID())
80  return true;
81  else if (fSensorID > myDigi.GetSensorID())
82  return false;
83  if (fFE < myDigi.GetFE())
84  return true;
85  else if (fFE > myDigi.GetFE())
86  return false;
87  if (fChannel < myDigi.GetChannel())
88  return true;
89  else if (fChannel > myDigi.GetChannel())
90  return false;
91  return false;
92  }
93 
95  {
96  if (this != &strip) {
97  this->PndSdsDigi::operator=(strip);
98  fChannel = strip.GetChannel();
99  }
100  return *this;
101  }
102 
103  std::ostream &Print(std::ostream &out = std::cout) const
104  {
105  out << GetDetID() << " PndSds DigiStrip in sensor: " << GetSensorID() << " FE: " << GetFE() << " Channel: " << GetChannel() << " charge: " << GetCharge() << " (e or tot)"
106  << " timestamp: " << GetTimeStamp() << ", from Point(s): ";
107  std::vector<Int_t> indices = GetIndices();
108  for (unsigned int i = 0; i < indices.size(); i++) {
109  out << indices[i] << " ";
110  }
111  out << std::endl;
112  return out;
113  }
114 
115 #ifndef __CINT__ // for BOOST serialization
116  template <class Archive>
117  void serialize(Archive &ar, const unsigned int version)
118  {
119  boost::serialization::void_cast_register<PndSdsDigiStrip, PndSdsDigi>();
120  ar &boost::serialization::base_object<PndSdsDigi>(*this);
121  ar &fChannel;
122  }
123 #endif // for BOOST serialization
124 
125  private:
126 #ifndef __CINT__ // for BOOST serialization
128 #endif // for BOOST serialization
129 
130  Int_t fChannel;
131 
132  ClassDef(PndSdsDigiStrip, 6);
133 };
134 
135 #endif
PndSdsDigiStrip & operator=(const PndSdsDigiStrip &strip)
friend class boost::serialization::access
Base class for Digi information.
Definition: PndSdsDigi.h:43
Int_t fSensorID
Definition: PndSdsDigi.h:132
Bool_t operator==(const PndSdsDigiStrip &d2) const
Int_t GetChannel() const
std::vector< Int_t > GetIndices() const
Definition: PndSdsDigi.h:74
Double_t GetCharge() const
Definition: PndSdsDigi.h:72
Class for digitised strip hits.
std::ostream & Print(std::ostream &out=std::cout) const
unsigned int i
Definition: P4_F32vec4.h:33
Int_t fDetID
Definition: PndSdsDigi.h:131
virtual bool equal(FairTimeStamp *data)
virtual bool operator<(const PndSdsDigiStrip &myDigi) const
friend std::ostream & operator<<(std::ostream &out, const PndSdsDigiStrip &digi)
Int_t GetDetID() const
Definition: PndSdsDigi.h:73
Int_t fFE
Definition: PndSdsDigi.h:133
void serialize(Archive &ar, const unsigned int version)
Int_t GetSensorID() const
Definition: PndSdsDigi.h:71
Int_t GetFE() const
Definition: PndSdsDigi.h:69