GRSISort
Created by P.C. Bender
Developement Team: P.C. Bender, R. Dunlop, V. Bildstein
An extension of the ROOT analysis Framework
TDetectorHit Class Reference

This is class that contains the basic info about detector hits:

  1. An address. The whoami for the detector. This is the value used by TChannel::GetChannel(address);
  2. An "Energy value." What this is left the parent class, but it is going to return a double.
  3. A Time value. This should be a time value common for detectors (derived from the timestamp) Units matter here, I am adobting the ns as the standard.
  4. A Position. Tvector3s are nice, they make doing geometery trival. Each hit needs one to determine where it is in space, the actual memory of the thing will be stored here. *** This is not actually needed here unless we start do waveform analysis to *** better determine where the hit is.
  5. The waveform. Since we are dealing with digital daqs, a waveform is a fairly common thing to have. It may not always be present, put it is echoed enough that the storage for it belongs here.

Definition at line 48 of file TDetectorHit.h.

Public Types

enum  EBitFlag {
  EBitFlag::kIsEnergySet = BIT(0), EBitFlag::kIsChannelSet = BIT(1), EBitFlag::kBit2 = BIT(2), EBitFlag::kBit3 = BIT(3),
  EBitFlag::kIsPPGSet = BIT(4), EBitFlag::kIsTimeSet = BIT(5), EBitFlag::kBit6 = BIT(6), EBitFlag::kBit7 = BIT(7),
  EBitFlag::kBit8 = BIT(8), EBitFlag::kDetHitBit0 = BIT(9), EBitFlag::kDetHitBit1 = BIT(10), EBitFlag::kDetHitBit2 = BIT(11),
  EBitFlag::kDetHitBit3 = BIT(12), EBitFlag::kDetHitBit4 = BIT(13), EBitFlag::kDetHitBit5 = BIT(14), EBitFlag::kDetHitBit6 = BIT(15),
  EBitFlag::kBase = BIT(9), EBitFlag::kIsAllSet = 0xFFFF
}
 
enum  ETimeFlag {
  ETimeFlag::kNoneSet = BIT(0), ETimeFlag::kCFD = BIT(1), ETimeFlag::kWalk = BIT(2), ETimeFlag::kOffset = BIT(3),
  ETimeFlag::kAll = 0xFFFF
}
 

Public Member Functions

 TDetectorHit (const int &Address=0xffffffff)
 
 TDetectorHit (const TDetectorHit &, bool copywave=true)
 
 ~TDetectorHit () override
 
virtual void Add (const TDetectorHit *)
 
void AddWaveformSample (const Short_t &x)
 
virtual void AppendTimeStamp (const Long64_t &x)
 
virtual Float_t Charge () const
 
void Clear (Option_t *opt="") override
 
void ClearChannel ()
 
void ClearEnergy ()
 
virtual void ClearTransients () const
 
void Copy (TObject &) const override
 
virtual void Copy (TObject &, bool copywave) const
 
virtual void CopyWave (TObject &) const
 
virtual UInt_t GetAddress () const
 
virtual UShort_t GetArrayNumber () const
 
virtual Float_t GetCfd () const
 
TChannelGetChannel () const
 
virtual Float_t GetCharge () const
 
virtual Int_t GetCrystal () const
 
Long64_t GetCycleTimeStamp () const
 
virtual Int_t GetDetector () const
 
virtual double GetEnergy (Option_t *opt="") const
 
virtual Double_t GetEnergyNonlinearity (double energy) const
 
virtual Short_t GetKValue () const
 
const char * GetName () const override
 
virtual TVector3 GetPosition (Double_t) const
 
virtual TVector3 GetPosition () const
 
EPpgPattern GetPPGStatus () const
 
virtual Int_t GetSegment () const
 
virtual Double_t GetTime (const ETimeFlag &correct_flag=ETimeFlag::kAll, Option_t *opt="") const
 
double GetTimeSinceTapeMove () const
 
virtual Long64_t GetTimeStamp (Option_t *="") const
 
virtual Long64_t GetTimeStampNs (Option_t *opt="") const
 
virtual Int_t GetTimeStampUnit () const
 
const std::vector< Short_t > * GetWaveform () const
 
virtual bool HasWave () const
 
bool operator< (const TDetectorHit &rhs) const
 
TDetectorHitoperator= (const TDetectorHit &)=default
 
void Print (Option_t *opt="") const override
 
virtual void Print (std::ostream &out) const
 
void SetAddress (const UInt_t &temp_address)
 
virtual void SetCfd (const Float_t &x)
 
virtual void SetCfd (const uint32_t &x)
 
virtual void SetCfd (const Int_t &x)
 
void SetCharge (const Float_t &temp_charge)
 
void SetCharge (const Int_t &temp_charge)
 
Double_t SetEnergy (const double &en) const
 
void SetHitBit (EBitFlag, Bool_t set=true) const
 
void SetKValue (const Short_t &temp_kval)
 
Double_t SetTime (const Double_t &time) const
 
virtual void SetTimeStamp (const Long64_t &x)
 
void SetWaveform (const std::vector< Short_t > &x)
 
bool TestHitBit (EBitFlag flag) const
 

Static Public Member Functions

static bool CompareEnergy (TDetectorHit *lhs, TDetectorHit *rhs)
 
static TVector3 * GetBeamDirection ()
 
static void SetPPGPtr (TPPG *ptr)
 

Protected Member Functions

Bool_t IsChannelSet () const
 
Bool_t IsEnergySet () const
 
Bool_t IsPPGSet () const
 
Bool_t IsTimeSet () const
 

Protected Attributes

UInt_t fAddress {0}
 
TTransientBits< UChar_t > fBitFlags
 
Float_t fCfd {0}
 
Float_t fCharge {0.}
 
Short_t fKValue {0}
 
Double_t fTime {0.}
 
Long64_t fTimeStamp {0}
 
std::vector< Short_t > fWaveform
 

Static Protected Attributes

static TVector3 fBeamDirection
 
static TPPGfPPG = nullptr
 

Private Attributes

TChannelfChannel {nullptr}
 
Long64_t fCycleTimeStamp {0}
 
Double_t fEnergy {0.}
 
EPpgPattern fPPGStatus {EPpgPattern::kJunk}
 

Friends

std::ostream & operator<< (std::ostream &out, const TDetectorHit &hit)
 

#include <TDetectorHit.h>

+ Inheritance diagram for TDetectorHit:
+ Collaboration diagram for TDetectorHit:

Member Enumeration Documentation

◆ EBitFlag

Enumerator
kIsEnergySet 
kIsChannelSet 
kBit2 
kBit3 
kIsPPGSet 
kIsTimeSet 
kBit6 
kBit7 
kBit8 
kDetHitBit0 
kDetHitBit1 
kDetHitBit2 
kDetHitBit3 
kDetHitBit4 
kDetHitBit5 
kDetHitBit6 
kBase 
kIsAllSet 

Definition at line 52 of file TDetectorHit.h.

◆ ETimeFlag

Enumerator
kNoneSet 
kCFD 
kWalk 
kOffset 
kAll 

Definition at line 79 of file TDetectorHit.h.

Constructor & Destructor Documentation

◆ TDetectorHit() [1/2]

TDetectorHit::TDetectorHit ( const int &  Address = 0xffffffff)

Default constructor

Definition at line 15 of file TDetectorHit.cxx.

References Clear(), and fAddress.

◆ TDetectorHit() [2/2]

TDetectorHit::TDetectorHit ( const TDetectorHit rhs,
bool  copywave = true 
)

Default Copy constructor

Definition at line 26 of file TDetectorHit.cxx.

References ClearTransients(), Copy(), and CopyWave().

◆ ~TDetectorHit()

TDetectorHit::~TDetectorHit ( )
override

Definition at line 40 of file TDetectorHit.cxx.

Member Function Documentation

◆ Add()

virtual void TDetectorHit::Add ( const TDetectorHit )
inlinevirtual

!

Reimplemented in TTdrTigressHit, TGriffinHit, TTdrCloverHit, TFippsHit, and TIfinHit.

Definition at line 187 of file TDetectorHit.h.

◆ AddWaveformSample()

void TDetectorHit::AddWaveformSample ( const Short_t &  x)
inline

!

Definition at line 121 of file TDetectorHit.h.

References fWaveform.

◆ AppendTimeStamp()

virtual void TDetectorHit::AppendTimeStamp ( const Long64_t &  x)
inlinevirtual

!

Definition at line 123 of file TDetectorHit.h.

References fTimeStamp.

◆ Charge()

virtual Float_t TDetectorHit::Charge ( ) const
inlinevirtual

◆ Clear()

◆ ClearChannel()

void TDetectorHit::ClearChannel ( )
inline

Definition at line 179 of file TDetectorHit.h.

References fChannel, kIsChannelSet, and SetHitBit().

◆ ClearEnergy()

void TDetectorHit::ClearEnergy ( )
inline

Definition at line 174 of file TDetectorHit.h.

References fEnergy, kIsEnergySet, and SetHitBit().

◆ ClearTransients()

virtual void TDetectorHit::ClearTransients ( ) const
inlinevirtual

◆ CompareEnergy()

bool TDetectorHit::CompareEnergy ( TDetectorHit lhs,
TDetectorHit rhs 
)
static

Definition at line 219 of file TDetectorHit.cxx.

References GetEnergy().

◆ Copy() [1/2]

◆ Copy() [2/2]

void TDetectorHit::Copy ( TObject &  rhs,
bool  copywave 
) const
virtual

◆ CopyWave()

◆ GetAddress()

◆ GetArrayNumber()

virtual UShort_t TDetectorHit::GetArrayNumber ( ) const
inlinevirtual

! Simply returns the detector number, overwritten for detectors that have crystals/segments

Reimplemented in TTigressHit, TTdrTigressHit, TGriffinHit, TTdrCloverHit, TGriffinBgoHit, TLaBrBgoHit, TFippsBgoHit, TFippsHit, TFippsLaBrBgoHit, TIfinBgoHit, TIfinHit, and TBgoHit.

Definition at line 166 of file TDetectorHit.h.

References GetDetector().

Referenced by MakeAnalysisHistograms().

◆ GetBeamDirection()

static TVector3* TDetectorHit::GetBeamDirection ( )
inlinestatic

Definition at line 185 of file TDetectorHit.h.

References fBeamDirection.

Referenced by TTigressHit::GetDoppler(), and TSiLiHit::GetDoppler().

◆ GetCfd()

◆ GetChannel()

◆ GetCharge()

◆ GetCrystal()

◆ GetCycleTimeStamp()

Long64_t TDetectorHit::GetCycleTimeStamp ( ) const

◆ GetDetector()

Int_t TDetectorHit::GetDetector ( ) const
virtual

!

Definition at line 192 of file TDetectorHit.cxx.

References GetChannel(), and TChannel::GetDetectorNumber().

Referenced by Addback(), TTigress::AddFragment(), TTigressHit::Compare(), TFipps::CTCorrectedEnergy(), TIfin::CTCorrectedEnergy(), TGriffin::CTCorrectedEnergy(), DefaultFippsSuppression(), DefaultGriffinSuppression(), DefaultIfinSuppression(), DefaultSuppression(), CrossTalk::FillHistograms(), TFippsHit::GetArrayNumber(), TIfinHit::GetArrayNumber(), TLaBrBgoHit::GetArrayNumber(), TFippsLaBrBgoHit::GetArrayNumber(), TGriffinBgoHit::GetArrayNumber(), TBgoHit::GetArrayNumber(), TFippsBgoHit::GetArrayNumber(), TIfinBgoHit::GetArrayNumber(), TTdrCloverHit::GetArrayNumber(), TGriffinHit::GetArrayNumber(), TTigressHit::GetArrayNumber(), TTdrTigressHit::GetArrayNumber(), GetArrayNumber(), TSharc::GetDeadLayerThickness(), TSharc::GetDetectorThickness(), TTigressHit::GetLastPosition(), TSharc::GetPadDeadLayerThickness(), TSharc::GetPadThickness(), TPinDiodeHit::GetPosition(), TEagleHit::GetPosition(), TFippsLaBrHit::GetPosition(), TFippsHit::GetPosition(), TIfinHit::GetPosition(), TPacesHit::GetPosition(), TTdrSiLiHit::GetPosition(), TTrificHit::GetPosition(), TTdrPlasticHit::GetPosition(), TLaBrHit::GetPosition(), TSceptarHit::GetPosition(), TTigress::GetPosition(), TDescantHit::GetPosition(), TTdrCloverHit::GetPosition(), TGriffinHit::GetPosition(), TTdrTigressHit::GetPosition(), TSharcHit::GetPosition(), TTrific::GetXYGrid(), main(), MakeAnalysisHistograms(), TFippsLaBrHit::Print(), TFippsHit::Print(), TIfinHit::Print(), TPinDiodeHit::Print(), TFippsTACHit::Print(), TEagleHit::Print(), TPacesHit::Print(), TTrificHit::Print(), TTdrSiLiHit::Print(), TLaBrHit::Print(), TSharcHit::Print(), TTdrPlasticHit::Print(), TTACHit::Print(), TSceptarHit::Print(), TZeroDegreeHit::Print(), TGriffinHit::Print(), TTdrCloverHit::Print(), TTdrTigressHit::Print(), TDescantHit::Print(), TTipHit::Print(), and PromptCoincidence().

◆ GetEnergy()

double TDetectorHit::GetEnergy ( Option_t *  opt = "") const
virtual

Reimplemented in TCSMHit, TSharcHit, and TSiLiHit.

Definition at line 84 of file TDetectorHit.cxx.

References TChannel::CalibrateENG(), Charge(), fEnergy, fKValue, GetChannel(), GetEnergyNonlinearity(), kIsEnergySet, SetEnergy(), TestHitBit(), and TChannel::UseCalFileIntegration().

Referenced by TFippsHit::Add(), TIfinHit::Add(), TTdrCloverHit::Add(), TGriffinHit::Add(), TTdrTigressHit::Add(), TFippsHit::CompareEnergy(), TIfinHit::CompareEnergy(), TTdrCloverHit::CompareEnergy(), TGriffinHit::CompareEnergy(), TTdrTigressHit::CompareEnergy(), CompareEnergy(), TTigressHit::CompareEnergy(), TFipps::CTCorrectedEnergy(), TIfin::CTCorrectedEnergy(), TGriffin::CTCorrectedEnergy(), DefaultFippsSuppression(), DefaultGriffinSuppression(), DefaultIfinSuppression(), DefaultSuppression(), exAnalysis(), GriffinKValueSelector::FillHistograms(), ExampleFragmentSelector::FillHistograms(), CrossTalk::FillHistograms(), TSharcHit::GetDeltaBackE(), TSharcHit::GetDeltaE(), TSharcHit::GetDeltaFrontE(), TTigressHit::GetDoppler(), TSiLiHit::GetEnergy(), TSharcHit::GetEnergy(), TSiLiHit::GetFitEnergy(), TSharcHit::GetPadE(), GetTime(), TFragment::GetTZero(), main(), MakeAnalysisHistograms(), MakeGRIFFINEnergyHsts(), operator<(), TFippsLaBrHit::Print(), TFippsHit::Print(), TIfinHit::Print(), TPinDiodeHit::Print(), TEagleHit::Print(), TFippsTACHit::Print(), TPacesHit::Print(), TTdrSiLiHit::Print(), TTrificHit::Print(), TLaBrHit::Print(), TTdrPlasticHit::Print(), TTACHit::Print(), TSceptarHit::Print(), TZeroDegreeHit::Print(), TGriffinHit::Print(), TTdrCloverHit::Print(), TTdrTigressHit::Print(), TDescantHit::Print(), TTipHit::Print(), TTigressHit::Print(), PromptCoincidence(), and TTigressHit::SumHit().

◆ GetEnergyNonlinearity()

Double_t TDetectorHit::GetEnergyNonlinearity ( double  energy) const
virtual

Definition at line 107 of file TDetectorHit.cxx.

References GetChannel(), and TChannel::GetEnergyNonlinearity().

Referenced by GetEnergy().

◆ GetKValue()

◆ GetName()

const char * TDetectorHit::GetName ( ) const
override

!

Definition at line 166 of file TDetectorHit.cxx.

References GetChannel().

Referenced by TFragment::IsDetector(), Print(), TTigressHit::Print(), and TTigressHit::SetWavefit().

◆ GetPosition() [1/2]

virtual TVector3 TDetectorHit::GetPosition ( Double_t  ) const
inlinevirtual

◆ GetPosition() [2/2]

◆ GetPPGStatus()

◆ GetSegment()

◆ GetTime()

Double_t TDetectorHit::GetTime ( const ETimeFlag correct_flag = ETimeFlag::kAll,
Option_t *  opt = "" 
) const
virtual

◆ GetTimeSinceTapeMove()

double TDetectorHit::GetTimeSinceTapeMove ( ) const

returns time in ns, minus the time of the last tape move

Definition at line 274 of file TDetectorHit.cxx.

References TSingleton< TPPG >::Get(), TPPG::GetLastStatusTime(), GetTime(), GetTimeStampNs(), and kTapeMove.

◆ GetTimeStamp()

◆ GetTimeStampNs()

Long64_t TDetectorHit::GetTimeStampNs ( Option_t *  opt = "") const
virtual

◆ GetTimeStampUnit()

Int_t TDetectorHit::GetTimeStampUnit ( ) const
virtual

!

Definition at line 233 of file TDetectorHit.cxx.

References GetChannel(), and TChannel::GetTimeStampUnit().

Referenced by GetTimeStampNs(), and Print().

◆ GetWaveform()

const std::vector<Short_t>* TDetectorHit::GetWaveform ( ) const
inline

◆ HasWave()

virtual bool TDetectorHit::HasWave ( ) const
inlinevirtual

!

Definition at line 107 of file TDetectorHit.h.

References fWaveform.

Referenced by TFragment::Print(), and TPulseAnalyzer::SetData().

◆ IsChannelSet()

Bool_t TDetectorHit::IsChannelSet ( ) const
inlineprotected

Definition at line 194 of file TDetectorHit.h.

References fBitFlags, kIsChannelSet, and TTransientBits< T >::TestBit().

Referenced by GetChannel().

◆ IsEnergySet()

Bool_t TDetectorHit::IsEnergySet ( ) const
inlineprotected

Definition at line 193 of file TDetectorHit.h.

References fBitFlags, kIsEnergySet, and TTransientBits< T >::TestBit().

◆ IsPPGSet()

Bool_t TDetectorHit::IsPPGSet ( ) const
inlineprotected

Definition at line 196 of file TDetectorHit.h.

References fBitFlags, kIsPPGSet, and TTransientBits< T >::TestBit().

Referenced by GetCycleTimeStamp(), and GetPPGStatus().

◆ IsTimeSet()

Bool_t TDetectorHit::IsTimeSet ( ) const
inlineprotected

Definition at line 195 of file TDetectorHit.h.

References fBitFlags, kIsTimeSet, and TTransientBits< T >::TestBit().

Referenced by GetTime().

◆ operator<()

bool TDetectorHit::operator< ( const TDetectorHit rhs) const
inline

Definition at line 93 of file TDetectorHit.h.

References GetEnergy().

◆ operator=()

TDetectorHit& TDetectorHit::operator= ( const TDetectorHit )
default

◆ Print() [1/2]

void TDetectorHit::Print ( Option_t *  opt = "") const
override

!

General print statement for a TDetectorHit.

Definition at line 147 of file TDetectorHit.cxx.

Referenced by TBgoHit::Print().

◆ Print() [2/2]

◆ SetAddress()

void TDetectorHit::SetAddress ( const UInt_t &  temp_address)
inline

◆ SetCfd() [1/3]

virtual void TDetectorHit::SetCfd ( const Float_t &  x)
inlinevirtual

◆ SetCfd() [2/3]

virtual void TDetectorHit::SetCfd ( const uint32_t &  x)
inlinevirtual

! this function automatically randomizes the integer provided

Definition at line 118 of file TDetectorHit.h.

References fCfd.

◆ SetCfd() [3/3]

virtual void TDetectorHit::SetCfd ( const Int_t &  x)
inlinevirtual

! this function automatically randomizes the integer provided

Definition at line 119 of file TDetectorHit.h.

References fCfd.

◆ SetCharge() [1/2]

void TDetectorHit::SetCharge ( const Float_t &  temp_charge)
inline

◆ SetCharge() [2/2]

void TDetectorHit::SetCharge ( const Int_t &  temp_charge)
inline

! this function automatically randomizes the integer provided

Definition at line 116 of file TDetectorHit.h.

References fCharge.

◆ SetEnergy()

◆ SetHitBit()

void TDetectorHit::SetHitBit ( EBitFlag  flag,
Bool_t  set = true 
) const

◆ SetKValue()

void TDetectorHit::SetKValue ( const Short_t &  temp_kval)
inline

◆ SetPPGPtr()

static void TDetectorHit::SetPPGPtr ( TPPG ptr)
inlinestatic

Definition at line 91 of file TDetectorHit.h.

References fPPG.

◆ SetTime()

Double_t TDetectorHit::SetTime ( const Double_t &  time) const
inline

◆ SetTimeStamp()

virtual void TDetectorHit::SetTimeStamp ( const Long64_t &  x)
inlinevirtual

!

Definition at line 122 of file TDetectorHit.h.

References fTimeStamp.

Referenced by TEmma::BuildHits().

◆ SetWaveform()

void TDetectorHit::SetWaveform ( const std::vector< Short_t > &  x)
inline

◆ TestHitBit()

bool TDetectorHit::TestHitBit ( EBitFlag  flag) const
inline

Definition at line 200 of file TDetectorHit.h.

References fBitFlags, and TTransientBits< T >::TestBit().

Referenced by TSiLiHit::GetEnergy(), and GetEnergy().

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  out,
const TDetectorHit hit 
)
friend

Definition at line 103 of file TDetectorHit.h.

Member Data Documentation

◆ fAddress

UInt_t TDetectorHit::fAddress {0}
protected

◆ fBeamDirection

TVector3 TDetectorHit::fBeamDirection
staticprotected

Definition at line 222 of file TDetectorHit.h.

Referenced by GetBeamDirection().

◆ fBitFlags

◆ fCfd

◆ fChannel

TChannel* TDetectorHit::fChannel {nullptr}
mutableprivate

!

Definition at line 216 of file TDetectorHit.h.

Referenced by Clear(), ClearChannel(), Copy(), and GetChannel().

◆ fCharge

Float_t TDetectorHit::fCharge {0.}
protected

charge collected from the hit

Definition at line 204 of file TDetectorHit.h.

Referenced by Charge(), Clear(), Copy(), SetCharge(), TEagleHit::TEagleHit(), and TPinDiodeHit::TPinDiodeHit().

◆ fCycleTimeStamp

Long64_t TDetectorHit::fCycleTimeStamp {0}
mutableprivate

!

Definition at line 215 of file TDetectorHit.h.

Referenced by Clear(), Copy(), GetCycleTimeStamp(), and GetPPGStatus().

◆ fEnergy

Double_t TDetectorHit::fEnergy {0.}
mutableprivate

! Energy of the Hit.

Definition at line 212 of file TDetectorHit.h.

Referenced by Clear(), ClearEnergy(), Copy(), GetEnergy(), and SetEnergy().

◆ fKValue

Short_t TDetectorHit::fKValue {0}
protected

◆ fPPG

TPPG * TDetectorHit::fPPG = nullptr
staticprotected

Definition at line 219 of file TDetectorHit.h.

Referenced by TGriffinHit::Clear(), TGriffinHit::Copy(), and SetPPGPtr().

◆ fPPGStatus

EPpgPattern TDetectorHit::fPPGStatus {EPpgPattern::kJunk}
mutableprivate

!

Definition at line 213 of file TDetectorHit.h.

Referenced by Clear(), Copy(), GetCycleTimeStamp(), and GetPPGStatus().

◆ fTime

Double_t TDetectorHit::fTime {0.}
mutableprotected

! Calibrated Time of the hit

Definition at line 209 of file TDetectorHit.h.

Referenced by Clear(), Copy(), GetTime(), and SetTime().

◆ fTimeStamp

Long64_t TDetectorHit::fTimeStamp {0}
protected

◆ fWaveform