Some additional protections
[u/mrichter/AliRoot.git] / MUON / AliMUONData.h
CommitLineData
6309cf6e 1#ifndef ALIMUONDATA_H
2#define ALIMUONDATA_H
3//
1391e633 4/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
50837721 5 * See cxx source for full Copyright notice */
6
7/* $Id$ */
30178c30 8// Revision of includes 07/05/2004
6309cf6e 9//
692de412 10/// \ingroup base
11/// \class AliMUONData
12/// \brief MUON data
13///
14/// Class containing MUON data: hits, digits, rawclusters, globaltrigger,
15/// localtrigger, etc ...
16///
17/// Author: Gines Martinez, Subatech, September 2003
6309cf6e 18
30178c30 19#include <TNamed.h>
f0945e46 20
21class TArrayI;
30178c30 22
1a1cdff8 23#include "AliLoader.h"
6309cf6e 24
25class TClonesArray;
1a1cdff8 26class TNamed;
6309cf6e 27class TObjArray;
28class TTree;
f0945e46 29class TIterator;
6309cf6e 30
1a1cdff8 31class AliMUONConstants;
6309cf6e 32class AliMUONRawCluster;
dcd2690d 33class AliMUONTrack;
276c44b7 34class AliMUONTriggerTrack;
61adb9bd 35class AliMUONDigit;
36class AliMUONHit;
37class AliMUONLocalTrigger;
38class AliMUONGlobalTrigger;
6309cf6e 39
40//__________________________________________________________________
41/////////////////////////////////////////////////////////////////////
42// //
43// class AliMUONData //
44// //
45/////////////////////////////////////////////////////////////////////
46
53af523e 47class AliMUONData : public TNamed
48{
49 public:
f0945e46 50
834ca869 51 // enum EChamberIteration { kAllChambers, kTrackingChambers, kTriggerChambers };
f0945e46 52
6309cf6e 53 AliMUONData();
54 AliMUONData(AliLoader * loader, const char* name, const char* title);
6309cf6e 55 virtual ~AliMUONData();
56 virtual void AddDigit(Int_t id, Int_t* tracks, Int_t* charges,
57 Int_t* digits);
d1775029 58 virtual void AddSDigit(Int_t id, Int_t* tracks, Int_t* charges,
59 Int_t* digits);
e3ea1889 60 virtual void AddDigit(Int_t id, const AliMUONDigit& digit); // use copy constructor
61 virtual void AddSDigit(Int_t id, const AliMUONDigit& digit); // use copy constructor
6309cf6e 62 virtual void AddHit(Int_t fIshunt, Int_t track, Int_t iChamber,
63 Int_t idpart, Float_t X, Float_t Y, Float_t Z,
64 Float_t tof, Float_t momentum, Float_t theta,
d59b2ec3 65 Float_t phi, Float_t length, Float_t destep,
66 Float_t Xref,Float_t Yref,Float_t Zref);
67 // TBR
68 virtual void AddHit2(Int_t fIshunt, Int_t track, Int_t detElemId,
1391e633 69 Int_t idpart, Float_t X, Float_t Y, Float_t Z,
70 Float_t tof, Float_t momentum, Float_t theta,
71 Float_t phi, Float_t length, Float_t destep,
72 Float_t Xref,Float_t Yref,Float_t Zref);
61adb9bd 73
61adb9bd 74 virtual void AddGlobalTrigger(const AliMUONGlobalTrigger& trigger); // use copy constructor
75
61adb9bd 76 virtual void AddLocalTrigger(const AliMUONLocalTrigger& trigger); // use copy constructor
77
6309cf6e 78 virtual void AddRawCluster(Int_t id, const AliMUONRawCluster& clust);
dcd2690d 79 virtual void AddRecTrack(const AliMUONTrack& track);
276c44b7 80 virtual void AddRecTriggerTrack(const AliMUONTriggerTrack& triggertrack);
dcd2690d 81
5398f946 82 TClonesArray* Hits() {return fHits;} ///< Return hits
c82862d3 83 TClonesArray* Digits(Int_t DetectionPlane) const;
84 TClonesArray* SDigits(Int_t DetectionPlane) const;
f0945e46 85 TClonesArray* LocalTrigger() const;
86 TClonesArray* GlobalTrigger() const;
1eccde20 87 TClonesArray* RawClusters(Int_t DetectionPlane);
5398f946 88
89 /// Return reconstructed tracks
90 TClonesArray* RecTracks() {return fRecTracks;}
91 /// Return reconstructed trigger tracks
276c44b7 92 TClonesArray* RecTriggerTracks() {return fRecTriggerTracks;}
1a1cdff8 93
698b2e52 94 /// Load hits for \a i th entry in hits three
95 void GetTrack(Int_t it) const {
96 if (fLoader && fLoader->TreeH())
97 fLoader->TreeH()->GetEvent(it);
98 }
5398f946 99 /// Get number of entries in hits three
698b2e52 100 Int_t GetNtracks() const {
101 Int_t ntrk = 0;
102 if (fLoader && fLoader->TreeH())
103 ntrk = (Int_t) fLoader->TreeH()->GetEntries();
104 return ntrk;
105 }
f0945e46 106 void GetDigits() const;
5398f946 107 /// Load sdigits tree
698b2e52 108 void GetSDigits() const {
109 if (fLoader && fLoader->TreeS())
110 fLoader->TreeS()->GetEvent(0);
111 }
5398f946 112 /// Load raw clusters tree
698b2e52 113 void GetRawClusters() const {
114 if (fLoader && fLoader->TreeR())
115 fLoader->TreeR()->GetEvent(0);
116 }
5398f946 117 /// Load trigger tree
698b2e52 118 void GetTrigger() const {
119 if (fLoader && fLoader->TreeR())
120 fLoader->TreeR()->GetEvent(0);
121 }
5398f946 122 /// Load trigger D tree
698b2e52 123 void GetTriggerD() const {
124 if (fLoader && fLoader->TreeD())
125 fLoader->TreeD()->GetEvent(0);
126 }
5398f946 127 /// Return split level
30178c30 128 Int_t GetSplitLevel() const {return fSplitLevel;}
5398f946 129 /// Return reconstructed tracks
698b2e52 130 void GetRecTracks() const {
131 if (fLoader && fLoader->TreeT())
132 fLoader->TreeT()->GetEvent(0);
133 }
5398f946 134 /// Return reconstructed trigger tracks
698b2e52 135 void GetRecTriggerTracks() const {
136 if (fLoader && fLoader->TreeT())
137 fLoader->TreeT()->GetEvent(0);
138 }
1a1cdff8 139
c1d45bdf 140 Bool_t IsRawClusterBranchesInTree();
ce3e25a8 141 Bool_t IsDigitsBranchesInTree();
c1d45bdf 142 Bool_t IsTriggerBranchesInTree();
ce3e25a8 143 Bool_t IsTriggerBranchesInTreeD();
276c44b7 144 Bool_t IsTrackBranchesInTree();
145 Bool_t IsTriggerTrackBranchesInTree();
c1d45bdf 146
5398f946 147 /// Get loader
f0945e46 148 virtual AliLoader* GetLoader() const { return fLoader; }
5398f946 149 /// Set loader
ce3f5e87 150 virtual void SetLoader(AliLoader * loader) {fLoader=loader;}
dcd2690d 151
1a1cdff8 152 virtual void Fill(Option_t* opt=" ");
6309cf6e 153 virtual void MakeBranch(Option_t *opt=" ");
ce3f5e87 154 virtual void SetTreeAddress(Option_t *opt=" ");
dcd2690d 155
5398f946 156 /// Set split level
d652f85c 157 void SetSplitLevel(Int_t SplitLevel) {fSplitLevel=SplitLevel;}
158
c82862d3 159 virtual void Print(Option_t* opt="") const;
160
6309cf6e 161 virtual void ResetHits();
162 virtual void ResetDigits();
d1775029 163 virtual void ResetSDigits();
6309cf6e 164 virtual void ResetTrigger();
165 virtual void ResetRawClusters();
dcd2690d 166 virtual void ResetRecTracks();
276c44b7 167 virtual void ResetRecTriggerTracks();
6309cf6e 168
5398f946 169 /// Return tree with hits
6309cf6e 170 TTree* TreeH() {return fLoader->TreeH(); }
5398f946 171 /// Return tree with digits
6309cf6e 172 TTree* TreeD() {return fLoader->TreeD(); }
5398f946 173 /// Return tree with summable digits
d1775029 174 TTree* TreeS() {return fLoader->TreeS(); }
5398f946 175 /// Return tree with raw clusters
6309cf6e 176 TTree* TreeR() {return fLoader->TreeR(); }
5398f946 177 /// Return tree with tracks
6309cf6e 178 TTree* TreeT() {return fLoader->TreeT(); }
5398f946 179 /// Return tree with particles
6309cf6e 180 TTree* TreeP() {return fLoader->TreeP(); }
181
834ca869 182 // TIterator* CreateDigitIterator(AliMUONData::EChamberIteration type);
f0945e46 183
53af523e 184 protected:
e3ea1889 185 AliMUONData(const AliMUONData& rhs);
186 AliMUONData& operator=(const AliMUONData& rhs);
187
18b6b8c7 188 AliLoader* fLoader; //!< Detector Loader pointer
189 TClonesArray* fHits; ///< One event in treeH per primary track
190 TObjArray* fDigits; ///< One event in treeD and one branch per detection plane
191 TObjArray* fSDigits; ///< One event in treeS and one branch per detection plane
192 TObjArray* fRawClusters; ///< One event in TreeR/Rawcluster and one branch per tracking detection plane
193 TClonesArray* fGlobalTrigger; ///< List of Global Trigger One event in TreeR/GlobalTriggerBranch
194 TClonesArray* fLocalTrigger; ///< List of Local Trigger, One event in TreeR/LocalTriggerBranch
195 TClonesArray* fRecTracks; ///< pointer to array of reconstructed tracks
196 TClonesArray* fRecTriggerTracks; ///< pointer to array of reconstructed trigger tracks
197
198 Int_t fNhits; //!< Number of Hits
199 Int_t* fNdigits; //!< Number of Digits
200 Int_t* fNSdigits;//!< Number of Digits
201 Int_t* fNrawclusters; //!< Number of Raw Clusters
202 Int_t fNglobaltrigger;//!< Number of Global trigger
203 Int_t fNlocaltrigger; //!< Number of Local trigger
204 Int_t fNrectracks; //!< Number of reconstructed tracks
205 Int_t fNrectriggertracks; //!< Number of reconstructed tracks
206 Int_t fSplitLevel; ///< Splitting of branches 0 no spitting (root files are smaller) 1 splitting (larger output files)
207
208 mutable Int_t fCurrentEvent; ///< Current event we're dealing with
f0945e46 209
210private:
53af523e 211
f0945e46 212 ClassDef(AliMUONData,3) // Data accessor for MUON module
213
53af523e 214};
f0945e46 215
216
6309cf6e 217#endif
8547965d 218