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