1) Added classes for digitization
[u/mrichter/AliRoot.git] / ITS / UPGRADE / AliITSUSDigit.h
CommitLineData
451f5018 1#ifndef ALIITSUSDIGIT_H
2#define ALIITSUSDIGIT_H
3/* Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6#include <TObject.h>
7
8
9class AliITSUSDigit: public TObject
10{
11 public:
12 enum {kBuffSize=10};
13 //
14 AliITSUSDigit();
15 AliITSUSDigit(Int_t track,Int_t hit,UInt_t module,UInt_t index,Double_t signal);
16 AliITSUSDigit(UInt_t module,UInt_t index,Double_t noise);
17 AliITSUSDigit(const AliITSUSDigit &source);
18 AliITSUSDigit& operator=(const AliITSUSDigit &source);
19 virtual ~AliITSUSDigit() {}
20 Double_t GetSignal(Int_t i) const {return ( (i>=0&&i<kBuffSize) ? fSignal[i] : 0.0);}
21 Double_t GetSignal() const {return fTsignal;}
22 Double_t GetSignalAfterElect() const {return fSignalAfterElect;}
23 Double_t GetSumSignal() const {return fTsignal+fNoise;}
24 Double_t GetNoise() const {return fNoise;}
25 Int_t GetNsignals() const {return kBuffSize;}
26 void AddSignal(Int_t track,Int_t hit,Double_t signal);
27 void AddSignalAfterElect(Double_t signal) {fSignalAfterElect += signal;}
28 void AddNoise(Double_t noise) {fNoise += noise;}
29 void SetNoise(Double_t noise) {fNoise = noise;}
30 Int_t GetTrack(Int_t i) const {return ((i>=0&&i<kBuffSize) ? fTrack[i] : 0);}
31 Int_t GetHit(Int_t i) const {return ((i>=0&&i<kBuffSize) ? fHits[i] : 0);}
32 Int_t GetModule() const {return fModule;}
33 Int_t GetNTracks() const {return fNTracks;}
34 //
35 void Add(const AliITSUSDigit *pl);
36 void AddTo(Int_t fileIndex, const AliITSUSDigit *pl);
37 void ShiftIndices(Int_t fileIndex);
38 void Print(ostream *os) const;
39 void Read(istream *is);
40 void Print(Option_t *option="") const;
41 Int_t Read(const char *name) {return TObject::Read(name);}
42 //
43 virtual Bool_t IsSortable() const {return kTRUE;}
44 virtual Bool_t IsEqual(const TObject* obj) const {return GetUniqueID()==obj->GetUniqueID();}
45 virtual Int_t Compare(const TObject* obj) const;
46
47 //
48 static Int_t GetBuffSize() {return kBuffSize;};
49 //
50 private:
51 UShort_t fModule; // module number
52 UShort_t fNTracks; // number of tracks contributing
53 Int_t fTrack[kBuffSize]; // track Number
54 Int_t fHits[kBuffSize]; // hit number
55 Float_t fSignal[kBuffSize]; // Signals
56 Float_t fTsignal; // Total signal (no noise)
57 Float_t fNoise; // Total noise, coupling, ...
58 Float_t fSignalAfterElect; // Signal after electronics
59 //
60 ClassDef(AliITSUSDigit,1) // Item list of signals and track numbers
61};
62
63// Input and output functions for standard C++ input/output.
64ostream & operator<<(ostream &os,AliITSUSDigit &source);
65istream & operator>>(istream &is,AliITSUSDigit &source);
66
67
68#endif