AliMUON2DStoreValidator::AliMUON2DStoreValidator()
: TObject(),
fManuList(0x0),
- fChambers(0x0)
+ fChambers(0x0),
+ fStatus(0x0)
{
/// ctor
}
/// dtor
delete fManuList;
delete fChambers;
+ delete fStatus;
}
//_____________________________________________________________________________
//_____________________________________________________________________________
void
-AliMUON2DStoreValidator::ReportManu(AliMUONCheckItem& manu)
+AliMUON2DStoreValidator::ReportManu(TList& lines, AliMUONCheckItem& manu)
{
/// Report list of missing channels from this manu
while ( ( channel = static_cast<TObjString*>(it.Next()) ) )
{
- cout << Form("\t\t\tChannel %s is missing",channel->GetString().Data()) << endl;
+ lines.Add(new TObjString(Form("\t\t\tChannel %s is missing or dead",
+ channel->GetString().Data())));
}
}
//_____________________________________________________________________________
void
-AliMUON2DStoreValidator::ReportDE(AliMUONCheckItem& de)
+AliMUON2DStoreValidator::ReportDE(TList& lines, AliMUONCheckItem& de)
{
/// Report list of missing manus from this de
AliMUONCheckItem* manu(0x0);
AliMUONCheckItemIterator it(de);
- cout << Form("\tDE %4d",de.GetID()) << endl;
+ lines.Add(new TObjString(Form("DE %5d",de.GetID())));
it.First();
{
if ( manu->IsDead() )
{
- cout << Form("\t\tManu %4d is missing",manu->GetID()) << endl;
+ lines.Add(new TObjString(Form("\t\tManu %4d is missing or dead",manu->GetID())));
}
else
{
- ReportManu(*manu);
+ ReportManu(lines,*manu);
}
}
}
//_____________________________________________________________________________
void
-AliMUON2DStoreValidator::ReportChamber(AliMUONCheckItem& chamber)
+AliMUON2DStoreValidator::ReportChamber(TList& lines, AliMUONCheckItem& chamber)
{
/// Report list of missing de from this chamber
{
if ( de->IsDead() )
{
- cout << Form("\tDE %4d is missing",de->GetID()) << endl;
+ lines.Add(new TObjString(Form("\tDE %4d is missing or dead",de->GetID())));
}
else
{
- ReportDE(*de);
+ ReportDE(lines,*de);
}
}
}
//_____________________________________________________________________________
void
-AliMUON2DStoreValidator::Report(const TObjArray& chambers)
+AliMUON2DStoreValidator::Report(TList& lines) const
+{
+ ///
+ if (fChambers)
+ {
+ Report(lines,*fChambers);
+ }
+}
+
+//_____________________________________________________________________________
+void
+AliMUON2DStoreValidator::Report(TList& lines, const TObjArray& chambers)
{
/// Reports what is missing, trying to be as concise as possible.
{
if ( chamber->IsDead() )
{
- cout << Form("Chamber %2d is missing",iChamber) << endl;
+ lines.Add(new TObjString(Form("Chamber %2d is missing or dead",iChamber)));
}
else
{
- ReportChamber(*chamber);
+ ReportChamber(lines,*chamber);
+ }
+ }
+ }
+}
+
+//_____________________________________________________________________________
+TObjArray*
+AliMUON2DStoreValidator::Validate(const AliMUONV2DStore& store,
+ Bool_t (*check)(const AliMUONVCalibParam&,Int_t))
+{
+ /// Validate the store.
+ /// The check method is used to decide if a store content value
+ /// is valid or not.
+
+ 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() ) )
+ {
+ Int_t detElemId = p->GetFirst();
+ Int_t manuId = p->GetSecond();
+ AliMUONVCalibParam* test =
+ static_cast<AliMUONVCalibParam*>(store.Get(detElemId,manuId));
+ if (!test)
+ {
+ // completely missing manu
+ AddMissingManu(detElemId,manuId);
+ }
+ else
+ {
+ if (!check) continue;
+ // manu is there, check all its channels
+ for ( Int_t manuChannel = 0 ; manuChannel < test->Size(); ++manuChannel )
+ {
+ if ( AliMpManuList::DoesChannelExist(detElemId,manuId,manuChannel) &&
+ !check(*test,manuChannel) )
+ {
+ AddMissingChannel(detElemId,manuId,manuChannel);
+ }
}
}
}
+ return fChambers;
+
}
+
//_____________________________________________________________________________
TObjArray*
AliMUON2DStoreValidator::Validate(const AliMUONV2DStore& store,
class TList;
class TObjArray;
class AliMUONCheckItem;
+class AliMUONVCalibParam;
class AliMUON2DStoreValidator : public TObject
{
virtual ~AliMUON2DStoreValidator();
TObjArray* Validate(const AliMUONV2DStore& store, Float_t invalidFloatValue);
- void Report() const { Report(*fChambers); }
- static void Report(const TObjArray& chambers);
+ TObjArray* Validate(const AliMUONV2DStore& store,
+ Bool_t (*check)(const AliMUONVCalibParam&,Int_t));
+
+ AliMUONV2DStore* GetStatus() const { return fStatus; }
+
+ void Report(TList& lines) const;
+
+ static void Report(TList& lines, const TObjArray& chambers);
private:
AliMUONCheckItem* GetDE(Int_t detElemId);
AliMUONCheckItem* GetManu(Int_t detElemId, Int_t manuId);
- static void ReportChamber(AliMUONCheckItem& chamber);
- static void ReportDE(AliMUONCheckItem& de);
- static void ReportManu(AliMUONCheckItem& manu);
+ static void ReportChamber(TList& list, AliMUONCheckItem& chamber);
+ static void ReportDE(TList& list, AliMUONCheckItem& de);
+ static void ReportManu(TList& list, AliMUONCheckItem& manu);
private:
TList* fManuList; //! List of (DE,manuID) pairs.
TObjArray* fChambers; //! Array of AliMUONCheckItem.
+ AliMUONV2DStore* fStatus; //! Statuses
- ClassDef(AliMUON2DStoreValidator,1) // Validator of 2DStore
+ ClassDef(AliMUON2DStoreValidator,2) // Validator of 2DStore
};
#endif