1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 #include "AliMUONDDLTracker.h"
19 #include "AliMUONBusStruct.h"
20 #include "AliMUONDspHeader.h"
21 #include "AliMUONBlockHeader.h"
24 //-----------------------------------------------------------------------------
25 /// \class AliMUONDDLTracker
27 /// A wrapper object for 1 DDL of the MUON tracking chambers.
30 //-----------------------------------------------------------------------------
33 ClassImp(AliMUONDDLTracker)
36 //___________________________________________
37 AliMUONDDLTracker::AliMUONDDLTracker()
39 fBlkHeaderArray(new TClonesArray("AliMUONBlockHeader", 2))
47 //___________________________________________
48 AliMUONDDLTracker::~AliMUONDDLTracker()
53 fBlkHeaderArray->Delete();
54 delete fBlkHeaderArray;
58 //___________________________________________
59 void AliMUONDDLTracker::AddBusPatch(const AliMUONBusStruct& busPatch, Int_t iBlock, Int_t iDsp )
61 /// adding bus patch informations
62 /// for a given block & Dsp structure
63 /// using TClonesArrays
65 AliMUONBlockHeader* blockHeader = (AliMUONBlockHeader*)fBlkHeaderArray->At(iBlock);
66 AliMUONDspHeader* dspHeader = (AliMUONDspHeader*)blockHeader->GetDspHeaderEntry(iDsp);
68 TClonesArray* busPatchArray = (TClonesArray*)dspHeader->GetBusPatchArray();
70 TClonesArray &eventArray = *busPatchArray;
71 new(eventArray[eventArray.GetEntriesFast()]) AliMUONBusStruct(busPatch);
74 //___________________________________________
75 void AliMUONDDLTracker::AddDspHeader(const AliMUONDspHeader& dspHeader, Int_t iBlock)
77 /// adding DspHeader informations
78 /// for a given block structure
79 /// using TClonesArrays
81 AliMUONBlockHeader* blockHeader = (AliMUONBlockHeader*)fBlkHeaderArray->At(iBlock);
83 TClonesArray* dspHeaderArray = (TClonesArray*)blockHeader->GetDspHeaderArray();
85 TClonesArray &dspArray = *dspHeaderArray;
86 new(dspArray[dspArray.GetEntriesFast()]) AliMUONDspHeader(dspHeader);
89 //___________________________________________
90 void AliMUONDDLTracker::AddBlkHeader(const AliMUONBlockHeader& blkHeader)
92 /// adding Block header informations
93 /// for a given block structure
94 /// using TClonesArrays
96 TClonesArray &blkArray = *fBlkHeaderArray;
97 new(blkArray[blkArray.GetEntriesFast()]) AliMUONBlockHeader(blkHeader);
100 //___________________________________________
101 void AliMUONDDLTracker::Clear(Option_t* )
103 /// Clear TClones arrays
104 /// instead of deleting
106 fBlkHeaderArray->Clear("C");