QwAnalysis
MeanTime Class Reference

one software meantim holder More...

#include <QwSoftwareMeantime.h>

Inherits TObject.

Public Member Functions

 MeanTime ()
 
 MeanTime (TString name, Long64_t ev_id, Double_t p_in, Double_t n_in, Int_t p_id, Int_t n_id)
 
virtual ~MeanTime ()
 
Bool_t HasMeanTime ()
 
Double_t GetMeanTime () const
 
Double_t GetSubtractTime () const
 
Double_t GetDiffHardSoftMeanTime () const
 
Double_t GetPositiveValue () const
 
Double_t GetNegativeValue () const
 
const Int_t GetSoftwareMeantimeHitElement () const
 
const Int_t GetSoftwarePositiveHitElement () const
 
const Int_t GetSoftwareNegativeHitElement () const
 
const Int_t GetSoftwareSubtractHitElement () const
 
Int_t GetPositiveHitId () const
 
Int_t GetNegativeHitId () const
 
Int_t GetMeanTimeId () const
 
Int_t GetPlane () const
 
void AddPNValues (Double_t p_value, Double_t n_value, Int_t p_id, Int_t n_id)
 
void SetDetectorType (TString d_type)
 
void SetMeanTimeId (Int_t id)
 
void SetPlane (Int_t in)
 
void SetHardwareMeanTime (Double_t hardware_meantime)
 
void Print (Bool_t on)
 
Bool_t IsInTimeWindow (Double_t time_window)
 
Bool_t IsHitIDsMatch ()
 
void ClearEventData ()
 

Private Member Functions

 ClassDef (MeanTime, 0)
 

Private Attributes

Bool_t fHasValue
 
Double_t fMeanTime
 
Double_t fSubtractTime
 
Double_t fDiffHardSoftMeanTime
 
Double_t fHardWareMeanTime
 
Double_t fPositiveValue
 
Double_t fNegativeValue
 
Int_t fPositiveHitId
 
Int_t fNegativeHitId
 
Int_t fMeanTimeId
 
Long64_t fEventId
 
TString fDetectorType
 
Int_t fPlane
 

Static Private Attributes

static const Int_t fSoftwareMeantimeHitElementID = 3
 
static const Int_t fSoftwarePositiveHitElementID = 4
 
static const Int_t fSoftwareNegativeHitElementID = 5
 
static const Int_t fSoftwareSubtractHitElementID = 6
 

Detailed Description

one software meantim holder

Definition at line 33 of file QwSoftwareMeantime.h.

Constructor & Destructor Documentation

MeanTime::MeanTime ( )

Definition at line 21 of file QwSoftwareMeantime.cc.

References fDetectorType, fDiffHardSoftMeanTime, fEventId, fHardWareMeanTime, fHasValue, fMeanTime, fMeanTimeId, fNegativeHitId, fNegativeValue, fPositiveHitId, fPositiveValue, and fSubtractTime.

22 {
23 
24  fMeanTime = 0.0;
25  fSubtractTime = 0.0;
26 
27  fPositiveValue = 0.0;
28  fNegativeValue = 0.0;
29 
30  fDiffHardSoftMeanTime = 0.0; // Hardware MT - Software MT
31  fHardWareMeanTime = 0.0;
32 
33  fPositiveHitId = 0;
34  fNegativeHitId = 0;
35  fMeanTimeId = 0;
36 
37  fEventId = 0;
38  fDetectorType = "";
39  fHasValue = false;
40 
41 };
Int_t fNegativeHitId
Bool_t fHasValue
Double_t fDiffHardSoftMeanTime
TString fDetectorType
Double_t fSubtractTime
Int_t fPositiveHitId
Double_t fHardWareMeanTime
Double_t fNegativeValue
Double_t fMeanTime
Long64_t fEventId
Double_t fPositiveValue
MeanTime::MeanTime ( TString  name,
Long64_t  ev_id,
Double_t  p_in,
Double_t  n_in,
Int_t  p_id,
Int_t  n_id 
)

Definition at line 44 of file QwSoftwareMeantime.cc.

References AddPNValues(), fDetectorType, fDiffHardSoftMeanTime, fEventId, and fHardWareMeanTime.

45 {
46  fDetectorType = name;
47  fEventId = ev_id;
48  fDiffHardSoftMeanTime = 0.0;
49  fHardWareMeanTime = 0.0;
50 
51 
52  AddPNValues(p_in, n_in, p_id, n_id);
53 };
Double_t fDiffHardSoftMeanTime
TString fDetectorType
Double_t fHardWareMeanTime
void AddPNValues(Double_t p_value, Double_t n_value, Int_t p_id, Int_t n_id)
Long64_t fEventId

+ Here is the call graph for this function:

MeanTime::~MeanTime ( )
virtual

Definition at line 56 of file QwSoftwareMeantime.cc.

57 {
58 };

Member Function Documentation

void MeanTime::AddPNValues ( Double_t  p_value,
Double_t  n_value,
Int_t  p_id,
Int_t  n_id 
)

Definition at line 61 of file QwSoftwareMeantime.cc.

References fHasValue, fMeanTime, fNegativeHitId, fNegativeValue, fPositiveHitId, fPositiveValue, and fSubtractTime.

Referenced by MeanTime().

62 {
63  fPositiveValue = p_value;
64  fNegativeValue = n_value;
65 
66  fPositiveHitId = p_id;
67  fNegativeHitId = n_id;
68 
71 
72  fHasValue = true;
73 
74  return;
75 }
Int_t fNegativeHitId
Bool_t fHasValue
Double_t fSubtractTime
Int_t fPositiveHitId
Double_t fNegativeValue
Double_t fMeanTime
Double_t fPositiveValue

+ Here is the caller graph for this function:

MeanTime::ClassDef ( MeanTime  ,
 
)
private
void MeanTime::ClearEventData ( )

Definition at line 145 of file QwSoftwareMeantime.cc.

References fDiffHardSoftMeanTime, fEventId, fHardWareMeanTime, fHasValue, fMeanTime, fMeanTimeId, fNegativeHitId, fNegativeValue, fPositiveHitId, fPositiveValue, and fSubtractTime.

Referenced by MeanTimeContainer::ClearEventData().

146 {
147  fHasValue = false;
148 
149  fMeanTime = 0.0;
150  fSubtractTime = 0.0;
151 
152  fDiffHardSoftMeanTime = 0.0;
153  fHardWareMeanTime = 0.0;
154 
155  fPositiveValue = 0.0;
156  fNegativeValue = 0.0;
157 
158  fPositiveHitId = 0;
159  fNegativeHitId = 0;
160  fMeanTimeId = 0;
161 
162  fEventId = 0;
163 
164  return;
165 }
Int_t fNegativeHitId
Bool_t fHasValue
Double_t fDiffHardSoftMeanTime
Double_t fSubtractTime
Int_t fPositiveHitId
Double_t fHardWareMeanTime
Double_t fNegativeValue
Double_t fMeanTime
Long64_t fEventId
Double_t fPositiveValue

+ Here is the caller graph for this function:

Double_t MeanTime::GetDiffHardSoftMeanTime ( ) const
inline

Definition at line 47 of file QwSoftwareMeantime.h.

References fDiffHardSoftMeanTime.

47 { return fDiffHardSoftMeanTime; };
Double_t fDiffHardSoftMeanTime
Double_t MeanTime::GetMeanTime ( ) const
inline

Definition at line 44 of file QwSoftwareMeantime.h.

References fMeanTime.

Referenced by MeanTimeContainer::GetMeanTime().

44 { return fMeanTime; };
Double_t fMeanTime

+ Here is the caller graph for this function:

Int_t MeanTime::GetMeanTimeId ( ) const
inline

Definition at line 60 of file QwSoftwareMeantime.h.

References fMeanTimeId.

Referenced by MeanTimeContainer::GetMeanTime(), MeanTimeContainer::GetMeanTimeObject(), and MeanTimeContainer::MatchHardwareMeanTime().

60 { return fMeanTimeId; };

+ Here is the caller graph for this function:

Int_t MeanTime::GetNegativeHitId ( ) const
inline

Definition at line 58 of file QwSoftwareMeantime.h.

References fNegativeHitId.

58 { return fNegativeHitId; };
Int_t fNegativeHitId
Double_t MeanTime::GetNegativeValue ( ) const
inline

Definition at line 50 of file QwSoftwareMeantime.h.

References fNegativeValue.

50 { return fNegativeValue; };
Double_t fNegativeValue
Int_t MeanTime::GetPlane ( ) const
inline

Definition at line 61 of file QwSoftwareMeantime.h.

References fPlane.

Referenced by QwMainDetector::AddSoftwareMeantimeToHits(), and QwTriggerScintillator::AddSoftwareMeantimeToHits().

61 { return fPlane;};

+ Here is the caller graph for this function:

Int_t MeanTime::GetPositiveHitId ( ) const
inline

Definition at line 57 of file QwSoftwareMeantime.h.

References fPositiveHitId.

57 { return fPositiveHitId; };
Int_t fPositiveHitId
Double_t MeanTime::GetPositiveValue ( ) const
inline

Definition at line 49 of file QwSoftwareMeantime.h.

References fPositiveValue.

49 { return fPositiveValue; };
Double_t fPositiveValue
const Int_t MeanTime::GetSoftwareMeantimeHitElement ( ) const
inline

Definition at line 52 of file QwSoftwareMeantime.h.

References fSoftwareMeantimeHitElementID.

static const Int_t fSoftwareMeantimeHitElementID
const Int_t MeanTime::GetSoftwareNegativeHitElement ( ) const
inline

Definition at line 54 of file QwSoftwareMeantime.h.

References fSoftwareNegativeHitElementID.

static const Int_t fSoftwareNegativeHitElementID
const Int_t MeanTime::GetSoftwarePositiveHitElement ( ) const
inline

Definition at line 53 of file QwSoftwareMeantime.h.

References fSoftwarePositiveHitElementID.

static const Int_t fSoftwarePositiveHitElementID
const Int_t MeanTime::GetSoftwareSubtractHitElement ( ) const
inline

Definition at line 55 of file QwSoftwareMeantime.h.

References fSoftwareSubtractHitElementID.

static const Int_t fSoftwareSubtractHitElementID
Double_t MeanTime::GetSubtractTime ( ) const
inline

Definition at line 45 of file QwSoftwareMeantime.h.

References fSubtractTime.

45 { return fSubtractTime; };
Double_t fSubtractTime
Bool_t MeanTime::HasMeanTime ( )
inline

Definition at line 42 of file QwSoftwareMeantime.h.

References fHasValue.

42 {return fHasValue;};
Bool_t fHasValue
Bool_t MeanTime::IsHitIDsMatch ( )

Definition at line 125 of file QwSoftwareMeantime.cc.

References fNegativeHitId, and fPositiveHitId.

126 {
127  Bool_t status = false;
128  status = ( fPositiveHitId == fNegativeHitId ) ? true : false;
129  return status;
130 };
Int_t fNegativeHitId
Int_t fPositiveHitId
Bool_t MeanTime::IsInTimeWindow ( Double_t  time_window)

Definition at line 116 of file QwSoftwareMeantime.cc.

References fSubtractTime.

Referenced by MeanTimeContainer::AddMeanTime().

117 {
118  Bool_t status = false;
119  status = ( fabs(fSubtractTime) < time_window ) ? true : false;
120  return status;
121 };
Double_t fSubtractTime

+ Here is the caller graph for this function:

void MeanTime::Print ( Bool_t  on = true)

Definition at line 79 of file QwSoftwareMeantime.cc.

References fDetectorType, fEventId, fHardWareMeanTime, fMeanTime, fMeanTimeId, fNegativeHitId, fNegativeValue, fPlane, fPositiveHitId, fPositiveValue, and fSubtractTime.

Referenced by MeanTimeContainer::Print().

80 {
81  if (!on) return;
82 
83  TString output = "";
84  if (fDetectorType == "MD") output += "<<";
85  else if(fDetectorType == "TS") output += ">>";
86 
87  output += fDetectorType;
88 
89  if (fDetectorType == "MD") output += fPlane;
90  else if(fDetectorType == "TS") output += fPlane;
91 
92  output += Form("-- ID %d ------Event ", fMeanTimeId);
93  output += fEventId;
94  output += ": HitIndex[";
95  output += fPositiveHitId;
96  output += ",";
97  output += fNegativeHitId;
98  output += "]";
99 
100  if (fDetectorType == "MD") {
101  output += Form( " MDp%+9.2f MDm%+9.2f dMD%+9.2f MDsMT %+10.2f << ---------------------------- <<",
103  }
104  else if (fDetectorType == "TS") {
105  output += Form( " TSp%+9.2f TSm%+9.2f dTS%+9.2f TSsMT %+10.2f TShMT %+10.2f dTSMT %+8.2f >>",
107  }
108 
109  printf("%s\n", output.Data());
110 
111  return;
112 };
Int_t fNegativeHitId
TString fDetectorType
Double_t fSubtractTime
Int_t fPositiveHitId
Double_t fHardWareMeanTime
Double_t fNegativeValue
Double_t fMeanTime
Long64_t fEventId
Double_t fPositiveValue

+ Here is the caller graph for this function:

void MeanTime::SetDetectorType ( TString  d_type)
inline

Definition at line 64 of file QwSoftwareMeantime.h.

References fDetectorType.

64 {fDetectorType = d_type;};
TString fDetectorType
void MeanTime::SetHardwareMeanTime ( Double_t  hardware_meantime)

Definition at line 135 of file QwSoftwareMeantime.cc.

References fDiffHardSoftMeanTime, fHardWareMeanTime, and fMeanTime.

Referenced by MeanTimeContainer::MatchHardwareMeanTime().

136 {
137  fHardWareMeanTime = hardware_meantime;
139  return;
140 }
Double_t fDiffHardSoftMeanTime
Double_t fHardWareMeanTime
Double_t fMeanTime

+ Here is the caller graph for this function:

void MeanTime::SetMeanTimeId ( Int_t  id)
inline

Definition at line 65 of file QwSoftwareMeantime.h.

References fMeanTimeId.

65 {fMeanTimeId = id;};
void MeanTime::SetPlane ( Int_t  in)
inline

Definition at line 66 of file QwSoftwareMeantime.h.

References fPlane, and Qw::in.

66 {fPlane = in;};
static const double in
Definition: QwUnits.h:66

Field Documentation

TString MeanTime::fDetectorType
private

Definition at line 94 of file QwSoftwareMeantime.h.

Referenced by MeanTime(), Print(), and SetDetectorType().

Double_t MeanTime::fDiffHardSoftMeanTime
private
Long64_t MeanTime::fEventId
private

Definition at line 93 of file QwSoftwareMeantime.h.

Referenced by ClearEventData(), MeanTime(), and Print().

Double_t MeanTime::fHardWareMeanTime
private

Definition at line 84 of file QwSoftwareMeantime.h.

Referenced by ClearEventData(), MeanTime(), Print(), and SetHardwareMeanTime().

Bool_t MeanTime::fHasValue
private

Definition at line 79 of file QwSoftwareMeantime.h.

Referenced by AddPNValues(), ClearEventData(), HasMeanTime(), and MeanTime().

Double_t MeanTime::fMeanTime
private
Int_t MeanTime::fMeanTimeId
private

Definition at line 91 of file QwSoftwareMeantime.h.

Referenced by ClearEventData(), GetMeanTimeId(), MeanTime(), Print(), and SetMeanTimeId().

Int_t MeanTime::fNegativeHitId
private
Double_t MeanTime::fNegativeValue
private

Definition at line 87 of file QwSoftwareMeantime.h.

Referenced by AddPNValues(), ClearEventData(), GetNegativeValue(), MeanTime(), and Print().

Int_t MeanTime::fPlane
private

Definition at line 95 of file QwSoftwareMeantime.h.

Referenced by GetPlane(), Print(), and SetPlane().

Int_t MeanTime::fPositiveHitId
private
Double_t MeanTime::fPositiveValue
private

Definition at line 86 of file QwSoftwareMeantime.h.

Referenced by AddPNValues(), ClearEventData(), GetPositiveValue(), MeanTime(), and Print().

const Int_t MeanTime::fSoftwareMeantimeHitElementID = 3
staticprivate

Definition at line 97 of file QwSoftwareMeantime.h.

Referenced by GetSoftwareMeantimeHitElement().

const Int_t MeanTime::fSoftwareNegativeHitElementID = 5
staticprivate

Definition at line 99 of file QwSoftwareMeantime.h.

Referenced by GetSoftwareNegativeHitElement().

const Int_t MeanTime::fSoftwarePositiveHitElementID = 4
staticprivate

Definition at line 98 of file QwSoftwareMeantime.h.

Referenced by GetSoftwarePositiveHitElement().

const Int_t MeanTime::fSoftwareSubtractHitElementID = 6
staticprivate

Definition at line 100 of file QwSoftwareMeantime.h.

Referenced by GetSoftwareSubtractHitElement().

Double_t MeanTime::fSubtractTime
private

The documentation for this class was generated from the following files: