Bug fix by Theodor
[u/mrichter/AliRoot.git] / TRD / AliTRDdigitizer.h
CommitLineData
dd9a6ee3 1#ifndef ALITRDDIGITIZER_H
2#define ALITRDDIGITIZER_H
f7336fa3 3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6/* $Id$ */
7
4d18a639 8////////////////////////////////////////////////////////////////////////////
9// //
10// Produces digits from the hits information //
11// //
12////////////////////////////////////////////////////////////////////////////
13
85cbec76 14#include "AliDigitizer.h"
f7336fa3 15
793ff80c 16class TFile;
17class TF1;
18
85cbec76 19class AliRunDigitizer;
88cb7938 20class AliRunLoader;
85cbec76 21
793ff80c 22class AliTRD;
6f1e466d 23class AliTRDdigitsManager;
793ff80c 24class AliTRDgeometry;
b65e5048 25class AliTRDarraySignal;
26class AliTRDarrayADC;
f7336fa3 27
85cbec76 28class AliTRDdigitizer : public AliDigitizer {
f7336fa3 29
30 public:
31
32 AliTRDdigitizer();
4d18a639 33 AliTRDdigitizer(const Text_t *name, const Text_t *title);
34 AliTRDdigitizer(AliRunDigitizer *manager, const Text_t *name, const Text_t *title);
bfc40adc 35 AliTRDdigitizer(AliRunDigitizer *manager);
dd9a6ee3 36 AliTRDdigitizer(const AliTRDdigitizer &d);
625f5260 37 virtual ~AliTRDdigitizer();
38 AliTRDdigitizer &operator=(const AliTRDdigitizer &d);
39
40 virtual void Copy(TObject &d) const;
41 Bool_t InitDetector();
42 void InitOutput(Int_t iEvent);
43 virtual void Exec(Option_t *option = 0);
44
45 virtual Bool_t Open(const Char_t *file, Int_t nEvent = 0);
46 virtual Bool_t Open(AliRunLoader *runLoader, Int_t nEvent = 0);
47 virtual Bool_t MakeBranch(TTree *tree) const;
48 virtual Bool_t WriteDigits() const;
49
50 virtual void AddSDigitsManager(AliTRDdigitsManager *manager);
51 virtual void DeleteSDigitsManager();
52
53 virtual Bool_t MakeDigits();
54
55 Bool_t SortHits(Float_t **hits, Int_t *nhit);
b65e5048 56 Bool_t ConvertHits(Int_t det, Float_t *hits, Int_t nhit, AliTRDarraySignal *signals);
57 Bool_t ConvertSignals(Int_t det, AliTRDarraySignal *signals);
625f5260 58
e7539003 59 Bool_t Digits2SDigits(AliTRDdigitsManager *manDig, AliTRDdigitsManager *manSDig);
625f5260 60 Bool_t SDigits2Digits();
61 Bool_t MergeSDigits();
62 Bool_t ConvertSDigits();
63
b65e5048 64 Bool_t Signal2ADC(Int_t det, AliTRDarraySignal *signals);
65 Bool_t Signal2SDigits(Int_t det, AliTRDarraySignal *signals);
625f5260 66 Bool_t CopyDictionary(Int_t det);
b65e5048 67 void CompressOutputArrays(Int_t det);
625f5260 68
69 void SetCompress(Int_t c = 1) { fCompress = c; }
70 void SetSDigits(Int_t v = 1) { fSDigits = v; }
71 void SetEvent(Int_t v = 0) { fEvent = v; }
72 void SetManager(AliTRDdigitsManager *man) { fDigitsManager = man; }
73 void SetGeometry(AliTRDgeometry *geo) { fGeo = geo; }
74 void SetMergeSignalOnly(Bool_t m = kTRUE) { fMergeSignalOnly = m; }
75
76 AliTRDdigitsManager *Digits() const { return fDigitsManager; }
77
78 Bool_t GetCompress() const { return fCompress; }
79 Bool_t GetSDigits() const { return fSDigits; }
625f5260 80 Float_t GetLorentzFactor(Float_t vdrift);
81
625f5260 82 Int_t Diffusion(Float_t vdrift, Double_t absdriftlength
83 , Double_t &lRow, Double_t &lCol, Double_t &lTime);
84 Int_t ExB(Float_t vdrift, Double_t driftlength, Double_t &lRow);
d295185b 85 void RunDigitalProcessing(Int_t det = 0);
b65e5048 86
3becff3c 87 protected:
f7336fa3 88
625f5260 89 virtual Bool_t Init();
4d18a639 90
f4611fed 91 AliRunLoader *fRunLoader; //! Local pointer
abaf1f1d 92 AliTRDdigitsManager *fDigitsManager; //! Manager for the output digits
93 AliTRDdigitsManager *fSDigitsManager; //! Manager for the summed input s-digits
94 TList *fSDigitsManagerList; //! List of managers of input s-digits
95 AliTRD *fTRD; //! TRD detector class
96 AliTRDgeometry *fGeo; //! TRD geometry
4d18a639 97
625f5260 98 Int_t fEvent; //! Event number
99 Int_t *fMasks; //! Masks for the merging
100 Bool_t fCompress; // Switch to keep only compressed data in memory
101 Bool_t fSDigits; // Switch for the summable digits
102 Bool_t fMergeSignalOnly; // Merge only detectors that contain a signal
793ff80c 103
a076fc2f 104 ClassDef(AliTRDdigitizer,19) // Produces TRD-Digits
625f5260 105
106};
f7336fa3 107#endif