QwAnalysis
F1TDCReferenceContainer Class Reference

#include <QwF1TDContainer.h>

Inherits TObject.

Public Member Functions

 F1TDCReferenceContainer ()
 
virtual ~F1TDCReferenceContainer ()
 
void SetSystemName (const TString name)
 
const TString GetSystemName () const
 
void AddF1TDCReferenceSignal (F1TDCReferenceSignal *in)
 
Int_t GetSize () const
 
Int_t Size () const
 
void PrintCounters ()
 
void SetReferenceSignal (Int_t bank_index, Int_t slot, Int_t chan, UInt_t data, Bool_t debug=false)
 
Double_t GetReferenceTimeAU (Int_t bank_index, TString name)
 
void ClearEventData ()
 

Data Fields

Int_t fNF1TDCReferenceSignals
 
TObjArray * fF1TDCReferenceSignalsList
 

Private Member Functions

 ClassDef (F1TDCReferenceContainer, 1)
 

Private Attributes

TString fSystemName
 

Detailed Description

Definition at line 466 of file QwF1TDContainer.h.

Constructor & Destructor Documentation

F1TDCReferenceContainer::F1TDCReferenceContainer ( )

Definition at line 2061 of file QwF1TDContainer.cc.

References fF1TDCReferenceSignalsList, and fNF1TDCReferenceSignals.

2062 {
2063  fF1TDCReferenceSignalsList = new TObjArray();
2064 
2065  fF1TDCReferenceSignalsList -> Clear();
2066  fF1TDCReferenceSignalsList -> SetOwner(kTRUE);
2067 
2068 
2070 
2071 }
TObjArray * fF1TDCReferenceSignalsList
F1TDCReferenceContainer::~F1TDCReferenceContainer ( )
virtual

Definition at line 2074 of file QwF1TDContainer.cc.

References fF1TDCReferenceSignalsList.

2075 {
2079  }
2080 }
TObjArray * fF1TDCReferenceSignalsList

Member Function Documentation

void F1TDCReferenceContainer::AddF1TDCReferenceSignal ( F1TDCReferenceSignal in)

Definition at line 2085 of file QwF1TDContainer.cc.

References fF1TDCReferenceSignalsList, and fNF1TDCReferenceSignals.

2086 {
2087  /* Int_t pos = */ fF1TDCReferenceSignalsList -> AddAtFree(in);
2088  // printf("AddF1TDCReferenceSignal at pos %d\n", pos);
2089  std::cout << *in << std::endl;
2091  return;
2092 }
TObjArray * fF1TDCReferenceSignalsList
F1TDCReferenceContainer::ClassDef ( F1TDCReferenceContainer  ,
 
)
private
void F1TDCReferenceContainer::ClearEventData ( )

Definition at line 2204 of file QwF1TDContainer.cc.

References F1TDCReferenceSignal::ClearEventData(), and fF1TDCReferenceSignalsList.

Referenced by QwDriftChamberHDC::ClearEventData(), QwDriftChamberVDC::ClearEventData(), QwSciFiDetector::ClearEventData(), and QwMainDetector::ClearEventData().

2205 {
2206 
2207  TObjArrayIter next(fF1TDCReferenceSignalsList);
2208  TObject* obj = NULL;
2209  F1TDCReferenceSignal* F1RefSignal = NULL;
2210 
2211  while ( (obj = next()) )
2212  {
2213  F1RefSignal = (F1TDCReferenceSignal*) obj;
2214  F1RefSignal->ClearEventData();
2215  }
2216 
2217  return;
2218 }
TObjArray * fF1TDCReferenceSignalsList

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Double_t F1TDCReferenceContainer::GetReferenceTimeAU ( Int_t  bank_index,
TString  name 
)

Definition at line 2168 of file QwF1TDContainer.cc.

References fF1TDCReferenceSignalsList, F1TDCReferenceSignal::GetBankIndex(), F1TDCReferenceSignal::GetRefSignalName(), F1TDCReferenceSignal::GetRefTimeAU(), and F1TDCReferenceSignal::HasRefTime().

Referenced by QwDriftChamberHDC::SubtractReferenceTimes(), QwDriftChamberVDC::SubtractReferenceTimes(), and QwSciFiDetector::SubtractReferenceTimes().

2172 {
2173  Int_t bank_idx = 0;
2174  TString ref_name = "";
2175 
2176  TObjArrayIter next(fF1TDCReferenceSignalsList);
2177  TObject* obj = NULL;
2178  F1TDCReferenceSignal* F1RefSignal = NULL;
2179 
2180  while ( (obj = next()) )
2181  {
2182  F1RefSignal = (F1TDCReferenceSignal*) obj;
2183 
2184  bank_idx = F1RefSignal->GetBankIndex();
2185  ref_name = F1RefSignal->GetRefSignalName();
2186 
2187  if( (bank_idx == bank_index) and (ref_name == name) ) {
2188  // find the reference signals,
2189  if(F1RefSignal->HasRefTime()) {
2190  // return a ref time if the reference time is filled up
2191  // can be zero.
2192  return F1RefSignal->GetRefTimeAU();
2193  }
2194  // return F1RefSignal->GetRefTimeAU();
2195  }
2196  }
2197 
2198  return 0.0; // they cannot find a reference signal for bank_index and name.
2199 }
Int_t GetBankIndex() const
TObjArray * fF1TDCReferenceSignalsList
const Double_t GetRefTimeAU() const
const TString GetRefSignalName() const

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Int_t F1TDCReferenceContainer::GetSize ( ) const
inline

Definition at line 485 of file QwF1TDContainer.h.

References fNF1TDCReferenceSignals.

const TString F1TDCReferenceContainer::GetSystemName ( ) const
inline

Definition at line 480 of file QwF1TDContainer.h.

References fSystemName.

480 {return fSystemName;};
void F1TDCReferenceContainer::PrintCounters ( )

Definition at line 2221 of file QwF1TDContainer.cc.

References fF1TDCReferenceSignalsList, fSystemName, and F1TDCReferenceSignal::PrintCounterSummary().

2222 {
2223  TObjArrayIter next(fF1TDCReferenceSignalsList);
2224  TObject* obj = NULL;
2225  F1TDCReferenceSignal* F1RefSignal = NULL;
2226 
2227 
2228  std::cout << "F1Reference Signal Counters at System " << fSystemName << std::endl;
2229  while ( (obj = next()) )
2230  {
2231  F1RefSignal = (F1TDCReferenceSignal*) obj;
2232  F1RefSignal->PrintCounterSummary();
2233  }
2234  return;
2235 };
TObjArray * fF1TDCReferenceSignalsList

+ Here is the call graph for this function:

void F1TDCReferenceContainer::SetReferenceSignal ( Int_t  bank_index,
Int_t  slot,
Int_t  chan,
UInt_t  data,
Bool_t  debug = false 
)

Definition at line 2131 of file QwF1TDContainer.cc.

References fF1TDCReferenceSignalsList, F1TDCReferenceSignal::GetBankIndex(), F1TDCReferenceSignal::GetChannelNumber(), F1TDCReferenceSignal::GetSlotNumber(), and F1TDCReferenceSignal::HasFirstHit().

Referenced by QwDriftChamberHDC::FillRawTDCWord(), QwDriftChamberVDC::FillRawTDCWord(), QwTriggerScintillator::FillRawTDCWord(), QwSciFiDetector::FillRawTDCWord(), and QwMainDetector::FillRawTDCWord().

2137 {
2138  Int_t bank_idx = 0;
2139  Int_t slot_num = 0;
2140  Int_t chan_num = 0;
2141  // Int_t time_au = 0;
2142 
2143  TObjArrayIter next(fF1TDCReferenceSignalsList);
2144  TObject* obj = NULL;
2145  F1TDCReferenceSignal* F1RefSignal = NULL;
2146 
2147  while ( (obj = next()) )
2148  {
2149  F1RefSignal = (F1TDCReferenceSignal*) obj;
2150 
2151  bank_idx = F1RefSignal->GetBankIndex();
2152  slot_num = F1RefSignal->GetSlotNumber();
2153  chan_num = F1RefSignal->GetChannelNumber();
2154 
2155  if( (bank_idx == bank_index) and (slot_num == slot) and (chan_num == chan) ) {
2156  if ( not F1RefSignal->HasFirstHit() ) {
2157  F1RefSignal -> SetRefTimeAU (data);
2158  if(debug) std::cout << *F1RefSignal << std::endl;
2159  }
2160  }
2161  }
2162 
2163  return;
2164 }
Int_t GetBankIndex() const
Int_t GetSlotNumber() const
TObjArray * fF1TDCReferenceSignalsList
Int_t GetChannelNumber() const

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void F1TDCReferenceContainer::SetSystemName ( const TString  name)

Definition at line 2239 of file QwF1TDContainer.cc.

References fSystemName.

2240 {
2241  // Types are defined in QwType.h
2242  if(fSystemName.IsNull()) {
2243  fSystemName = name;
2244  }
2245  else {
2246  std::cout << "F1TDCReferenceContainer::SetSystemName "
2247  << fSystemName
2248  << " is already registered."
2249  << std::endl;
2250  }
2251  return;
2252 }
Int_t F1TDCReferenceContainer::Size ( ) const
inline

Definition at line 486 of file QwF1TDContainer.h.

References fNF1TDCReferenceSignals.

Field Documentation

TObjArray* F1TDCReferenceContainer::fF1TDCReferenceSignalsList
Int_t F1TDCReferenceContainer::fNF1TDCReferenceSignals

Definition at line 470 of file QwF1TDContainer.h.

Referenced by AddF1TDCReferenceSignal(), F1TDCReferenceContainer(), GetSize(), and Size().

TString F1TDCReferenceContainer::fSystemName
private

Definition at line 502 of file QwF1TDContainer.h.

Referenced by GetSystemName(), PrintCounters(), and SetSystemName().


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