#include "AliMUON2DStoreValidator.h"
#include "AliLog.h"
-#include "AliMUONCalibParam1I.h"
-#include "AliMpIntPair.h"
-#include "AliMpManuList.h"
-#include "AliMUONV2DStore.h"
-#include "TList.h"
-#include "TObjArray.h"
#include "AliMUONCheckItem.h"
#include "AliMUONCheckItemIterator.h"
+#include "AliMUONVCalibParam.h"
+#include "AliMUONVStore.h"
+#include "AliMpConstants.h"
+#include "AliMpDDLStore.h"
#include "AliMpDEManager.h"
-#include "TObjString.h"
-#include "AliMUONConstants.h"
-#include "Riostream.h"
+#include "AliMpDetElement.h"
+#include "AliMpManuIterator.h"
+#include <Riostream.h>
+#include <TList.h>
+#include <TObjArray.h>
+#include <TObjString.h>
+//-----------------------------------------------------------------------------
/// \class AliMUON2DStoreValidator
///
/// Determine which channels, manus, DEs, stations are missing
-/// from a 2DStore. This is mainly to be used during (shuttle) preprocessing
+/// from a VStore, which must be 2D, and the 2 dimensions must be
+/// (detElemId,manuId).
+/// This is mainly to be used during (shuttle) preprocessing
/// to insure that what we'll put in the CDB is as complete as possible,
/// and to detect possible problem.
///
/// The list of missing things is kept in a structure of objects defined as :
///
/// fMissing = TObjArray[0..N tracking chambers]
+///
/// fMissing[iChamber] = AliMUONCheckItem which contains n AliMUONCheckItem,
/// where n is the number of DE for that chamber
+///
/// fMissing[iChamber]->GetItem(de) = AliMUONCheckItem which contains m
/// AliMUONCheckItem where m is the number of Manu for that DE
+///
/// fMissing[iChamber]->GetItem(de)->GetItem(manu) = AliMUONCheckItem which
/// contains k TObjString = Form("%d",manuChannel)
///
/// \author Laurent Aphecetche
+//-----------------------------------------------------------------------------
/// \cond CLASSIMP
ClassImp(AliMUON2DStoreValidator)
//_____________________________________________________________________________
AliMUON2DStoreValidator::AliMUON2DStoreValidator()
: TObject(),
- fManuList(0x0),
fChambers(0x0),
fStatus(0x0)
{
AliMUON2DStoreValidator::~AliMUON2DStoreValidator()
{
/// dtor
- delete fManuList;
delete fChambers;
delete fStatus;
}
/// Return (and create if not present) the given chamber
/// chamberID in 0..NCh()
- if ( chamberID < 0 || chamberID >= AliMUONConstants::NCh() )
+ if ( chamberID < 0 || chamberID >= AliMpConstants::NofTrackingChambers() )
{
AliFatal(Form("Invalid chamber number %d",chamberID));
return 0x0;
if (!fChambers)
{
- fChambers = new TObjArray(AliMUONConstants::NCh());
+ fChambers = new TObjArray(AliMpConstants::NofTrackingChambers());
}
AliMUONCheckItem* chamber =
AliDebug(3,Form("Did not find DE %4d into chamber %d, will create it",
detElemId,chamberID));
de = new AliMUONCheckItem(detElemId,
- AliMpManuList::NumberOfManus(detElemId),
+ AliMpDDLStore::Instance()->GetDetElement(detElemId)->NofManus(),
"Detection Element");
Bool_t ok = chamber->AddItem(detElemId,de);
if (!ok)
AliMUONCheckItem* manu = static_cast<AliMUONCheckItem*>(de->GetItem(manuId));
if (!manu)
{
- manu = new AliMUONCheckItem(manuId,AliMpManuList::NumberOfChannels(detElemId,manuId),"Manu");
+ manu = new AliMUONCheckItem(manuId,AliMpDDLStore::Instance()->GetDetElement(detElemId)->NofChannelsInManu(manuId),"Manu");
Bool_t ok = de->AddItem(manuId,manu);
if (!ok)
{
AliDebug(3,Form("DE %4d Manu %4d is completely missing",
detElemId,manuId));
- Int_t n(AliMpManuList::NumberOfChannels(detElemId,manuId));
+ Int_t n(AliMpDDLStore::Instance()->GetDetElement(detElemId)->NofChannelsInManu(manuId));
for ( Int_t i = 0; i < n; ++i )
{
//_____________________________________________________________________________
TObjArray*
-AliMUON2DStoreValidator::Validate(const AliMUONV2DStore& store,
+AliMUON2DStoreValidator::Validate(const AliMUONVStore& store)
+{
+ /// Validate the store. Check only the presence of all manus (i.e.
+ /// check nothing about the values themselves)
+
+ Bool_t (*kCheck)(const AliMUONVCalibParam&,Int_t) = 0x0;
+ return Validate(store,kCheck);
+}
+
+//_____________________________________________________________________________
+TObjArray*
+AliMUON2DStoreValidator::Validate(const AliMUONVStore& store,
Bool_t (*check)(const AliMUONVCalibParam&,Int_t))
{
/// Validate the store.
delete fChambers;
fChambers = 0x0;
- if (!fManuList) fManuList = AliMpManuList::ManuList();
-
// Now checks if some full manus are missing
- TIter next(fManuList);
- AliMpIntPair* p;
+
+ AliMpManuIterator it;
+
+ Int_t detElemId;
+ Int_t manuId;
- while ( ( p = (AliMpIntPair*)next() ) )
+ while ( it.Next(detElemId,manuId) )
{
- Int_t detElemId = p->GetFirst();
- Int_t manuId = p->GetSecond();
AliMUONVCalibParam* test =
- static_cast<AliMUONVCalibParam*>(store.Get(detElemId,manuId));
+ static_cast<AliMUONVCalibParam*>(store.FindObject(detElemId,manuId));
if (!test)
{
// completely missing manu
else
{
if (!check) continue;
+
+ AliMpDetElement* de = AliMpDDLStore::Instance()->GetDetElement(detElemId);
+
// manu is there, check all its channels
for ( Int_t manuChannel = 0 ; manuChannel < test->Size(); ++manuChannel )
{
- if ( AliMpManuList::DoesChannelExist(detElemId,manuId,manuChannel) &&
+ if ( de->IsConnectedChannel(manuId,manuChannel) &&
!check(*test,manuChannel) )
{
AddMissingChannel(detElemId,manuId,manuChannel);
//_____________________________________________________________________________
TObjArray*
-AliMUON2DStoreValidator::Validate(const AliMUONV2DStore& store,
+AliMUON2DStoreValidator::Validate(const AliMUONVStore& store,
Float_t invalidFloatValue)
{
/// Validate the store.
delete fChambers;
fChambers = 0x0;
- if (!fManuList) fManuList = AliMpManuList::ManuList();
-
// Now checks if some full manus are missing
- TIter next(fManuList);
- AliMpIntPair* p;
- while ( ( p = (AliMpIntPair*)next() ) )
+ AliMpManuIterator it;
+ Int_t detElemId;
+ Int_t manuId;
+
+ while ( it.Next(detElemId,manuId) )
{
- Int_t detElemId = p->GetFirst();
- Int_t manuId = p->GetSecond();
AliMUONVCalibParam* test =
- static_cast<AliMUONVCalibParam*>(store.Get(detElemId,manuId));
+ static_cast<AliMUONVCalibParam*>(store.FindObject(detElemId,manuId));
if (!test)
{
// completely missing manu
else
{
// manu is there, check all its channels
+ AliMpDetElement* de = AliMpDDLStore::Instance()->GetDetElement(detElemId);
+
for ( Int_t manuChannel = 0 ; manuChannel < test->Size(); ++manuChannel )
{
- if ( AliMpManuList::DoesChannelExist(detElemId,manuId,manuChannel) &&
+ if ( de->IsConnectedChannel(manuId,manuChannel) &&
( test->ValueAsFloat(manuChannel,0) == invalidFloatValue ||
test->ValueAsFloat(manuChannel,1) == invalidFloatValue ) )
{