]>
Commit | Line | Data |
---|---|---|
97d7844b | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
15 | ||
16 | // $Id$ | |
17 | ||
18 | /// \class AliMUONDigitStoreV2R | |
19 | /// | |
20 | /// Concrete implementation of AliMUONVDigitStore for real digits, using | |
21 | /// the AliMUONDigitStoreVImpl base implementation | |
22 | /// | |
23 | /// \author Laurent Aphecetche | |
24 | ||
25 | #include "AliMUONDigitStoreV2R.h" | |
26 | ||
27 | #include "AliLog.h" | |
28 | #include "AliMUONRealDigit.h" | |
29 | #include <TClonesArray.h> | |
30 | ||
31 | /// \cond CLASSIMP | |
32 | ClassImp(AliMUONDigitStoreV2R) | |
33 | /// \endcond | |
34 | ||
35 | //_____________________________________________________________________________ | |
36 | AliMUONDigitStoreV2R::AliMUONDigitStoreV2R() | |
37 | : AliMUONDigitStoreVImpl("AliMUONRealDigit") | |
38 | { | |
39 | /// ctor | |
40 | } | |
41 | ||
42 | //_____________________________________________________________________________ | |
43 | AliMUONDigitStoreV2R::~AliMUONDigitStoreV2R() | |
44 | { | |
45 | /// dtor | |
46 | } | |
47 | ||
48 | //_____________________________________________________________________________ | |
49 | AliMUONVDigit* | |
50 | AliMUONDigitStoreV2R::AddConcreteDigit(TClonesArray& a, | |
51 | const AliMUONVDigit& digit, | |
52 | Int_t index) | |
53 | { | |
54 | /// Add a digit to this store | |
55 | ||
56 | const AliMUONRealDigit* d = dynamic_cast<const AliMUONRealDigit*>(&digit); | |
57 | ||
58 | if ( !d ) | |
59 | { | |
60 | AliError(Form("Digit (of class %s) is not of the expected type AliMUONRealDigit", | |
61 | digit.ClassName())); | |
62 | return 0x0; | |
63 | } | |
64 | ||
65 | return new(a[index]) AliMUONRealDigit(*d); | |
66 | } | |
67 | ||
68 | //_____________________________________________________________________________ | |
69 | AliMUONVDigitStore* | |
70 | AliMUONDigitStoreV2R::Create() const | |
71 | { | |
72 | /// Create an empty store | |
73 | return new AliMUONDigitStoreV2R; | |
74 | } | |
75 | ||
76 | //_____________________________________________________________________________ | |
77 | AliMUONVDigit* | |
78 | AliMUONDigitStoreV2R::CreateDigit(Int_t detElemId, Int_t manuId, | |
79 | Int_t manuChannel, Int_t cathode) const | |
80 | { | |
81 | /// Create a digit that is compatible with this store | |
82 | return new AliMUONRealDigit(detElemId,manuId,manuChannel,cathode); | |
83 | } | |
84 | ||
85 |