]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONDDLTracker.cxx
Modified for new raw data interface
[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 #include "AliMUONDDLTracker.h"
17 #include "AliMUONBusStruct.h"
18 #include "AliMUONDspHeader.h"
19 #include "AliMUONBlockHeader.h"
20
21 ClassImp(AliMUONDDLTracker)
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 //___________________________________________
33 AliMUONDDLTracker::AliMUONDDLTracker()
34   :  TObject()
35 {
36   //
37   //ctor
38   //
39   fBlkHeaderArray = new TClonesArray("AliMUONBlockHeader", 2);
40
41 }
42
43 //___________________________________________
44 AliMUONDDLTracker::~AliMUONDDLTracker()
45 {
46   //
47   //dtor
48   //
49   fBlkHeaderArray->Delete();
50   delete fBlkHeaderArray;
51
52 }
53
54 //___________________________________________
55 void AliMUONDDLTracker::AddBusPatch(const AliMUONBusStruct& busPatch, Int_t iBlock, Int_t iDsp )
56 {
57   // adding bus patch informations
58   // for a given block & Dsp structure
59   // using TClonesArrays
60
61   AliMUONBlockHeader* blockHeader = (AliMUONBlockHeader*)fBlkHeaderArray->At(iBlock);
62   AliMUONDspHeader* dspHeader     = (AliMUONDspHeader*)blockHeader->GetDspHeaderEntry(iDsp);
63
64   TClonesArray* busPatchArray = (TClonesArray*)dspHeader->GetBusPatchArray();
65
66   TClonesArray &eventArray = *busPatchArray;
67   new(eventArray[eventArray.GetEntriesFast()]) AliMUONBusStruct(busPatch);
68 }
69
70 //___________________________________________
71 void AliMUONDDLTracker::AddDspHeader(const AliMUONDspHeader& dspHeader, Int_t iBlock)
72 {
73   // adding DspHeader informations
74   // for a given block structure
75   // using TClonesArrays
76
77   AliMUONBlockHeader* blockHeader = (AliMUONBlockHeader*)fBlkHeaderArray->At(iBlock);
78
79   TClonesArray* dspHeaderArray = (TClonesArray*)blockHeader->GetDspHeaderArray();
80
81   TClonesArray &dspArray = *dspHeaderArray;
82   new(dspArray[dspArray.GetEntriesFast()]) AliMUONDspHeader(dspHeader);
83 }
84
85 //___________________________________________
86 void AliMUONDDLTracker::AddBlkHeader(const AliMUONBlockHeader& blkHeader)
87 {
88   TClonesArray &blkArray = *fBlkHeaderArray;
89   new(blkArray[blkArray.GetEntriesFast()]) AliMUONBlockHeader(blkHeader);
90 }
91
92 //___________________________________________
93 void AliMUONDDLTracker::Clear(Option_t* )
94 {
95   // Clear TClones arrays
96   // instead of deleting
97   //
98   fBlkHeaderArray->Clear("C");
99
100 }