AliTOFFEEReader::AliTOFFEEReader() :
TObject(),
fFEEConfig(new AliTOFFEEConfig()),
- fChannelEnabled()
+ fChannelEnabled(),
+ fMatchingWindow()
{
/*
*
*
*/
+ Reset();
}
//_______________________________________________________________
*
*/
- if (this == &source)
- return *this;
-
TObject::operator=(source);
memcpy(fFEEConfig, source.fFEEConfig, sizeof(AliTOFFEEConfig));
return *this;
//_______________________________________________________________
+void
+AliTOFFEEReader::Reset()
+{
+ /*
+ *
+ * reset
+ *
+ */
+
+ for (Int_t iIndex = 0; iIndex < GetNumberOfIndexes(); iIndex++) {
+ fChannelEnabled[iIndex] = kFALSE;
+ fMatchingWindow[iIndex] = 0;
+ }
+}
+
+//_______________________________________________________________
+
void
AliTOFFEEReader::LoadFEEConfig(const Char_t *FileName) const
{
Int_t volume[5], index;
Int_t temp;
- ResetChannelEnabledArray();
+ Reset();
/* loop over all FEE channels */
for (Int_t iDDL = 0; iDDL < GetNumberOfDDLs(); iDDL++)
rawStream.EquipmentId2VolumeId(iDDL, iTRM + 3, iChain, iTDC, iChannel, volume);
/* swap padx and padz to fit AliTOFGeometry::GetIndex behaviour */
temp = volume[4]; volume[4] = volume[3]; volume[3] = temp;
+ /* check if index is ok */
+ if (volume[0] < 0 || volume[0] > 17 ||
+ volume[1] < 0 || volume[1] > 4 ||
+ volume[2] < 0 || volume[2] > 18 ||
+ volume[3] < 0 || volume[3] > 1 ||
+ volume[4] < 0 || volume[4] > 47)
+ continue;
/* convert detector indexes into calibration index */
index = AliTOFGeometry::GetIndex(volume);
/* check calibration index */
if (index != -1 && index < GetNumberOfIndexes()) {
/* set calibration channel enabled */
fChannelEnabled[index] = kTRUE;
+ fMatchingWindow[index] = GetMatchingWindow(iDDL, iTRM + 3, iChain, iTDC, iChannel);
nEnabled++;
}
}
}
+//_______________________________________________________________
+
+Int_t
+AliTOFFEEReader::GetMatchingWindow(Int_t iDDL, Int_t iTRM, Int_t iChain, Int_t iTDC, Int_t iChannel) const
+{
+ /*
+ *
+ * get matching window
+ *
+ * checks whether a FEE channel is enabled using the
+ * TOF FEE config object and return the associated
+ * matching window
+ *
+ */
+
+ AliTOFFEEConfig *feeConfig;
+ AliTOFCrateConfig *crateConfig;
+ AliTOFTRMConfig *trmConfig;
+ Int_t maskPB, maskTDC;
+
+ /* get and check fee config */
+ if (!(feeConfig = GetFEEConfig()))
+ return 0;
+
+ /* get and check crate config */
+ if (!(crateConfig = feeConfig->GetCrateConfig(iDDL)))
+ return 0;
+
+ /* get and check TRM config */
+ if (!(trmConfig = crateConfig->GetTRMConfig(iTRM - 3)))
+ return 0;
+
+ /* check DRM enabled */
+ if (!crateConfig->IsDRMEnabled())
+ return 0;
+
+ /* check TRM enabled */
+ if (!crateConfig->IsTRMEnabled(iTRM - 3))
+ return 0;
+
+ return trmConfig->GetMatchingWindow();
+}
+
void
AliTOFFEEReader::DumpFEEConfig()
static Int_t GetNumberOfIndexes() {return fgkNumberOfIndexes;}; // get number of indexes
AliTOFFEEConfig *GetFEEConfig() const {return fFEEConfig;}; // get FEE config
Bool_t GetChannelEnabled(Int_t iIndex) const {return iIndex < GetNumberOfIndexes() ? fChannelEnabled[iIndex] : kFALSE;}; // get channel enabled
+ Int_t GetMatchingWindow(Int_t iIndex) const {return iIndex < GetNumberOfIndexes() ? fMatchingWindow[iIndex] : 0;}; // get matching window
/* setters */
void DumpFEEConfig(); // dump FEE config
Int_t ParseFEEConfig(); // parse FEE config
void ResetChannelEnabledArray(); // reset channel enabled array
+ void Reset(); // reset channel enabled array
Bool_t IsChannelEnabled(Int_t iDDL, Int_t iTRM, Int_t iChain, Int_t iTDC, Int_t iChannel) const; // is channel enabled
Bool_t IsChannelEnabled(Int_t iIndex) const {return GetChannelEnabled(iIndex);}; // is channel enabled
+ Int_t GetMatchingWindow(Int_t iDDL, Int_t iTRM, Int_t iChain, Int_t iTDC, Int_t iChannel) const; // get matching window
private:
AliTOFFEEConfig *fFEEConfig; // FEE config
Bool_t fChannelEnabled[fgkNumberOfIndexes]; // channel enabled
+ Int_t fMatchingWindow[fgkNumberOfIndexes]; // matching window
ClassDef(AliTOFFEEReader, 1);