]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONDDLTracker.cxx
READMErec.txt updated.
[u/mrichter/AliRoot.git] / MUON / AliMUONDDLTracker.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 "AliMUONDDLTracker.h"
19 #include "AliMUONBusStruct.h"
20 #include "AliMUONDspHeader.h"
21 #include "AliMUONBlockHeader.h"
22
23
24 //-----------------------------------------------------------------------------
25 /// \class AliMUONDDLTracker
26 ///
27 /// A wrapper object for 1 DDL of the MUON tracking chambers.
28 ///
29 /// \author C. Finck
30 //-----------------------------------------------------------------------------
31
32 /// \cond CLASSIMP
33 ClassImp(AliMUONDDLTracker)
34 /// \endcond
35
36 //___________________________________________
37 AliMUONDDLTracker::AliMUONDDLTracker()
38   :  TObject(),
39      fBlkHeaderArray(new TClonesArray("AliMUONBlockHeader", 2))
40 {
41   ///
42   ///ctor
43   ///
44
45 }
46
47 //___________________________________________
48 AliMUONDDLTracker::~AliMUONDDLTracker()
49 {
50   ///
51   ///dtor
52   ///
53   fBlkHeaderArray->Delete();
54   delete fBlkHeaderArray;
55
56 }
57
58 //___________________________________________
59 void AliMUONDDLTracker::AddBusPatch(const AliMUONBusStruct& busPatch, Int_t iBlock, Int_t iDsp )
60 {
61   /// adding bus patch informations
62   /// for a given block & Dsp structure
63   /// using TClonesArrays
64
65   AliMUONBlockHeader* blockHeader = (AliMUONBlockHeader*)fBlkHeaderArray->At(iBlock);
66   AliMUONDspHeader* dspHeader     = (AliMUONDspHeader*)blockHeader->GetDspHeaderEntry(iDsp);
67
68   TClonesArray* busPatchArray = (TClonesArray*)dspHeader->GetBusPatchArray();
69
70   TClonesArray &eventArray = *busPatchArray;
71   new(eventArray[eventArray.GetEntriesFast()]) AliMUONBusStruct(busPatch);
72 }
73
74 //___________________________________________
75 void AliMUONDDLTracker::AddDspHeader(const AliMUONDspHeader& dspHeader, Int_t iBlock)
76 {
77   /// adding DspHeader informations
78   /// for a given block structure
79   /// using TClonesArrays
80
81   AliMUONBlockHeader* blockHeader = (AliMUONBlockHeader*)fBlkHeaderArray->At(iBlock);
82
83   TClonesArray* dspHeaderArray = (TClonesArray*)blockHeader->GetDspHeaderArray();
84
85   TClonesArray &dspArray = *dspHeaderArray;
86   new(dspArray[dspArray.GetEntriesFast()]) AliMUONDspHeader(dspHeader);
87 }
88
89 //___________________________________________
90 void AliMUONDDLTracker::AddBlkHeader(const AliMUONBlockHeader& blkHeader)
91 {
92   /// adding Block header informations
93   /// for a given block structure
94   /// using TClonesArrays
95
96   TClonesArray &blkArray = *fBlkHeaderArray;
97   new(blkArray[blkArray.GetEntriesFast()]) AliMUONBlockHeader(blkHeader);
98 }
99
100 //___________________________________________
101 void AliMUONDDLTracker::Clear(Option_t* )
102 {
103   /// Clear TClones arrays
104   /// instead of deleting
105   ///
106   fBlkHeaderArray->Clear("C");
107
108 }