1 #ifndef ALIMUONVDIGITSTORE_H
2 #define ALIMUONVDIGITSTORE_H
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
10 /// \class AliMUONVDigitStore
11 /// \brief Interface for a digit container
13 // Author Laurent Aphecetche, Subatech
15 #ifndef ALIMUONVSTORE_H
16 # include "AliMUONVStore.h"
19 #ifndef ALIMUONVDIGIT_H
20 # include "AliMUONVDigit.h" // must be there for covariant return type of FindObjet methods
23 class AliMUONVDigitStore : public AliMUONVStore
27 /// Replacement policy : what to do when adding a digit to the store
28 enum EReplacePolicy { kAllow, kDeny, kMerge, kIgnore };
32 virtual ~AliMUONVDigitStore();
34 /// Add an object, if it is of the right class
35 virtual Bool_t Add(TObject* object);
37 /// Create an (empty) object of the same concrete class as *this
38 virtual AliMUONVDigitStore* Create() const = 0;
40 static AliMUONVDigitStore* Create(TTree& tree);
42 static AliMUONVDigitStore* Create(const char* classname);
45 virtual AliMUONVDigit* CreateDigit(Int_t detElemId, Int_t manuId,
46 Int_t manuChannel, Int_t cathode) const = 0;
48 /// Add a digit and return the newly created digit
49 virtual AliMUONVDigit* Add(Int_t detElemId,
53 EReplacePolicy replace);
55 /** Add a (s)digit. Digit is adopted.
56 @param digit the digit to be added
57 @param replace specify what to do if the digit is already there.
58 kAllow means replacement is allowed, kDeny means it is forbidden (in which
59 case we return 0x0), and kMerge means both digits will be merged).
60 Finally, kIgnore means no check is done at all. This is the most rapid option,
61 but also the more dangerous ;-)
63 virtual AliMUONVDigit* Add(const AliMUONVDigit& digit, EReplacePolicy replace) = 0;
65 /// Create an iterator to loop over all our digits.
66 virtual TIterator* CreateIterator() const = 0;
68 /** Create an iterator to loop over all digits of a group of detection elements,
69 and a given cathode (if cathode != -1)
71 virtual TIterator* CreateIterator(Int_t firstDetElemId,
73 Int_t cathode=2) const = 0;
75 /// Create an iterator to loop over tracker digits only
76 virtual TIterator* CreateTrackerIterator() const = 0;
78 /// Create an iterator to loop over trigger digits only
79 virtual TIterator* CreateTriggerIterator() const = 0;
81 using AliMUONVStore::FindObject;
83 /// Find an object (default is to forward to FindObject(object->GetUniqueID())
84 virtual AliMUONVDigit* FindObject(const TObject* object) const;
86 /// Find an object by its uniqueID
87 virtual AliMUONVDigit* FindObject(UInt_t uniqueID) const;
89 /// Find a digit by the quadruplet (de,manu,channel,cathode)
90 virtual AliMUONVDigit* FindObject(Int_t detElemId, Int_t manuId, Int_t manuChannel, Int_t cathode) const = 0;
92 /// Number of digits we store
93 virtual Int_t GetSize() const = 0;
96 virtual AliMUONVDigit* Remove(AliMUONVDigit& digit) = 0;
98 /// Number of digits in a given detection element
99 virtual Int_t GetSize(Int_t detElemId) const { return GetSize(detElemId,2); }
101 /// Number of digits in a given detection element and a given cathode (2 for both cathodes)
102 virtual Int_t GetSize(Int_t detElemId, Int_t cathode) const;
104 /// Whether we have any MC related information (e.g. at least one simulated digit)
105 virtual Bool_t HasMCInformation() const = 0;
107 ClassDef(AliMUONVDigitStore,1) // Digit container interface