// $Id$
+//-----------------------------------------------------------------------------
/// \class AliMUONVDigitStore
///
/// Interface for a digit (or sdigit) container
/// can create iterators to loop over (part of) the elements.
///
/// \author Laurent Aphecetche, Subatech
+//-----------------------------------------------------------------------------
#include "AliMUONVDigitStore.h"
#include "AliLog.h"
#include "AliMUONVDigit.h"
+#include <TClass.h>
#include <TString.h>
#include <TTree.h>
return 0x0;
}
+//____________________________________________________________________________
+AliMUONVDigitStore*
+AliMUONVDigitStore::Create(const char* digitstoreclassname)
+{
+ /// Create a concrete digitStore, given its classname
+
+ TClass* classPtr = TClass::GetClass(digitstoreclassname);
+ if (!classPtr || !classPtr->InheritsFrom("AliMUONVDigitStore"))
+ {
+ return 0x0;
+ }
+
+ AliMUONVDigitStore* digitStore =
+ reinterpret_cast<AliMUONVDigitStore*>(classPtr->New());
+
+ return digitStore;
+}
+
//_____________________________________________________________________________
AliMUONVDigitStore*
AliMUONVDigitStore::Create(TTree& tree)
return static_cast<AliMUONVDigitStore*>(AliMUONVStore::Create(tree,dataType.Data()));
}
+//_____________________________________________________________________________
+AliMUONVDigit*
+AliMUONVDigitStore::FindObject(const TObject* object) const
+{
+ /// Find an object, if of AliMUONVDigit type.
+ const AliMUONVDigit* digit = dynamic_cast<const AliMUONVDigit*>(object);
+ if (digit)
+ {
+ return FindObject(digit->GetUniqueID());
+ }
+ return 0x0;
+}
+
+//_____________________________________________________________________________
+AliMUONVDigit*
+AliMUONVDigitStore::FindObject(UInt_t uniqueID) const
+{
+ /// Find digit by its uniqueID
+
+ return FindObject(AliMUONVDigit::DetElemId(uniqueID),
+ AliMUONVDigit::ManuId(uniqueID),
+ AliMUONVDigit::ManuChannel(uniqueID),
+ AliMUONVDigit::Cathode(uniqueID));
+}
+
//_____________________________________________________________________________
Int_t
AliMUONVDigitStore::GetSize(Int_t detElemId, Int_t cathode) const