#include "AliMUONVDigitStore.h"
#include "AliLog.h"
#include "AliMUONVDigit.h"
#include <TClass.h>
#include <TString.h>
#include <TTree.h>
ClassImp(AliMUONVDigitStore)
AliMUONVDigitStore::AliMUONVDigitStore()
{
}
AliMUONVDigitStore::~AliMUONVDigitStore()
{
}
Bool_t
AliMUONVDigitStore::Add(TObject* object)
{
if (object)
{
AliMUONVDigit* digit = dynamic_cast<AliMUONVDigit*>(object);
if (digit)
{
AliMUONVDigit* added = Add(*digit,AliMUONVDigitStore::kIgnore);
if (!added)
{
AliError("Could not add digit through Add(TObject*) method");
}
else
{
return kTRUE;
}
}
}
return kFALSE;
}
AliMUONVDigit*
AliMUONVDigitStore::Add(Int_t detElemId,
Int_t manuId,
Int_t manuChannel,
Int_t cathode,
EReplacePolicy replace)
{
AliMUONVDigit* digit = CreateDigit(detElemId,manuId,manuChannel,cathode);
if (digit)
{
AliMUONVDigit* d = Add(*digit,replace);
delete digit;
return d;
}
return 0x0;
}
AliMUONVDigitStore*
AliMUONVDigitStore::Create(const char* digitstoreclassname)
{
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)
{
TString dataType = ( strcmp(tree.GetName(),"TreeD") == 0 ? "Digit" :
(strcmp(tree.GetName(),"TreeS")== 9 ? "SDigit" : "")
);
return static_cast<AliMUONVDigitStore*>(AliMUONVStore::Create(tree,dataType.Data()));
}
AliMUONVDigit*
AliMUONVDigitStore::FindObject(const TObject* object) const
{
const AliMUONVDigit* digit = dynamic_cast<const AliMUONVDigit*>(object);
if (digit)
{
return FindObject(digit->GetUniqueID());
}
return 0x0;
}
AliMUONVDigit*
AliMUONVDigitStore::FindObject(UInt_t uniqueID) const
{
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
{
TIter next(CreateIterator(detElemId,detElemId,cathode));
Int_t n(0);
while ( ( next() ) )
{
++n;
}
return n;
}
AliMUONVDigitStore.cxx:10 AliMUONVDigitStore.cxx:11 AliMUONVDigitStore.cxx:12 AliMUONVDigitStore.cxx:13 AliMUONVDigitStore.cxx:14 AliMUONVDigitStore.cxx:15 AliMUONVDigitStore.cxx:16 AliMUONVDigitStore.cxx:17 AliMUONVDigitStore.cxx:18 AliMUONVDigitStore.cxx:19 AliMUONVDigitStore.cxx:20 AliMUONVDigitStore.cxx:21 AliMUONVDigitStore.cxx:22 AliMUONVDigitStore.cxx:23 AliMUONVDigitStore.cxx:24 AliMUONVDigitStore.cxx:25 AliMUONVDigitStore.cxx:26 AliMUONVDigitStore.cxx:27 AliMUONVDigitStore.cxx:28 AliMUONVDigitStore.cxx:29 AliMUONVDigitStore.cxx:30 AliMUONVDigitStore.cxx:31 AliMUONVDigitStore.cxx:32 AliMUONVDigitStore.cxx:33 AliMUONVDigitStore.cxx:34 AliMUONVDigitStore.cxx:35 AliMUONVDigitStore.cxx:36 AliMUONVDigitStore.cxx:37 AliMUONVDigitStore.cxx:38 AliMUONVDigitStore.cxx:39 AliMUONVDigitStore.cxx:40 AliMUONVDigitStore.cxx:41 AliMUONVDigitStore.cxx:42 AliMUONVDigitStore.cxx:43 AliMUONVDigitStore.cxx:44 AliMUONVDigitStore.cxx:45 AliMUONVDigitStore.cxx:46 AliMUONVDigitStore.cxx:47 AliMUONVDigitStore.cxx:48 AliMUONVDigitStore.cxx:49 AliMUONVDigitStore.cxx:50 AliMUONVDigitStore.cxx:51 AliMUONVDigitStore.cxx:52 AliMUONVDigitStore.cxx:53 AliMUONVDigitStore.cxx:54 AliMUONVDigitStore.cxx:55 AliMUONVDigitStore.cxx:56 AliMUONVDigitStore.cxx:57 AliMUONVDigitStore.cxx:58 AliMUONVDigitStore.cxx:59 AliMUONVDigitStore.cxx:60 AliMUONVDigitStore.cxx:61 AliMUONVDigitStore.cxx:62 AliMUONVDigitStore.cxx:63 AliMUONVDigitStore.cxx:64 AliMUONVDigitStore.cxx:65 AliMUONVDigitStore.cxx:66 AliMUONVDigitStore.cxx:67 AliMUONVDigitStore.cxx:68 AliMUONVDigitStore.cxx:69 AliMUONVDigitStore.cxx:70 AliMUONVDigitStore.cxx:71 AliMUONVDigitStore.cxx:72 AliMUONVDigitStore.cxx:73 AliMUONVDigitStore.cxx:74 AliMUONVDigitStore.cxx:75 AliMUONVDigitStore.cxx:76 AliMUONVDigitStore.cxx:77 AliMUONVDigitStore.cxx:78 AliMUONVDigitStore.cxx:79 AliMUONVDigitStore.cxx:80 AliMUONVDigitStore.cxx:81 AliMUONVDigitStore.cxx:82 AliMUONVDigitStore.cxx:83 AliMUONVDigitStore.cxx:84 AliMUONVDigitStore.cxx:85 AliMUONVDigitStore.cxx:86 AliMUONVDigitStore.cxx:87 AliMUONVDigitStore.cxx:88 AliMUONVDigitStore.cxx:89 AliMUONVDigitStore.cxx:90 AliMUONVDigitStore.cxx:91 AliMUONVDigitStore.cxx:92 AliMUONVDigitStore.cxx:93 AliMUONVDigitStore.cxx:94 AliMUONVDigitStore.cxx:95 AliMUONVDigitStore.cxx:96 AliMUONVDigitStore.cxx:97 AliMUONVDigitStore.cxx:98 AliMUONVDigitStore.cxx:99 AliMUONVDigitStore.cxx:100 AliMUONVDigitStore.cxx:101 AliMUONVDigitStore.cxx:102 AliMUONVDigitStore.cxx:103 AliMUONVDigitStore.cxx:104 AliMUONVDigitStore.cxx:105 AliMUONVDigitStore.cxx:106 AliMUONVDigitStore.cxx:107 AliMUONVDigitStore.cxx:108 AliMUONVDigitStore.cxx:109 AliMUONVDigitStore.cxx:110 AliMUONVDigitStore.cxx:111 AliMUONVDigitStore.cxx:112 AliMUONVDigitStore.cxx:113 AliMUONVDigitStore.cxx:114 AliMUONVDigitStore.cxx:115 AliMUONVDigitStore.cxx:116 AliMUONVDigitStore.cxx:117 AliMUONVDigitStore.cxx:118 AliMUONVDigitStore.cxx:119 AliMUONVDigitStore.cxx:120 AliMUONVDigitStore.cxx:121 AliMUONVDigitStore.cxx:122 AliMUONVDigitStore.cxx:123 AliMUONVDigitStore.cxx:124 AliMUONVDigitStore.cxx:125 AliMUONVDigitStore.cxx:126 AliMUONVDigitStore.cxx:127 AliMUONVDigitStore.cxx:128 AliMUONVDigitStore.cxx:129 AliMUONVDigitStore.cxx:130 AliMUONVDigitStore.cxx:131 AliMUONVDigitStore.cxx:132 AliMUONVDigitStore.cxx:133 AliMUONVDigitStore.cxx:134 AliMUONVDigitStore.cxx:135 AliMUONVDigitStore.cxx:136 AliMUONVDigitStore.cxx:137 AliMUONVDigitStore.cxx:138 AliMUONVDigitStore.cxx:139 AliMUONVDigitStore.cxx:140 AliMUONVDigitStore.cxx:141 AliMUONVDigitStore.cxx:142 AliMUONVDigitStore.cxx:143 AliMUONVDigitStore.cxx:144 AliMUONVDigitStore.cxx:145 AliMUONVDigitStore.cxx:146 AliMUONVDigitStore.cxx:147 AliMUONVDigitStore.cxx:148 AliMUONVDigitStore.cxx:149 AliMUONVDigitStore.cxx:150 AliMUONVDigitStore.cxx:151 AliMUONVDigitStore.cxx:152 AliMUONVDigitStore.cxx:153 AliMUONVDigitStore.cxx:154 AliMUONVDigitStore.cxx:155 AliMUONVDigitStore.cxx:156 AliMUONVDigitStore.cxx:157 AliMUONVDigitStore.cxx:158 AliMUONVDigitStore.cxx:159 AliMUONVDigitStore.cxx:160 AliMUONVDigitStore.cxx:161 AliMUONVDigitStore.cxx:162 AliMUONVDigitStore.cxx:163