// $Id$
// $MpId: AliMpBusPatch.cxx,v 1.4 2006/05/24 13:58:34 ivana Exp $
-//
-// --------------------
+
+//-----------------------------------------------------------------------------
// Class AliMpBusPatch
// --------------------
// The class defines the properties of BusPatch
// Author: Ivana Hrivnacova, IPN Orsay
+//-----------------------------------------------------------------------------
#include "AliMpBusPatch.h"
+
+#include "AliDAQ.h"
#include "AliMpConstants.h"
#include "AliMpDEManager.h"
#include "AliMpSegmentation.h"
-#include "AliMpSlatSegmentation.h"
#include "AliMpSlat.h"
#include "AliMpPCB.h"
#include "AliMpMotifPosition.h"
fDdlId(ddlId),
fManus(false),
fNofManusPerModule(false),
- fCableLength(-1)
+ fCableLength(-1),
+ fCableLabel(),
+ fTranslatorLabel(),
+ fFrtId(0)
{
/// Standard constructor
}
fId(),
fDEId(),
fDdlId(),
- fManus(),
+ fManus(false),
fNofManusPerModule(false),
- fCableLength(-1)
+ fCableLength(-1),
+ fCableLabel(),
+ fTranslatorLabel(),
+ fFrtId(0)
{
/// Root IO constructor
}
/// - for stations 2 there maximum two PCBs per buspatch,
/// - for slat stations there are maximum three PCBs per buspatch
- if ( AliMpDEManager::GetStationType(fDEId) == AliMp::kStation1) {
+ if ( AliMpDEManager::GetStation12Type(fDEId) == AliMq::kStation1) {
// simply fill the number of manus, no bridge for station 1
return true;
}
- if ( AliMpDEManager::GetStationType(fDEId) == AliMp::kStation2) {
+ if ( AliMpDEManager::GetStation12Type(fDEId) == AliMq::kStation2) {
// there is max two patch modules per buspatch
if ( AliMpDEManager::GetStationType(fDEId) == AliMp::kStation345 ) {
- const AliMpSlatSegmentation* seg0
- = static_cast<const AliMpSlatSegmentation*>(
- AliMpSegmentation::Instance()->GetMpSegmentation(fDEId, AliMp::kCath0));
-
- const AliMpSlatSegmentation* seg1
- = static_cast<const AliMpSlatSegmentation*>(
- AliMpSegmentation::Instance()->GetMpSegmentation(fDEId, AliMp::kCath1));
-
- const AliMpSlat* slat0 = seg0->Slat();
- const AliMpSlat* slat1 = seg1->Slat();
+ const AliMpSlat* kSlat0
+ = AliMpSegmentation::Instance()->GetSlat(fDEId, AliMp::kCath0);
+ const AliMpSlat* kSlat1
+ = AliMpSegmentation::Instance()->GetSlat(fDEId, AliMp::kCath1);
Int_t iPcb = 0;
Int_t iPcbPrev = -1;
// Loop over manu
for (Int_t iManu = 0; iManu < GetNofManus(); ++iManu) {
Int_t manuId = GetManuId(iManu);
- AliMpMotifPosition* motifPos0 = slat0->FindMotifPosition(manuId);
- AliMpMotifPosition* motifPos1 = slat1->FindMotifPosition(manuId);
+ AliMpMotifPosition* motifPos0 = kSlat0->FindMotifPosition(manuId);
+ AliMpMotifPosition* motifPos1 = kSlat1->FindMotifPosition(manuId);
if ( !motifPos0 && !motifPos1 ) {
// should never happen
// find PCB id
if ( motifPos0 ) {
x = motifPos0->Position().X();
- length = slat0->GetPCB(0)->DX()*2.;
+ length = kSlat0->GetPCB(0)->DX()*2.;
}
if ( motifPos1 ) {
x = motifPos1->Position().X();
- length = slat1->GetPCB(0)->DX()*2.;
+ length = kSlat1->GetPCB(0)->DX()*2.;
}
iPcb = Int_t(x/length + AliMpConstants::LengthTolerance());
return false;
}
+//______________________________________________________________________________
+void AliMpBusPatch::RevertReadout()
+{
+/// Revert order of manus
+
+ fManus.Revert();
+}
+
+//______________________________________________________________________________
+void AliMpBusPatch::ResetReadout()
+{
+/// Revert order of manus
+
+ fManus.Reset();
+}
+
//______________________________________________________________________________
Int_t AliMpBusPatch::GetNofManus() const
{
return fNofManusPerModule.GetSize();
}
+//______________________________________________________________________________
+TString
+AliMpBusPatch::GetFRTPosition() const
+{
+ /// Return CRXX-Y-Z where XX is the Crocus number, Y the FRT number
+ /// and Z the local bus patch number.
+ return Form("CR%2d-%d-%d",fDdlId,fFrtId+1,GetLocalBusID(fId,fDdlId));
+}
+
//______________________________________________________________________________
Int_t AliMpBusPatch::GetNofManusPerModule(Int_t patchModule) const
{
return fNofManusPerModule.GetValue(patchModule);
}
+
+//______________________________________________________________________________
+void
+AliMpBusPatch::Print(Option_t* opt) const
+{
+ /// Printout
+
+ cout << Form("BusPatch %04d DDL %d : %s <> %s / %s",
+ fId,
+ AliDAQ::DdlID("MUONTRK",fDdlId),
+ GetFRTPosition().Data(),
+ fCableLabel.Data(),
+ fTranslatorLabel.Data()) << endl;
+
+ TString sopt(opt);
+ sopt.ToUpper();
+
+ if ( sopt.Contains("FULL") )
+ {
+ cout << Form("Nof of PCBs (i.e. patch modules) = %d",fNofManusPerModule.GetSize()) << endl;
+
+ for ( Int_t i = 0; i < fNofManusPerModule.GetSize(); ++i )
+ {
+ cout << Form("\t\t %d manus in patch module %d",fNofManusPerModule.GetValue(i),i) << endl;
+ }
+
+ if ( sopt.Contains("MANU") )
+ {
+ cout << "Manus of that buspatch=" << endl;
+
+ for ( Int_t i = 0; i < fManus.GetSize(); ++i )
+ {
+ cout << Form("%4d,",fManus.GetValue(i));
+ }
+ cout << endl;
+ }
+ }
+
+// Int_t fId; ///< Identifier (unique)
+// Int_t fDEId; ///< Detection element to which this bus patch is connected
+// Int_t fDdlId; ///< DDL to which this bus patch is connected
+// AliMpArrayI fManus; ///< Manu Ids connected to this bus patch
+// AliMpArrayI fNofManusPerModule; ///< Nof Manus per patch modules (PCBs)
+// Float_t fCableLength; ///< length of the buspatch cable
+// TString fCableLabel; ///< label of the buspatch cable
+// TString fTranslatorLabel; ///< label of the translator board
+// Int_t fFrtId; ///< FRT Ids connected to this bus patch
+
+}