]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONDigitStoreV2S.cxx
More efficient implementation(s) of AliMUONVDigitStore (Laurent)
[u/mrichter/AliRoot.git] / MUON / AliMUONDigitStoreV2S.cxx
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 #include "AliMUONDigitStoreV2S.h"
19
20 /// \class AliMUONDigitStoreV2S
21 ///
22 /// Concrete implementation of AliMUONVDigitStore for simulated digits, using
23 /// the AliMUONDigitStoreVImpl base implementation
24 /// 
25 /// \author Laurent Aphecetche
26
27
28 #include "AliMUONDigit.h"
29 #include <TClonesArray.h>
30
31 /// \cond CLASSIMP
32 ClassImp(AliMUONDigitStoreV2S)
33 /// \endcond
34
35 //_____________________________________________________________________________
36 AliMUONDigitStoreV2S::AliMUONDigitStoreV2S()
37 : AliMUONDigitStoreVImpl("AliMUONDigit")
38 {
39   /// ctor
40 }
41
42 //_____________________________________________________________________________
43 AliMUONDigitStoreV2S::~AliMUONDigitStoreV2S()
44 {
45   /// dtor
46 }
47
48 //_____________________________________________________________________________
49 AliMUONVDigit*
50 AliMUONDigitStoreV2S::AddConcreteDigit(TClonesArray& a, 
51                                        const AliMUONVDigit& digit,
52                                        Int_t index)
53 {
54   /// add a digit to this store
55   const AliMUONDigit* d = dynamic_cast<const AliMUONDigit*>(&digit);
56   
57   if ( !d ) return 0x0;
58   
59   return new(a[index]) AliMUONDigit(*d);
60 }
61
62 //_____________________________________________________________________________
63 AliMUONVDigitStore* 
64 AliMUONDigitStoreV2S::Create() const
65 {
66   /// create an empty store
67   return new AliMUONDigitStoreV2S;
68 }
69
70 //_____________________________________________________________________________
71 AliMUONVDigit* 
72 AliMUONDigitStoreV2S::CreateDigit(Int_t detElemId, Int_t manuId,                                 
73                                   Int_t manuChannel, Int_t cathode) const
74 {
75   /// create a digit, compatible with this store
76   return new AliMUONDigit(detElemId,manuId,manuChannel,cathode);
77 }
78
79