SetCalFlags(1,oflag,j);
}
///////////////////////////////////////////////////////////////////////////
+void AliAttrib::SetGain(Double_t gain,TString name)
+{
+// Store gain value of the name-specified attribute slot.
+//
+// This procedure involves a slot-index search based on the specified name
+// at each invokation. This may become slow in case many slots have been
+// defined and/or when this procedure is invoked many times.
+// In such cases it is preferable to use indexed addressing in the user code
+// either directly or via a few invokations of GetSlotIndex().
+
+ Int_t j=GetSlotIndex(name);
+ if (j>0) SetGain(gain,j);
+}
+///////////////////////////////////////////////////////////////////////////
void AliAttrib::SetOffset(Double_t off,Int_t j)
{
// Store offset value of the j-th (default j=1) attribute slot.
SetCalFlags(gflag,1,j);
}
///////////////////////////////////////////////////////////////////////////
+void AliAttrib::SetOffset(Double_t off,TString name)
+{
+// Store offset value of the name-specified attribute slot.
+//
+// This procedure involves a slot-index search based on the specified name
+// at each invokation. This may become slow in case many slots have been
+// defined and/or when this procedure is invoked many times.
+// In such cases it is preferable to use indexed addressing in the user code
+// either directly or via a few invokations of GetSlotIndex().
+
+ Int_t j=GetSlotIndex(name);
+ if (j>0) SetOffset(off,j);
+}
+///////////////////////////////////////////////////////////////////////////
void AliAttrib::SetCalFlags(Int_t gainflag,Int_t offsetflag,Int_t j)
{
// Store calibration flags of the j-th (default j=1) attribute slot.
return gflag;
}
///////////////////////////////////////////////////////////////////////////
+Int_t AliAttrib::GetGainFlag(TString name) const
+{
+// Provide gain flag of the name-specified attribute slot.
+//
+// flag = 1 : Gain was set
+// 0 : Gain was not set
+//
+//
+// This procedure involves a slot-index search based on the specified name
+// at each invokation. This may become slow in case many slots have been
+// defined and/or when this procedure is invoked many times.
+// In such cases it is preferable to use indexed addressing in the user code
+// either directly or via a few invokations of GetSlotIndex().
+
+ Int_t j=GetSlotIndex(name);
+ Int_t flag=0;
+ if (j>0) flag=GetGainFlag(j);
+ return flag;
+}
+///////////////////////////////////////////////////////////////////////////
Int_t AliAttrib::GetOffsetFlag(Int_t j) const
{
// Provide offset flag of the j-th (default j=1) attribute slot.
return oflag;
}
///////////////////////////////////////////////////////////////////////////
+Int_t AliAttrib::GetOffsetFlag(TString name) const
+{
+// Provide ofset flag of the name-specified attribute slot.
+//
+// flag = 1 : Offset was set
+// 0 : Offset was not set
+//
+//
+// This procedure involves a slot-index search based on the specified name
+// at each invokation. This may become slow in case many slots have been
+// defined and/or when this procedure is invoked many times.
+// In such cases it is preferable to use indexed addressing in the user code
+// either directly or via a few invokations of GetSlotIndex().
+
+ Int_t j=GetSlotIndex(name);
+ Int_t flag=0;
+ if (j>0) flag=GetOffsetFlag(j);
+ return flag;
+}
+///////////////////////////////////////////////////////////////////////////
Float_t AliAttrib::GetGain(Int_t j) const
{
// Provide gain value of the j-th (default j=1) attribute slot.
return gain;
}
///////////////////////////////////////////////////////////////////////////
+Float_t AliAttrib::GetGain(TString name) const
+{
+// Provide gain value of the name-specified attribute slot.
+//
+// This procedure involves a slot-index search based on the specified name
+// at each invokation. This may become slow in case many slots have been
+// defined and/or when this procedure is invoked many times.
+// In such cases it is preferable to use indexed addressing in the user code
+// either directly or via a few invokations of GetSlotIndex().
+
+ Int_t j=GetSlotIndex(name);
+ Float_t gain=0;
+ if (j>0) gain=GetGain(j);
+ return gain;
+}
+///////////////////////////////////////////////////////////////////////////
Float_t AliAttrib::GetOffset(Int_t j) const
{
// Provide offset value of the j-th (default j=1) attribute slot.
return offset;
}
///////////////////////////////////////////////////////////////////////////
+Float_t AliAttrib::GetOffset(TString name) const
+{
+// Provide offset value of the name-specified attribute slot.
+//
+// This procedure involves a slot-index search based on the specified name
+// at each invokation. This may become slow in case many slots have been
+// defined and/or when this procedure is invoked many times.
+// In such cases it is preferable to use indexed addressing in the user code
+// either directly or via a few invokations of GetSlotIndex().
+
+ Int_t j=GetSlotIndex(name);
+ Float_t offset=0;
+ if (j>0) offset=GetOffset(j);
+ return offset;
+}
+///////////////////////////////////////////////////////////////////////////
void AliAttrib::ResetGain(Int_t j)
{
// Reset the gain value of the j-th (default j=1) attribute slot.
}
}
///////////////////////////////////////////////////////////////////////////
+void AliAttrib::ResetGain(TString name)
+{
+// Reset the gain value of the name-specified attribute slot.
+//
+// This procedure involves a slot-index search based on the specified name
+// at each invokation. This may become slow in case many slots have been
+// defined and/or when this procedure is invoked many times.
+// In such cases it is preferable to use indexed addressing in the user code
+// either directly or via a few invokations of GetSlotIndex().
+
+ Int_t j=GetSlotIndex(name);
+ if (j>0) ResetGain(j);
+}
+///////////////////////////////////////////////////////////////////////////
void AliAttrib::ResetOffset(Int_t j)
{
// Reset the offset value of the j-th (default j=1) attribute slot.
}
}
///////////////////////////////////////////////////////////////////////////
+void AliAttrib::ResetOffset(TString name)
+{
+// Reset the offset value of the name-specified attribute slot.
+//
+// This procedure involves a slot-index search based on the specified name
+// at each invokation. This may become slow in case many slots have been
+// defined and/or when this procedure is invoked many times.
+// In such cases it is preferable to use indexed addressing in the user code
+// either directly or via a few invokations of GetSlotIndex().
+
+ Int_t j=GetSlotIndex(name);
+ if (j>0) ResetOffset(j);
+}
+///////////////////////////////////////////////////////////////////////////
void AliAttrib::DeleteCalibrations(Int_t mode)
{
// User selected delete of all gains and/or offsets.
fCalflags->AddAt(word,j-1);
}
///////////////////////////////////////////////////////////////////////////
+void AliAttrib::SetDead(TString name)
+{
+// Set the dead flag to 1 for the name-specified attribute slot.
+//
+// This procedure involves a slot-index search based on the specified name
+// at each invokation. This may become slow in case many slots have been
+// defined and/or when this procedure is invoked many times.
+// In such cases it is preferable to use indexed addressing in the user code
+// either directly or via a few invokations of GetSlotIndex().
+
+ Int_t j=GetSlotIndex(name);
+ if (j>0) SetDead(j);
+}
+///////////////////////////////////////////////////////////////////////////
void AliAttrib::SetAlive(Int_t j)
{
// Set the dead flag to 0 for the j-th (default j=1) attribute slot.
fCalflags->AddAt(word,j-1);
}
///////////////////////////////////////////////////////////////////////////
+void AliAttrib::SetAlive(TString name)
+{
+// Set the dead flag to 0 for the name-specified attribute slot.
+//
+// This procedure involves a slot-index search based on the specified name
+// at each invokation. This may become slow in case many slots have been
+// defined and/or when this procedure is invoked many times.
+// In such cases it is preferable to use indexed addressing in the user code
+// either directly or via a few invokations of GetSlotIndex().
+
+ Int_t j=GetSlotIndex(name);
+ if (j>0) SetAlive(j);
+}
+///////////////////////////////////////////////////////////////////////////
void AliAttrib::SetEdgeOn(Int_t j)
{
// Set the edge value to 1 for the j-th (default j=1) attribute slot.
SetEdgeValue(1,j);
}
///////////////////////////////////////////////////////////////////////////
+void AliAttrib::SetEdgeOn(TString name)
+{
+// Set the edge value to 1 for the name-specified attribute slot.
+//
+// This procedure involves a slot-index search based on the specified name
+// at each invokation. This may become slow in case many slots have been
+// defined and/or when this procedure is invoked many times.
+// In such cases it is preferable to use indexed addressing in the user code
+// either directly or via a few invokations of GetSlotIndex().
+
+ Int_t j=GetSlotIndex(name);
+ if (j>0) SetEdgeOn(j);
+}
+///////////////////////////////////////////////////////////////////////////
void AliAttrib::SetEdgeOff(Int_t j)
{
// Set the edge value to 0 for the j-th (default j=1) attribute slot.
SetEdgeValue(0,j);
}
///////////////////////////////////////////////////////////////////////////
+void AliAttrib::SetEdgeOff(TString name)
+{
+// Set the edge value to 0 for the name-specified attribute slot.
+//
+// This procedure involves a slot-index search based on the specified name
+// at each invokation. This may become slow in case many slots have been
+// defined and/or when this procedure is invoked many times.
+// In such cases it is preferable to use indexed addressing in the user code
+// either directly or via a few invokations of GetSlotIndex().
+
+ Int_t j=GetSlotIndex(name);
+ if (j>0) SetEdgeOff(j);
+}
+///////////////////////////////////////////////////////////////////////////
void AliAttrib::SetEdgeValue(Int_t val,Int_t j)
{
// Set the edge value to "val" for the j-th (default j=1) attribute slot.
fCalflags->AddAt(word,j-1);
}
///////////////////////////////////////////////////////////////////////////
+void AliAttrib::SetEdgeValue(Int_t val,TString name)
+{
+// Set the edge value to "val" for the name-specified attribute slot.
+//
+// This procedure involves a slot-index search based on the specified name
+// at each invokation. This may become slow in case many slots have been
+// defined and/or when this procedure is invoked many times.
+// In such cases it is preferable to use indexed addressing in the user code
+// either directly or via a few invokations of GetSlotIndex().
+
+ Int_t j=GetSlotIndex(name);
+ if (j>0) SetEdgeValue(val,j);
+}
+///////////////////////////////////////////////////////////////////////////
void AliAttrib::IncreaseEdgeValue(Int_t j)
{
// Increase the edge value by 1 for the j-th (default j=1) attribute slot.
SetEdgeValue(edge+1,j);
}
///////////////////////////////////////////////////////////////////////////
+void AliAttrib::IncreaseEdgeValue(TString name)
+{
+// Increase the edge value by 1 for the name-specified attribute slot.
+//
+// This procedure involves a slot-index search based on the specified name
+// at each invokation. This may become slow in case many slots have been
+// defined and/or when this procedure is invoked many times.
+// In such cases it is preferable to use indexed addressing in the user code
+// either directly or via a few invokations of GetSlotIndex().
+
+ Int_t j=GetSlotIndex(name);
+ if (j>0) IncreaseEdgeValue(j);
+}
+///////////////////////////////////////////////////////////////////////////
void AliAttrib::DecreaseEdgeValue(Int_t j)
{
// Decrease the edge value by 1 for the j-th (default j=1) attribute slot.
SetEdgeValue(edge-1,j);
}
///////////////////////////////////////////////////////////////////////////
+void AliAttrib::DecreaseEdgeValue(TString name)
+{
+// Decrease the edge value by 1 for the name-specified attribute slot.
+//
+// This procedure involves a slot-index search based on the specified name
+// at each invokation. This may become slow in case many slots have been
+// defined and/or when this procedure is invoked many times.
+// In such cases it is preferable to use indexed addressing in the user code
+// either directly or via a few invokations of GetSlotIndex().
+
+ Int_t j=GetSlotIndex(name);
+ if (j>0) DecreaseEdgeValue(j);
+}
+///////////////////////////////////////////////////////////////////////////
Int_t AliAttrib::GetEdgeValue(Int_t j) const
{
// Provide edge value of the j-th (default j=1) attribute slot.
return edge;
}
///////////////////////////////////////////////////////////////////////////
+Int_t AliAttrib::GetEdgeValue(TString name) const
+{
+// Provide edge value of the name-specified attribute slot.
+//
+// This procedure involves a slot-index search based on the specified name
+// at each invokation. This may become slow in case many slots have been
+// defined and/or when this procedure is invoked many times.
+// In such cases it is preferable to use indexed addressing in the user code
+// either directly or via a few invokations of GetSlotIndex().
+
+ Int_t j=GetSlotIndex(name);
+ Int_t val=0;
+ if (j>0) val=GetEdgeValue(j);
+ return val;
+}
+///////////////////////////////////////////////////////////////////////////
Int_t AliAttrib::GetDeadValue(Int_t j) const
{
// Provide dead value of the j-th (default j=1) attribute slot.
return dead;
}
///////////////////////////////////////////////////////////////////////////
+Int_t AliAttrib::GetDeadValue(TString name) const
+{
+// Provide dead value of the name-specified attribute slot.
+//
+// This procedure involves a slot-index search based on the specified name
+// at each invokation. This may become slow in case many slots have been
+// defined and/or when this procedure is invoked many times.
+// In such cases it is preferable to use indexed addressing in the user code
+// either directly or via a few invokations of GetSlotIndex().
+
+ Int_t j=GetSlotIndex(name);
+ Int_t val=0;
+ if (j>0) val=GetDeadValue(j);
+ return val;
+}
+///////////////////////////////////////////////////////////////////////////
void AliAttrib::SetSlotName(TString s,Int_t j)
{
// Set a user defined name for the j-th (default j=1) slot.
}
}
///////////////////////////////////////////////////////////////////////////
+void AliAttrib::List(TString name) const
+{
+// Provide attribute information for the name-specified slot.
+//
+// This procedure involves a slot-index search based on the specified name
+// at each invokation. This may become slow in case many slots have been
+// defined and/or when this procedure is invoked many times.
+// In such cases it is preferable to use indexed addressing in the user code
+// either directly or via a few invokations of GetSlotIndex().
+
+ Int_t j=GetSlotIndex(name);
+ if (j>0) List(j);
+}
+///////////////////////////////////////////////////////////////////////////
void AliAttrib::Load(AliAttrib& a,Int_t j)
{
// Load attributes of the j-th slot of the input AliAttrib into this AliAttrib object.
}
}
///////////////////////////////////////////////////////////////////////////
+void AliAttrib::Load(AliAttrib& a,TString name)
+{
+// Load attributes of the name-specified slot of the input AliAttrib into
+// this AliAttrib object.
+//
+// This procedure involves a slot-index search based on the specified name
+// at each invokation. This may become slow in case many slots have been
+// defined and/or when this procedure is invoked many times.
+// In such cases it is preferable to use indexed addressing in the user code
+// either directly or via a few invokations of GetSlotIndex().
+
+ Int_t j=GetSlotIndex(name);
+ if (j>0) Load(a,j);
+}
+///////////////////////////////////////////////////////////////////////////
Int_t GetNcalflags() const; // Provide the number of specified calib. flags
Int_t GetNnames() const; // Provide the maximum number of specified names
void SetGain(Double_t gain,Int_t j=1); // Set gain of the j-th attribute slot
+ void SetGain(Double_t gain,TString name); // Set gain of the name-specified attribute slot
Float_t GetGain(Int_t j=1) const; // Provide gain of the j-th attribute slot
+ Float_t GetGain(TString name) const; // Provide gain of the name-specified attribute slot
void SetOffset(Double_t off,Int_t j=1); // Set offset value of the j-th attribute slot
+ void SetOffset(Double_t off,TString name); // Set offset value of the name specified attribute slot
Float_t GetOffset(Int_t j=1) const; // Provide offset value of the j-th attribute slot
+ Float_t GetOffset(TString name) const; // Provide offset value of the name-specified attribute slot
Int_t GetGainFlag(Int_t j=1) const; // Provide gain flag of the j-th attribute slot
+ Int_t GetGainFlag(TString name) const; // Provide gain flag of the name-specified attribute slot
Int_t GetOffsetFlag(Int_t j=1) const; // Provide offset flag of the j-th attribute slot
+ Int_t GetOffsetFlag(TString name) const; // Provide offset flag of the name-specified attribute slot
void ResetGain(Int_t j=1); // Reset j-th gain value and flag
+ void ResetGain(TString name); // Reset name-specified gain value and flag
void ResetOffset(Int_t j=1); // Reset j-th offset value and flag
+ void ResetOffset(TString name); // Reset name-specified offset value and flag
void DeleteCalibrations(Int_t mode=0); // User selected delete of gains and/or offsets
void SetDead(Int_t j=1); // Indicate j-th attribute slot as 'dead'
+ void SetDead(TString name); // Indicate name-specified attribute slot as 'dead'
void SetAlive(Int_t j=1); // Indicate j-th attribute slot as 'active'
+ void SetAlive(TString name); // Indicate name-specified attribute slot as 'active'
Int_t GetDeadValue(Int_t j=1) const; // Return the 'dead flag' of the j-th attribute slot
+ Int_t GetDeadValue(TString name) const; // Return the 'dead flag' of the name-specified attribute slot
void SetEdgeOn(Int_t j=1); // Indicate j-th slot as 'detector edge module'
+ void SetEdgeOn(TString name); // Indicate name-spcified slot as 'detector edge module'
void SetEdgeOff(Int_t j=1); // Indicate j-th slot as 'detector non-edge module'
+ void SetEdgeOff(TString name); // Indicate name-specified slot as 'detector non-edge module'
void IncreaseEdgeValue(Int_t j=1); // Increase the edge value of the j-th slot by 1
+ void IncreaseEdgeValue(TString name); // Increase the edge value of the name-specified slot by 1
void DecreaseEdgeValue(Int_t j=1); // Decrease the edge value of the j-th slot by 1
+ void DecreaseEdgeValue(TString name); // Decrease the edge value of the name-specified slot by 1
void SetEdgeValue(Int_t val,Int_t j=1); // Set a specific edge value for the j-th slot
+ void SetEdgeValue(Int_t val,TString name); // Set a specific edge value for the name-specified slot
Int_t GetEdgeValue(Int_t j=1) const; // Provide the edge value of the j-th slot
+ Int_t GetEdgeValue(TString name) const; // Provide the edge value of the name-specified slot
virtual void List(Int_t j=0) const; // Printout of attribute data
+ virtual void List(TString name) const; // Printout of name-specified attribute data
virtual void Load(AliAttrib& a,Int_t j=0); // Load j-th slot or all attributes of the input AliAttrib
+ virtual void Load(AliAttrib& a,TString name);// Load name-specified slot attributes of the input AliAttrib
void SetSlotName(TString s,Int_t j=1); // Set user defined name for the j-th slot
TString GetSlotName(Int_t j=1) const; // Provide user defined name for the j-th slot
Int_t GetSlotIndex(TString name) const; // Provide the slot index of the matching name
TArrayI* fCalflags; // Flags to mark dead, edge, and gain/offset calibrated signals
TObjArray* fNames; // User defined names for the various slots
- ClassDef(AliAttrib,2) // Generic handling of detector signal (calibration) attributes.
+ ClassDef(AliAttrib,3) // Generic handling of detector signal (calibration) attributes.
};
#endif
///////////////////////////////////////////////////////////////////////////
void AliSignal::SetSignal(Double_t sig,Int_t j)
{
-// Store value in the j-th (default j=1) signal slot.
+// Store signal value for the j-th (default j=1) slot.
// Note : The first signal slot is at j=1.
// In case the value of the index j exceeds the maximum number of reserved
// slots for signal values, the number of reserved slots for the
fSignals->AddAt(float(sig),j-1);
}
///////////////////////////////////////////////////////////////////////////
+void AliSignal::SetSignal(Double_t sig,TString name)
+{
+// Store signal value for the name-specified slot.
+//
+// This procedure involves a slot-index search based on the specified name
+// at each invokation. This may become slow in case many slots have been
+// defined and/or when this procedure is invoked many times.
+// In such cases it is preferable to use indexed addressing in the user code
+// either directly or via a few invokations of GetSlotIndex().
+
+ Int_t j=GetSlotIndex(name);
+ if (j>0) SetSignal(sig,j);
+}
+///////////////////////////////////////////////////////////////////////////
void AliSignal::AddSignal(Double_t sig,Int_t j)
{
-// Add value to the j-th (default j=1) signal slot.
+// Add value to the signal of the j-th (default j=1) slot.
// Note : The first signal slot is at j=1.
// In case the value of the index j exceeds the maximum number of reserved
// slots for signal values, the number of reserved slots for the
fSignals->AddAt(sum,j-1);
}
///////////////////////////////////////////////////////////////////////////
+void AliSignal::AddSignal(Double_t sig,TString name)
+{
+// Add value to the signal of the name-specified slot.
+//
+// This procedure involves a slot-index search based on the specified name
+// at each invokation. This may become slow in case many slots have been
+// defined and/or when this procedure is invoked many times.
+// In such cases it is preferable to use indexed addressing in the user code
+// either directly or via a few invokations of GetSlotIndex().
+
+ Int_t j=GetSlotIndex(name);
+ if (j>0) AddSignal(sig,j);
+}
+///////////////////////////////////////////////////////////////////////////
Float_t AliSignal::GetSignal(Int_t j,Int_t mode) const
{
-// Provide value of the j-th (default j=1) signal slot.
+// Provide signal value of the j-th (default j=1) slot.
// Note : The first signal slot is at j=1.
// In case no signal is present or the argument j is invalid, 0 is returned.
// The parameter "mode" allows for automatic gain etc... correction of the signal.
return sig;
}
///////////////////////////////////////////////////////////////////////////
+Float_t AliSignal::GetSignal(TString name,Int_t mode) const
+{
+// Provide signal value of the name-specified slot.
+// In case no signal is present, 0 is returned.
+// The parameter "mode" allows for automatic gain etc... correction of the signal.
+//
+// mode = 0 : Just the j-th signal is returned.
+// 1 : The j-th signal is corrected for the gain, offset, dead flag etc...
+// In case the gain value was not set, gain=1 will be assumed.
+// In case the gain value was 0, a signal value of 0 is returned.
+// In case the offset value was not set, offset=0 will be assumed.
+// In case the j-th slot was marked dead, 0 is returned.
+//
+// The corrected signal (sigc) is determined as follows :
+//
+// sigc=(signal/gain)-offset
+//
+// The default is mode=0.
+//
+// This procedure involves a slot-index search based on the specified name
+// at each invokation. This may become slow in case many slots have been
+// defined and/or when this procedure is invoked many times.
+// In such cases it is preferable to use indexed addressing in the user code
+// either directly or via a few invokations of GetSlotIndex().
+
+ Int_t j=GetSlotIndex(name);
+ Float_t val=0;
+ if (j>0) val=GetSignal(j,mode);
+ return val;
+}
+///////////////////////////////////////////////////////////////////////////
void AliSignal::SetSignalError(Double_t dsig,Int_t j)
{
-// Store error for the j-th (default j=1) signal slot.
+// Store error on the signal for the j-th (default j=1) slot.
// Note : The first signal slot is at j=1.
// In case the value of the index j exceeds the maximum number of reserved
// slots for signal error values, the number of reserved slots for the
fDsignals->AddAt(float(dsig),j-1);
}
///////////////////////////////////////////////////////////////////////////
+void AliSignal::SetSignalError(Double_t dsig,TString name)
+{
+// Store error on the signal for the name-specified slot.
+//
+// This procedure involves a slot-index search based on the specified name
+// at each invokation. This may become slow in case many slots have been
+// defined and/or when this procedure is invoked many times.
+// In such cases it is preferable to use indexed addressing in the user code
+// either directly or via a few invokations of GetSlotIndex().
+
+ Int_t j=GetSlotIndex(name);
+ if (j>0) SetSignalError(dsig,j);
+}
+///////////////////////////////////////////////////////////////////////////
Float_t AliSignal::GetSignalError(Int_t j) const
{
-// Provide error of the j-th (default j=1) signal slot.
+// Provide error on the signal of the j-th (default j=1) slot.
// Note : The first signal slot is at j=1.
// In case no signal is present or the argument j is invalid, 0 is returned.
Float_t err=0;
return err;
}
///////////////////////////////////////////////////////////////////////////
+Float_t AliSignal::GetSignalError(TString name) const
+{
+// Provide error on the signal of the name-specified slot.
+//
+// This procedure involves a slot-index search based on the specified name
+// at each invokation. This may become slow in case many slots have been
+// defined and/or when this procedure is invoked many times.
+// In such cases it is preferable to use indexed addressing in the user code
+// either directly or via a few invokations of GetSlotIndex().
+
+ Int_t j=GetSlotIndex(name);
+ Float_t val=0;
+ if (j>0) val=GetSignalError(j);
+ return val;
+}
+///////////////////////////////////////////////////////////////////////////
void AliSignal::Data(TString f) const
{
// Provide all signal information within the coordinate frame f.
}
}
///////////////////////////////////////////////////////////////////////////
+void AliSignal::List(TString name) const
+{
+// Provide signal information for the name-specified slot.
+//
+// This procedure involves a slot-index search based on the specified name
+// at each invokation. This may become slow in case many slots have been
+// defined and/or when this procedure is invoked many times.
+// In such cases it is preferable to use indexed addressing in the user code
+// either directly or via a few invokations of GetSlotIndex().
+
+ Int_t j=GetSlotIndex(name);
+ if (j>0) List(j);
+}
+///////////////////////////////////////////////////////////////////////////
Int_t AliSignal::GetNvalues() const
{
// Provide the number of values for this signal.
///////////////////////////////////////////////////////////////////////////
TH1F* AliSignal::GetWaveform(Int_t j) const
{
-// Provide pointer to the j-th waveform histogram.
+// Provide pointer to the waveform histogram of the j-th slot.
TH1F* waveform=0;
if (j <= GetNwaveforms()) waveform=(TH1F*)fWaveforms->At(j-1);
return waveform;
}
///////////////////////////////////////////////////////////////////////////
+TH1F* AliSignal::GetWaveform(TString name) const
+{
+// Provide pointer to the waveform histogram of the name-specified slot.
+//
+// This procedure involves a slot-index search based on the specified name
+// at each invokation. This may become slow in case many slots have been
+// defined and/or when this procedure is invoked many times.
+// In such cases it is preferable to use indexed addressing in the user code
+// either directly or via a few invokations of GetSlotIndex().
+
+ Int_t j=GetSlotIndex(name);
+ TH1F* waveform=0;
+ if (j>0) waveform=GetWaveform(j);
+ return waveform;
+}
+///////////////////////////////////////////////////////////////////////////
void AliSignal::SetWaveform(TH1F* waveform,Int_t j)
{
-// Set the 1D waveform histogram corresponding to the j-th signal value.
+// Set the 1D waveform histogram for the j-th slot.
//
// Notes :
// The waveform of the first signal value is at j=1.
}
}
///////////////////////////////////////////////////////////////////////////
+void AliSignal::SetWaveform(TH1F* waveform,TString name)
+{
+// Set the 1D waveform histogram corresponding for the name-specified slot.
+//
+// This procedure involves a slot-index search based on the specified name
+// at each invokation. This may become slow in case many slots have been
+// defined and/or when this procedure is invoked many times.
+// In such cases it is preferable to use indexed addressing in the user code
+// either directly or via a few invokations of GetSlotIndex().
+
+ Int_t j=GetSlotIndex(name);
+ if (j>0) SetWaveform(waveform,j);
+}
+///////////////////////////////////////////////////////////////////////////
void AliSignal::ResetWaveform(Int_t j)
{
-// Reset the waveform of the j-th (default j=1) signal value.
+// Reset the waveform of the j-th (default j=1) slot.
// This memberfunction invokes TH1F::Reset() for the corresponding waveform(s).
// To actually delete the histograms from memory, use DeleteWaveform().
// Notes : The first signal value is at j=1.
}
}
///////////////////////////////////////////////////////////////////////////
+void AliSignal::ResetWaveform(TString name)
+{
+// Reset the waveform of the name-specified slot.
+//
+// This procedure involves a slot-index search based on the specified name
+// at each invokation. This may become slow in case many slots have been
+// defined and/or when this procedure is invoked many times.
+// In such cases it is preferable to use indexed addressing in the user code
+// either directly or via a few invokations of GetSlotIndex().
+
+ Int_t j=GetSlotIndex(name);
+ if (j>0) ResetWaveform(j);
+}
+///////////////////////////////////////////////////////////////////////////
void AliSignal::DeleteWaveform(Int_t j)
{
-// Delete the waveform of the j-th (default j=1) signal value.
+// Delete the waveform of the j-th (default j=1) slot.
// Notes : The first signal value is at j=1.
// j=0 ==> All waveforms will be deleted.
}
}
///////////////////////////////////////////////////////////////////////////
+void AliSignal::DeleteWaveform(TString name)
+{
+// Delete the waveform of the name-specified slot.
+//
+// This procedure involves a slot-index search based on the specified name
+// at each invokation. This may become slow in case many slots have been
+// defined and/or when this procedure is invoked many times.
+// In such cases it is preferable to use indexed addressing in the user code
+// either directly or via a few invokations of GetSlotIndex().
+
+ Int_t j=GetSlotIndex(name);
+ if (j>0) DeleteWaveform(j);
+}
+///////////////////////////////////////////////////////////////////////////
Int_t AliSignal::GetNlinks(TObject* obj,Int_t j) const
{
// Provide the number of links to the specified object for the j-th slot.
return n;
}
///////////////////////////////////////////////////////////////////////////
+Int_t AliSignal::GetNlinks(TObject* obj,TString name) const
+{
+// Provide the number of links to the specified object for the name-spec. slot.
+// If obj=0 all encountered objects for the specified slot will be counted.
+//
+// This procedure involves a slot-index search based on the specified name
+// at each invokation. This may become slow in case many slots have been
+// defined and/or when this procedure is invoked many times.
+// In such cases it is preferable to use indexed addressing in the user code
+// either directly or via a few invokations of GetSlotIndex().
+
+ Int_t j=GetSlotIndex(name);
+ Int_t n=0;
+ if (j>0) n=GetNlinks(obj,j);
+ return n;
+}
+///////////////////////////////////////////////////////////////////////////
TObject* AliSignal::GetLink(Int_t j,Int_t k) const
{
// Provide pointer of the object linked to the j-th slot at position k.
return obj;
}
///////////////////////////////////////////////////////////////////////////
+TObject* AliSignal::GetLink(TString name,Int_t k) const
+{
+// Provide pointer of the object linked to the name-spec. slot at position k.
+//
+// This procedure involves a slot-index search based on the specified name
+// at each invokation. This may become slow in case many slots have been
+// defined and/or when this procedure is invoked many times.
+// In such cases it is preferable to use indexed addressing in the user code
+// either directly or via a few invokations of GetSlotIndex().
+
+ Int_t j=GetSlotIndex(name);
+ TObject* obj=0;
+ if (j>0) obj=GetLink(j,k);
+ return obj;
+}
+///////////////////////////////////////////////////////////////////////////
void AliSignal::SetLink(TObject* obj,Int_t j,Int_t k)
{
// Introduce a link (=pointer) to an object for the j-th slot at position k.
}
}
///////////////////////////////////////////////////////////////////////////
+void AliSignal::SetLink(TObject* obj,TString name,Int_t k)
+{
+// Introduce a link (=pointer) to an object for the name-spec. slot at position k.
+// Only the pointer values are stored for (backward) reference, meaning
+// that the objects of which the pointers are stored are NOT owned
+// by the AliSignal object.
+//
+// This procedure involves a slot-index search based on the specified name
+// at each invokation. This may become slow in case many slots have been
+// defined and/or when this procedure is invoked many times.
+// In such cases it is preferable to use indexed addressing in the user code
+// either directly or via a few invokations of GetSlotIndex().
+
+ Int_t j=GetSlotIndex(name);
+ if (j>0) SetLink(obj,j,k);
+}
+///////////////////////////////////////////////////////////////////////////
void AliSignal::AddLink(TObject* obj,Int_t j)
{
// Introduce a link (=pointer) to an object for the j-th slot at the first
SetLink(obj,j,pos);
}
///////////////////////////////////////////////////////////////////////////
+void AliSignal::AddLink(TObject* obj,TString name)
+{
+// Introduce a link (=pointer) to an object for the name-spec slot at the first
+// free position.
+// Only the pointer values are stored for (backward) reference, meaning
+// that the objects of which the pointers are stored are NOT owned
+// by the AliSignal object.
+//
+// This procedure involves a slot-index search based on the specified name
+// at each invokation. This may become slow in case many slots have been
+// defined and/or when this procedure is invoked many times.
+// In such cases it is preferable to use indexed addressing in the user code
+// either directly or via a few invokations of GetSlotIndex().
+
+ Int_t j=GetSlotIndex(name);
+ if (j>0) AddLink(obj,j);
+}
+///////////////////////////////////////////////////////////////////////////
void AliSignal::ResetLink(Int_t j,Int_t k)
{
// Reset the link of the j-th slot at position k.
if (fLinks) fLinks->RemoveObject(k,j);
}
///////////////////////////////////////////////////////////////////////////
+void AliSignal::ResetLink(TString name,Int_t k)
+{
+// Reset the link of the name-specified slot at position k.
+//
+// This memberfunction is intended to reset only 1 specified link location.
+// For extended functionality, please refer to the memberfuction ResetLinks().
+//
+// This procedure involves a slot-index search based on the specified name
+// at each invokation. This may become slow in case many slots have been
+// defined and/or when this procedure is invoked many times.
+// In such cases it is preferable to use indexed addressing in the user code
+// either directly or via a few invokations of GetSlotIndex().
+
+ Int_t j=GetSlotIndex(name);
+ if (j>0) ResetLink(j,k);
+}
+///////////////////////////////////////////////////////////////////////////
void AliSignal::ResetLinks(TObject* obj,Int_t j,Int_t k)
{
// Reset single or multiple link(s) according to user specified selections.
}
}
///////////////////////////////////////////////////////////////////////////
+void AliSignal::ResetLinks(TObject* obj,TString name,Int_t k)
+{
+// Reset single or multiple link(s) according to user specified selections.
+//
+// A link is only reset if the stored reference matches the argument "obj".
+// In case obj=0 no check on the matching of the stored reference is performed
+// and the stored link is always reset in accordance with the other
+// selection criteria.
+//
+// In case the position argument "k" is specified, only the links from that
+// specified position will be deleted.
+// In case k=0 (default) no checking on the position index is performed.
+//
+// This procedure involves a slot-index search based on the specified name
+// at each invokation. This may become slow in case many slots have been
+// defined and/or when this procedure is invoked many times.
+// In such cases it is preferable to use indexed addressing in the user code
+// either directly or via a few invokations of GetSlotIndex().
+
+ Int_t j=GetSlotIndex(name);
+ if (j>0) ResetLinks(obj,j,k);
+}
+///////////////////////////////////////////////////////////////////////////
Int_t AliSignal::GetIndices(TObject* obj,TArrayI& js,TArrayI& ks) const
{
// Provide the slot and position indices of all the storage locations
return nrefs;
}
///////////////////////////////////////////////////////////////////////////
+Int_t AliSignal::GetIndices(TObject* obj,TString name,TArrayI& ks) const
+{
+// Provide the position indices of all the storage locations of the
+// specified object in the name-specified slot of this AliSignal.
+// The position indices are returned in the TArrayI array.
+// The integer return argument represents the number of storage locations which
+// were encountered for the specified object in the j-th slot.
+//
+// If obj=0 no object selection is performed and all position indices
+// of the stored references for all objects of the j-th slot are returned.
+//
+// This procedure involves a slot-index search based on the specified name
+// at each invokation. This may become slow in case many slots have been
+// defined and/or when this procedure is invoked many times.
+// In such cases it is preferable to use indexed addressing in the user code
+// either directly or via a few invokations of GetSlotIndex().
+
+ Int_t j=GetSlotIndex(name);
+ Int_t n=0;
+ if (j>0) n=GetIndices(obj,j,ks);
+ return n;
+}
+///////////////////////////////////////////////////////////////////////////
Int_t AliSignal::GetIndices(TObject* obj,TArrayI& js,Int_t k) const
{
// Provide the slot indices of all the storage locations of the
virtual ~AliSignal(); // Destructor
AliSignal(const AliSignal& s); // Copy constructor
virtual TObject* Clone(const char* name="") const; // Make a deep copy and provide its pointer
- virtual void SetSignal(Double_t sig,Int_t j=1); // Store j-th signal value
- virtual void AddSignal(Double_t sig,Int_t j=1); // Add value to j-th signal value
+ virtual void SetSignal(Double_t sig,Int_t j=1); // Store signal value for the j-th slot
+ virtual void SetSignal(Double_t sig,TString name); // Store signal value for the name-specified slot
+ virtual void AddSignal(Double_t sig,Int_t j=1); // Add value to the signal of the j-th slot
+ virtual void AddSignal(Double_t sig,TString name); // Add value to the signal of the name-specified slot
virtual Float_t GetSignal(Int_t j=1,Int_t mode=0) const; // Provide j-th (corrected) signal value
- virtual void SetSignalError(Double_t dsig,Int_t j=1); // Store error on j-th signal value
- virtual Float_t GetSignalError(Int_t j=1) const; // Provide error j-th signal value
+ virtual Float_t GetSignal(TString name,Int_t mode=0) const; // Provide name-specified (corrected) signal value
+ virtual void SetSignalError(Double_t dsig,Int_t j=1); // Store error on the signal of the j-th slot
+ virtual void SetSignalError(Double_t dsig,TString name); // Store error on the signal of the name-specified slot
+ virtual Float_t GetSignalError(Int_t j=1) const; // Provide error on the signal of the j-th slot
+ virtual Float_t GetSignalError(TString name) const; // Provide err. on the sig. of the name-specified slot
virtual void ResetSignals(Int_t mode=0); // Selective reset of signal values and/or errors
virtual void DeleteSignals(Int_t mode=0); // Selectie delete of signal values and/or errors
virtual void Reset(Int_t mode=0); // Reset signal and position values and errors
virtual void Data(TString f="car") const; // Print all signal info for coord. frame f
virtual void List(Int_t j=0) const; // Print signal info for the j-th (all) slot(s)
+ virtual void List(TString name) const; // Print signal info for the name-specified slot
Int_t GetNvalues() const; // Provide the number of signal values
Int_t GetNerrors() const; // Provide the number of specified errors
Int_t GetNwaveforms() const; // Provide the number of specified waveforms
- void SetWaveform(TH1F* waveform,Int_t j=1); // Set the j-th waveform histogram
- TH1F* GetWaveform(Int_t j=1) const; // Pointer of the j-th waveform histogram
- void ResetWaveform(Int_t j=1); // Reset the j-th waveform histogram
- void DeleteWaveform(Int_t j=1); // Delete the j-th waveform histogram
+ void SetWaveform(TH1F* waveform,Int_t j=1); // Set the waveform histogram for the j-th slot
+ void SetWaveform(TH1F* waveform,TString name); // Set the waveform histo for the name-specified slot
+ TH1F* GetWaveform(Int_t j=1) const; // Pointer to the waveform histo of the j-th slot
+ TH1F* GetWaveform(TString name) const; // Pointer to the waveform of the name-specified slot
+ void ResetWaveform(Int_t j=1); // Reset the waveform histo of the j-th slot
+ void ResetWaveform(TString name); // Reset the waveform histo of the name-specified slot
+ void DeleteWaveform(Int_t j=1); // Delete waveform histo of the j-th slot
+ void DeleteWaveform(TString name); // Delete waveform histo of the name-specified slot
Int_t GetNlinks(TObject* obj=0,Int_t j=0) const; // Number of links for the specified object
+ Int_t GetNlinks(TObject* obj,TString name) const; // Number of links for the specified object
void SetLink(TObject* obj,Int_t j=1,Int_t k=1); // Link object to the j-th slot at position k
+ void SetLink(TObject* obj,TString name,Int_t k=1); // Link object to the name-specified slot at pos. k
void AddLink(TObject* obj,Int_t j=1); // Link obj to the j-th slot at 1st free position
+ void AddLink(TObject* obj,TString name); // Link obj to the name-specified slot at 1st free pos.
TObject* GetLink(Int_t j=1,Int_t k=1) const; // Pointer of the object linked to the j-th slot
+ TObject* GetLink(TString name,Int_t k=1) const; // Pointer of object linked to the name-specified slot
Int_t GetIndices(TObject* obj,TArrayI& js,TArrayI& ks) const; // Slot and pos. indices for linked objects
Int_t GetIndices(TObject* obj,Int_t j,TArrayI& ks) const; // Pos. indices for linked objects of j-th slot
+ Int_t GetIndices(TObject* obj,TString name,TArrayI& ks) const;// Pos. indices for linked objects of name-spec. slot
Int_t GetIndices(TObject* obj,TArrayI& js,Int_t k) const; // Slot indices for linked objects at pos. k
void ResetLink(Int_t j=1,Int_t k=1); // Reset the link(s) of the j-th slot
+ void ResetLink(TString name,Int_t k=1); // Reset the link(s) of the name-specified slot
void ResetLinks(TObject* obj,Int_t j=0,Int_t k=0); // Reset link(s) to object obj for j-th slot
+ void ResetLinks(TObject* obj,TString name,Int_t k=0); // Reset link(s) to object obj for name-specified slot
void SetSwapMode(Int_t swap=1); // Set swapmode flag for the link storage
Int_t GetSwapMode() const; // Provide swapmode flag for the link storage
to enable direct use of the AliDevice linear sorting facility.
Default for AliDevice changed such that now all registered hits are by default owned
by the AliDevice object.
+06-oct-2004 NvE Full support for data access via slotname specification introduced in AliAttrib and AliSignal.