40 #include <Riostream.h>
41 #include <TClonesArray.h>
42 #include <TObjArray.h>
51 TString BaseName(
const TString& name)
53 if ( name ==
"TreeS" )
return "MUONSDigit";
54 if ( name ==
"TreeD" )
return "MUONDigit";
76 for ( Int_t i = 0; i <
fDigits->GetSize(); ++i )
78 TClonesArray* tca =
new TClonesArray(
"AliMUONDigit",100);
93 AliError(
"Please implement me");
101 AliError(
"Please implement me");
119 for ( Int_t i = 0; i <=
fDigits->GetLast(); ++i )
142 AliError(Form(
"Digit is not of the expected type (%s vs AliMUONdigit)",
143 vdigit.ClassName()));
155 if ( replace ==
kDeny )
172 index = array->GetLast()+1;
186 TString baseName(BaseName(tree.GetName()));
190 TBranch* branch = tree.GetBranch(Form(
"%ss%d",baseName.Data(),1));
192 Bool_t isMaking = (branch==0);
198 TString branchName(Form(
"%ss%d",baseName.Data(),i+1));
199 ok = ok && tman.
MakeBranch(tree,ClassName(),
"TClonesArray",
205 if ( alone && baseName !=
"MUONSDigit" )
213 TString branchName(Form(
"%ss%d",baseName.Data(),i+1));
227 TObject*
object =
fDigits->At(chamberId);
231 AliError(Form(
"Cannot get digits for chamberId=%d",chamberId));
236 return fDigits->GetObjectRef(
object);
245 return static_cast<TClonesArray*
>(
fDigits->At(chamberId));
253 return static_cast<TClonesArray*
>(
fDigits->At(chamberId));
259 Int_t manuChannel, Int_t cathode)
const
261 return new AliMUONDigit(detElemId,manuId,manuChannel,cathode);
278 array->RemoveAt(index);
295 Int_t manuChannel, Int_t cathode)
const
299 return FindIndex(detElemId,manuId,manuChannel,cathode,index);
305 Int_t manuChannel, Int_t cathode, Int_t& index)
const
311 if (!array)
return 0x0;
315 while ( ( digit = static_cast<AliMUONVDigit*>(next()) ) )
318 digit->
ManuId() == manuId &&
370 for ( Int_t i = 0; i <=
fDigits->GetLast(); ++i )
385 while ( ( digit = static_cast<AliMUONVDigit*>(next()) ) )
static Int_t NofChambers()
Return number of chambers.
virtual Bool_t Connect(TTree &tree, Bool_t alone=kTRUE) const
Connect us to a TTree (only valid if CanConnect()==kTRUE)
virtual Int_t ManuChannel() const =0
The channel within ManuId() this digit belongs to (manuChannel for tracker, localBoardChannel for tri...
Iterator on a store composed of a TObjArray of TClonesArrays.
Bool_t SetAddress(TTree &tree, const char *branchName, void *address) const
Interface for a digit container.
virtual Int_t DetElemId() const
Return detection element ID.
virtual ~AliMUONDigitStoreV1()
virtual AliMUONVDigit * FindObject(Int_t detElemId, Int_t manuId, Int_t manuChannel, Int_t cathode) const
Find a digit by the quadruplet (de,manu,channel,cathode)
AliMUONVDigit * FindIndex(Int_t detElemId, Int_t manuId, Int_t manuChannel, Int_t cathode, Int_t &index) const
virtual TIterator * CreateTriggerIterator() const
Create an iterator to loop over trigger digits only.
TObject ** ChamberDigitsPtr(Int_t chamberId) const
TObjArray * fDigits
array of tclonesarray
TClonesArray * ChamberDigits(Int_t chamberId)
(Legacy) implementation of AliMUONVDigitStore
virtual Int_t DetElemId() const =0
The detection element this digit belongs to.
Helper class to ease TTree (MUON) branches manipulations.
virtual Bool_t HasMCInformation() const =0
Below are methods only relevant for MC digigts.
static Int_t GetChamberId(Int_t detElemId, Bool_t warn=true)
Bool_t HasMCInformation() const
Whether we have any MC related information (e.g. at least one simulated digit)
virtual AliMUONVDigit * Remove(AliMUONVDigit &digit)
Remove an element.
virtual Int_t Cathode() const =0
Cathode number this digit is on (0 or 1)
virtual Int_t GetSize() const
Number of digits we store.
virtual TIterator * CreateIterator() const
Create an iterator to loop over all our digits.
virtual void Clear(Option_t *opt="")
Clear ourselves (i.e. Reset)
Implementation of TIterator for AliMUONDigitStoreV1.
AliMUONDigitStoreV1 & operator=(const AliMUONDigitStoreV1 &rhs)
virtual TIterator * CreateTrackerIterator() const
Create an iterator to loop over tracker digits only.
void UpdateBranchStatuses(TTree &tree, const char *pattern) const
virtual AliMUONVDigit * Add(const AliMUONVDigit &digit, EReplacePolicy replace=kDeny)
virtual Int_t ManuId() const =0
The electronic card id this digit belongs to (manuId for tracker, localboardId for trigger) ...
virtual AliMUONVDigit * CreateDigit(Int_t detElemId, Int_t manuId, Int_t manuChannel, Int_t cathode) const
Create a digit.
Bool_t MakeBranch(TTree &tree, const char *storeClassName, const char *branchClassName, const char *branchName, void *address, Int_t bufferSize=4000, Int_t splitLevel=99) const
AliMUONVDigit * Find(const AliMUONVDigit &digit, Int_t &index) const
Globally used constants definition.
EReplacePolicy
Replacement policy : what to do when adding a digit to the store.
virtual Bool_t MergeWith(const AliMUONVDigit &other)=0
Merge this with other.