#include "AliMpArrayI.h"
#include "AliMpConstants.h"
#include "AliMpDEManager.h"
-#include "AliMpHVNamer.h"
+#include "AliMpDCSNamer.h"
#include "AliMpHVUID.h"
#include "AliMpManuUID.h"
#include "AliMpPadUID.h"
#include <Riostream.h>
+using std::endl;
/// \cond CLASSIMP
ClassImp(AliMpDetElement)
/// \endcond
fSegType(segType),
fPlaneType(planeType),
fBusPatchIds(false),
- fManuToSerialNbs(1700),
- fSerialNbToManus(1700),
- fManuList(1700),
- fTrackerChannels(1700*AliMpConstants::ManuNofChannels()),
- fHVmanus(true)
+ fManuList(),
+ fTrackerChannels(),
+ fHVmanus(),
+ fNofChannels(0)
{
/// Standard constructor
}
//______________________________________________________________________________
-AliMpDetElement::AliMpDetElement(TRootIOCtor* /*ioCtor*/)
+AliMpDetElement::AliMpDetElement(TRootIOCtor* ioCtor)
: TObject(),
fId(0),
fDdlId(-1),
fSegType(),
fPlaneType(),
fBusPatchIds(),
- fManuToSerialNbs(),
- fSerialNbToManus(),
- fManuList(true),
- fTrackerChannels(true),
- fHVmanus(true)
+ fManuList(),
+ fTrackerChannels(),
+ fHVmanus(ioCtor),
+ fNofChannels()
{
/// Root IO constructor
}
return true;
}
-//______________________________________________________________________________
-void AliMpDetElement::AddManuSerial(Int_t manuId, Int_t serialNb)
-{
-/// Map the serial manu number
-/// (Eventually add check if the given pair already present)
-
- AliCodeTimerAuto("");
-
- AliDebug(1,Form("DE %4d ManuId %4d SerialNB %d",
- fId,manuId,serialNb));
-
- fManuToSerialNbs.Add(Long_t(manuId), Long_t(serialNb));
- fSerialNbToManus.Add(Long_t(serialNb), Long_t(manuId));
-}
-
//______________________________________________________________________________
TString AliMpDetElement::GetSegName(AliMp::CathodType cathType) const
{
Int_t chamberId = AliMpDEManager::GetChamberId(fId, false);
if ( ! AliMpDEManager::IsValidChamberId(chamberId, true) ) {
AliFatal("Cannot return AliMp::StationType value.");
- return AliMp::kStation1;
+ return AliMp::kStation12;
}
- if ( chamberId == 0 || chamberId == 1 ) return AliMp::kStation1;
- if ( chamberId == 2 || chamberId == 3 ) return AliMp::kStation2;
+ if ( chamberId >= 0 && chamberId <= 3 ) return AliMp::kStation12;
if ( chamberId >= 4 && chamberId <= 9 ) return AliMp::kStation345;
if ( chamberId >= 10 && chamberId <= 13 ) return AliMp::kStationTrigger;
// Should never get to this line
AliFatal("Cannot return AliMp::StationType value.");
- return AliMp::kStation1;
+ return AliMp::kStation12;
+}
+
+//______________________________________________________________________________
+AliMq::Station12Type AliMpDetElement::GetStation12Type() const
+{
+/// Return station12 type \n
+/// Failure causes Fatal error - as AliMp::Station12Type has no possibility
+/// to return undefined value
+
+ Int_t chamberId = AliMpDEManager::GetChamberId(fId, false);
+ if ( ! AliMpDEManager::IsValidChamberId(chamberId, true) ) {
+ AliFatal("Cannot return AliMp::StationType value.");
+ return AliMq::kNotSt12;
+ }
+
+ if ( chamberId == 0 || chamberId == 1 ) return AliMq::kStation1;
+ if ( chamberId == 2 || chamberId == 3 ) return AliMq::kStation2;
+ if ( chamberId >= 4 || chamberId <= 13 ) return AliMq::kNotSt12;
+
+ // Should never get to this line
+ AliFatal("Cannot return AliMp::StationType value.");
+ return AliMq::kNotSt12;
}
//______________________________________________________________________________
{
/// Return the index-th bus patch
- if ( index < 0 || index > GetNofBusPatches() ) {
+ if ( index < 0 || index >= GetNofBusPatches() ) {
AliErrorStream()
<< "In DE = " << fId << ": Index " << index << " outside limits." << endl;
return 0;
return fBusPatchIds.HasValue(busPatchId);;
}
-//______________________________________________________________________________
-Int_t AliMpDetElement::GetManuSerialFromId(Int_t manuId) const
-{
-/// Return manu serial number from manuId
-
- return (Int_t)fManuToSerialNbs.GetValue(Long_t(manuId));
-}
-
-//______________________________________________________________________________
-Int_t AliMpDetElement::GetManuIdFromSerial(Int_t serialNb) const
-{
-/// Return manuId from manu serial number
-
- return (Int_t)fSerialNbToManus.GetValue(Long_t(serialNb));
-}
-
//______________________________________________________________________________
Int_t
AliMpDetElement::NofChannelsInManu(Int_t manuId) const
if ( stationType == AliMp::kStationTrigger ) return;
- AliCodeTimerAuto("")
+ AliCodeTimerAuto("",0)
AliDebug(1,Form("DE %4d Manu %4d",fId,manuId));
for ( Int_t i = 0; i < AliMpConstants::ManuNofChannels(); ++i )
{
- if ( seg->PadByLocation(AliMpIntPair(manuId,i),kFALSE).IsValid() )
+ if ( seg->PadByLocation(manuId,i,kFALSE).IsValid() )
{
++n;
fTrackerChannels.Add((Long_t)AliMpPadUID::BuildUniqueID(fId,manuId,i),
}
fManuList.Add(AliMpManuUID::BuildUniqueID(fId,manuId),(Long_t)n);
+
+ fNofChannels += n;
- AliMpHVNamer hvNamer;
+ AliMpDCSNamer hvNamer("TRACKER");
Int_t index = hvNamer.ManuId2Index(fId,manuId);
return static_cast<AliMpArrayI*>(fHVmanus.GetValue(AliMpHVUID::BuildUniqueID(fId,hvIndex)));
}
-//______________________________________________________________________________
-Int_t
-AliMpDetElement::NofManusWithSerialNumber() const
-{
- /// Return the number of manus which have a serial number in this detection element
- return fManuToSerialNbs.GetSize();
-}
-
//______________________________________________________________________________
Int_t
AliMpDetElement::NofManus() const