]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/AliMUONVDigitStore.h
Managed the 234 local boards inside the class & simplified the code
[u/mrichter/AliRoot.git] / MUON / AliMUONVDigitStore.h
CommitLineData
8c740498 1#ifndef ALIMUONVDIGITSTORE_H
2#define ALIMUONVDIGITSTORE_H
3
4/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5* See cxx source for full Copyright notice */
6
7// $Id$
8
9/// \ingroup base
10/// \class AliMUONVDigitStore
11/// \brief Interface for a digit container
12///
13// Author Laurent Aphecetche, Subatech
14
15#ifndef ALIMUONVSTORE_H
16# include "AliMUONVStore.h"
17#endif
18
19#ifndef ALIMUONVDIGIT_H
20# include "AliMUONVDigit.h" // must be there for covariant return type of FindObjet methods
21#endif
22
23class AliMUONVDigitStore : public AliMUONVStore
24{
25public:
26
27 /// Replacement policy : what to do when adding a digit to the store
28 enum EReplacePolicy { kAllow, kDeny, kMerge, kIgnore };
29
30public:
31 AliMUONVDigitStore();
32 virtual ~AliMUONVDigitStore();
33
34 /// Add an object, if it is of the right class
35 virtual Bool_t Add(TObject* object);
36
37 /// Create an (empty) object of the same concrete class as *this
38 virtual AliMUONVDigitStore* Create() const = 0;
39
40 static AliMUONVDigitStore* Create(TTree& tree);
41
42 /// Create a digit
43 virtual AliMUONVDigit* CreateDigit(Int_t detElemId, Int_t manuId,
44 Int_t manuChannel, Int_t cathode) const = 0;
45
46 /// Add a digit and return the newly created digit
47 virtual AliMUONVDigit* Add(Int_t detElemId,
48 Int_t manuId,
49 Int_t manuChannel,
50 Int_t cathode,
51 EReplacePolicy replace);
52
53 /** Add a (s)digit. Digit is adopted.
54 @param digit the digit to be added
55 @param replace specify what to do if the digit is already there.
56 kAllow means replacement is allowed, kDeny means it is forbidden (in which
57 case we return 0x0), and kMerge means both digits will be merged).
58 Finally, kIgnore means no check is done at all. This is the most rapid option,
59 but also the more dangerous ;-)
60 */
61 virtual AliMUONVDigit* Add(const AliMUONVDigit& digit, EReplacePolicy replace) = 0;
62
63 /// Create an iterator to loop over all our digits.
64 virtual TIterator* CreateIterator() const = 0;
65
66 /** Create an iterator to loop over all digits of a group of detection elements,
67 and a given cathode (if cathode != -1)
68 */
69 virtual TIterator* CreateIterator(Int_t firstDetElemId,
70 Int_t lastDetElemId,
71 Int_t cathode=2) const = 0;
72
73 /// Create an iterator to loop over tracker digits only
74 virtual TIterator* CreateTrackerIterator() const = 0;
75
76 /// Create an iterator to loop over trigger digits only
77 virtual TIterator* CreateTriggerIterator() const = 0;
78
79 using AliMUONVStore::FindObject;
80
81 /// Find a (tracker) digit by the triplet (de,manu,channel)
82 virtual AliMUONVDigit* FindObject(Int_t detElemId, Int_t manuId, Int_t manuChannel) const = 0;
83
84 /// Find a (trigger) digit by the quadruplet (de,lb,channel,cathode)
85 virtual AliMUONVDigit* FindObject(Int_t detElemId, Int_t localBoardId, Int_t localBoardChannel, Int_t cathode) const = 0;
86
87 /// Number of digits we store
88 virtual Int_t GetSize() const = 0;
89
90 /// Remove an element
91 virtual AliMUONVDigit* Remove(AliMUONVDigit& digit) = 0;
92
93 /// Number of digits in a given detection element
94 virtual Int_t GetSize(Int_t detElemId) const { return GetSize(detElemId,2); }
95
96 /// Number of digits in a given detection element and a given cathode (2 for both cathodes)
97 virtual Int_t GetSize(Int_t detElemId, Int_t cathode) const;
98
99 ClassDef(AliMUONVDigitStore,1) // Digit container interface
100};
101
102#endif