Reduced memory consumption (Bogdan)
[u/mrichter/AliRoot.git] / TRD / AliTRDtrigger.h
CommitLineData
0ee00e25 1#ifndef ALITRDTRIGGER_H
2#define ALITRDTRIGGER_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6///////////////////////////////////////////////////////////////////////////////
7// //
8// TRD trigger class //
9// //
10///////////////////////////////////////////////////////////////////////////////
11
e3b2b5e5 12#include <TNamed.h>
0ee00e25 13#include <TObjArray.h>
14#include <TClonesArray.h>
0ee00e25 15
e3b2b5e5 16#include "AliTRDgtuTrack.h"
0ee00e25 17
e3b2b5e5 18class TTree;
0ee00e25 19
20class AliTRDdigitsManager;
21class AliTRDdataArrayI;
3fcb9908 22class AliTRDgeometry;
23class AliTRDcalibDB;
24class AliTRDCommonParam;
0ee00e25 25
26class AliRunLoader;
27class AliRawReader;
28
29class AliTRDmcmTracklet;
30class AliTRDmcm;
31class AliTRDmodule;
e3b2b5e5 32class AliTRDtrigParam;
0ee00e25 33
34class AliTRDtrigger : public TNamed {
35
36 public:
37
e3b2b5e5 38 enum { kNMCM = 16, kMaxTrackletsPerMCM = 4, kMcmCol = 21 };
0ee00e25 39
40 AliTRDtrigger();
41 AliTRDtrigger(const Text_t* name, const Text_t* title);
42 AliTRDtrigger(const AliTRDtrigger &p);
43 virtual ~AliTRDtrigger();
44
45 AliTRDtrigger &operator=(const AliTRDtrigger &p);
46 virtual void Copy(TObject &p) const;
47
e3b2b5e5 48 void Init();
0ee00e25 49
e3b2b5e5 50 void SetRunLoader(AliRunLoader *rl) { fRunLoader = rl; };
51 Bool_t Open(const Char_t *name, Int_t nEvent = 0);
52 Bool_t ReadDigits();
53 Bool_t ReadDigits(AliRawReader* rawReader);
54 Bool_t MakeTracklets(Bool_t makeTracks = kFALSE);
55 Bool_t WriteTracklets(Int_t det);
56 Bool_t ReadTracklets(AliRunLoader *rl);
0ee00e25 57
e3b2b5e5 58 void AddTracklet(Int_t det, Int_t row, Int_t seed, Int_t n);
3fcb9908 59 Bool_t TestTracklet(Int_t det, Int_t row, Int_t seed, Int_t n);
e3b2b5e5 60 TObjArray *Tracklets() {
0ee00e25 61 if(!fTracklets) fTracklets = new TObjArray(400); return fTracklets;
62 };
e3b2b5e5 63 void ResetTracklets() { if(fTracklets) fTracklets->Delete(); };
64 void SetMCMcoordinates(Int_t imcm);
65 void SetParameter(AliTRDtrigParam *trigp) { fTrigParam = trigp; };
66 AliTRDtrigParam *GetParameter() const { return fTrigParam; };
0ee00e25 67
e3b2b5e5 68 void MakeTracks(Int_t det);
0ee00e25 69
70 AliTRDgtuTrack *GetTrack(Int_t i) const {
71 return (AliTRDgtuTrack *)fTracks.UncheckedAt(i);
72 }
73 void AddTrack(const AliTRDgtuTrack *t, Int_t det) {
74 AliTRDgtuTrack * track = new(fTracks[fTracks.GetEntriesFast()]) AliTRDgtuTrack(*t);
75 track->SetDetector(det);
76 }
77 Int_t GetNumberOfTracks() const {return fTracks.GetEntriesFast();}
78
e3b2b5e5 79 Int_t GetNPrimary() const { return fNPrimary; };
0ee00e25 80
81 protected:
82
3fcb9908 83 Float_t fField; //! Magnetic field
84 AliTRDgeometry *fGeo; //! TRD geometry
85 AliTRDcalibDB *fCalib; //! Calibration DB
86 AliTRDCommonParam *fCParam; //! Common parameters
87
0ee00e25 88 AliTRDtrigParam *fTrigParam; //! Trigger class parameters
89 AliRunLoader *fRunLoader; //! Run Loader
90 AliTRDdigitsManager *fDigitsManager; //! TRD digits manager
91 TTree *fTrackletTree; //! Tree with tracklets
92 TObjArray *fTracklets; //! Array of tracklets
93
94 Int_t fNROB; //! Number of ROBs in the current chamber
95 AliTRDmcm *fMCM; //! Current MCM
96 AliTRDmcmTracklet *fTrk; //! Current tracklet
3fcb9908 97 AliTRDmcmTracklet *fTrkTest; //! Test tracklet
0ee00e25 98 AliTRDmodule *fModule; //! Current module
99 AliTRDgtuTrack *fGTUtrk; //! Current GTU track
100
101 Int_t fNtracklets; //! Tracklets counter
102
103 AliTRDdataArrayI *fDigits; //! Array with digits
104 AliTRDdataArrayI *fTrack0; //! Track dictionary 0
105 AliTRDdataArrayI *fTrack1; //! Track dictionary 1
106 AliTRDdataArrayI *fTrack2; //! Track dictionary 2
107
108 Int_t fNPrimary; //! Number of primary tracks
109
110 TClonesArray fTracks; //! Array of GTU tracks
111
e3b2b5e5 112 ClassDef(AliTRDtrigger,2) // TRD trigger class
0ee00e25 113
114};
115
116#endif