1 #ifndef ALIITSDigitUpgrade_H
2 #define ALIITSDigitUpgrade_H
3 /* Copyright(c) 2004-2006, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5 /////////////////////////////////////////////////////////////
6 // Authors A.Mastroserio //
8 // annalisa.mastroserio@cern.ch //
9 // cristina.terrevoli@cern.ch //
11 // Digit class for ITS upgrade //
13 /////////////////////////////////////////////////////////////
19 //______________________________________________________________________
20 class AliITSDigitUpgrade: public AliDigit {
24 AliITSDigitUpgrade(Int_t *digits);
25 AliITSDigitUpgrade(ULong_t pixid, Float_t eloss);
26 AliITSDigitUpgrade(const AliITSDigitUpgrade &d); //copy ctor
28 virtual ~AliITSDigitUpgrade() {/*destructor*/};
29 //____________________________________________________________________________________________________
31 enum {kMaxLab=12}; // maximum number of MC labels associated to the digit (4 times as much as can be stored in the "mother class")
33 void AddTidOffset(Int_t offset) {for(Int_t i=0; i<kMaxLab; i++) if (fTrackIdMC[i]>-1) fTrackIdMC[i]+=offset;} //needed for merging
37 void SetSignal(Float_t sig) {fSignal = sig;}
38 void SetLayer(Int_t layer) {fNLayer = layer;}
39 void SetModule(Int_t module) {fModule = module ;}
40 void SetNTracksIdMC(Int_t nLabels) {fNTracksIdMC = nLabels;}
41 void SetNelectrons(Double_t nele) {fNelectrons = nele;}
44 void SetTrackID(Int_t tid) {fTrackIdMC[0]=tid; }
45 void SetTids(Int_t tids[kMaxLab]){ for(Int_t i=0; i<kMaxLab; i++) fTrackIdMC[i]=tids[i];} // tracks participating to form the digit
46 void AddTrackID(Int_t tid);
47 void SetPixId(ULong_t nx, ULong_t nz) {fPixId = 100000*nx + nz;}
48 void SetPixId(ULong_t pixid){fPixId = pixid;}
50 void SetSignalID(Float_t eloss[kMaxLab]){for(Int_t i=0; i< kMaxLab; i++) fSignalID[i]=eloss[i];}
54 Float_t GetSignal() const {return fSignal;}
55 Int_t GetLayer() const {return fNLayer;}
56 Int_t GetModule() const {return fModule;}
57 Double_t GetNelectrons() const {return fNelectrons;}
58 ULong_t GetPixId(){return fPixId;}
59 Int_t GetxPixelNumber() const {return fPixId/100000;}
60 Int_t GetzPixelNumber() const {return fPixId%100000;}
61 Int_t GetNTracksIdMC() const {return fNTracksIdMC;}
62 Int_t* GetTracks() {return fTrackIdMC; }
63 Int_t GetTrackID(Int_t ipart) {if(ipart<0 || ipart>=kMaxLab) return -1; else return fTrackIdMC[ipart];}
64 Float_t GetSignalID(Int_t ipart) {if(ipart<0 || ipart>=kMaxLab) return -1; else return fSignalID[ipart];}
66 void GetPosition(Int_t ilayer, Int_t nx, Int_t nz, Double_t &xloc, Double_t &zloc);
69 inline Int_t Compare (const TObject *pObj)const;
70 Bool_t IsSortable() const {return kTRUE;}
75 Float_t fSignal; // Signal as Eloss in the medium
80 Int_t fTrackIdMC[kMaxLab]; // MC track labels
81 Float_t fSignalID[kMaxLab];
85 AliITSDigitUpgrade &operator=(const AliITSDigitUpgrade &); // not implemented
88 ClassDef(AliITSDigitUpgrade,3) // Simulated digit object for ITS upgrade
95 Int_t AliITSDigitUpgrade::Compare(const TObject *pObj) const
97 // Arguments: pObj - pointer to object to compare with
101 if (fModule>((AliITSDigitUpgrade*)pObj)->GetModule()) result=1;
103 else if(fModule==((AliITSDigitUpgrade*)pObj)->GetModule()){
104 if (fPixId==((AliITSDigitUpgrade*)pObj)->GetPixId()) result=0;
105 else if(fPixId >((AliITSDigitUpgrade*)pObj)->GetPixId()) result=1;