FairRoot/PandaRoot
PndSciTHit.cxx
Go to the documentation of this file.
1 // -------------------------------------------------------------------------
2 // ----- SciTHit source file -----
3 // created by A. Sanchez
4 // modified by D. Steinschaden
5 // last update 05.2015
6 // -------------------------------------------------------------------------
7 
8 
9 #include <iostream>
10 #include "PndSciTHit.h"
11 
12 
13 // ----- Operator overload ----------------------------------------------
15  out << "PndSciTHit in Sensor: " << hit.GetDetectorID();
16  return out;
17 }
18 
19 bool PndSciTHit::operator< (const PndSciTHit& right) const{
20 
21  if (fDetectorID < right.GetDetectorID()) return true;
22  else if (fDetectorID > right.GetDetectorID()) return false;
23  //If ID = right.ID
24  return false;
25 }
26 
27 bool PndSciTHit::operator> (const PndSciTHit& right) const{
28 
29  if (fDetectorID > right.GetDetectorID()) return true;
30  else if (fDetectorID < right.GetDetectorID()) return false;
31  //If ID = right.ID
32  return false;
33 }
34 
35 bool PndSciTHit::equal(FairTimeStamp* data){
36  PndSciTHit* hit = dynamic_cast <PndSciTHit*> (data);
37  if (hit != 0 && fDetectorID == hit->GetDetectorID())
38  return true;
39 
40  return false;
41 }
42 
43 // ----- Default constructor -------------------------------------------
45  fDetName(""),
46  fCharge(0.),
47  fSiPm1(0.),
48  fDSiPm1(0.),
49  fSiPm2(0.),
50  fDSiPm2(0.)
51 {
52 }
53 // -------------------------------------------------------------------------
54 
55 // ----- Standard constructor ------------------------------------------
56 PndSciTHit::PndSciTHit(Int_t detID, TString detName, Double_t time, Double_t dt,
57  Double_t sipm1, Double_t dsipm1,Double_t sipm2, Double_t dsipm2,
58  TVector3& pos,TVector3& dpos,Int_t index, Double_t charge)
59  : FairHit(detID, pos, dpos, index),
60  fDetName(detName), fCharge(charge),
61  fSiPm1(sipm1), fDSiPm1(dsipm1), fSiPm2(sipm2), fDSiPm2(dsipm2)
62 {
63  SetTimeStamp(time);
64  SetTimeStampError(dt);
65 
66  SetLink(FairLink(-1, -1, "SciTPoint", index));
67 }
68 
69 // -------------------------------------------------------------------------
70 
71 // ----- Destructor ----------------------------------------------------
73 // -------------------------------------------------------------------------
74 
75 // ----- Public method Print -------------------------------------------
76 void PndSciTHit::Print(const Option_t* opt) const {
77  std::cout << "Forward tof hit in detector " << fDetName << " at ("
78  << fX << ", " << fY << ", " << fZ << ") cm "
79  << ", Point " << fRefIndex << "opt="<<opt<<std::endl;
80 }
81 // -------------------------------------------------------------------------
TVector3 pos
virtual bool equal(FairTimeStamp *data)
Definition: PndSciTHit.cxx:35
virtual bool operator>(const PndSciTHit &right) const
Definition: PndSciTHit.cxx:27
Double_t fX
Definition: PndCaloDraw.cxx:34
Double_t fZ
Definition: PndCaloDraw.cxx:34
virtual void Print(const Option_t *opt=0) const
Definition: PndSciTHit.cxx:76
Double_t
TFile * out
Definition: reco_muo.C:20
TString fDetName
Definition: PndSciTHit.h:94
int hit(Int_t nEvents=0, TString inFile="sim.root", TString parFile="par.root", TString inDigi="digi.root", TString outFile="hit.root", Int_t timeBased=0)
Definition: hit.C:1
virtual bool operator<(const PndSciTHit &right) const
Definition: PndSciTHit.cxx:19
Double_t fY
Definition: PndCaloDraw.cxx:34
std::ostream & operator<<(std::ostream &out, PndSciTHit &hit)
Definition: PndSciTHit.cxx:14
ClassImp(PndAnaContFact)
virtual ~PndSciTHit()
Definition: PndSciTHit.cxx:72