Fix for ITS dictionaries
[u/mrichter/AliRoot.git] / ITS / UPGRADE / v0 / AliITSDigitUpgrade.h
CommitLineData
1d9af2d5 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 //
7// C.Terrevoli //
8// annalisa.mastroserio@cern.ch //
9// cristina.terrevoli@cern.ch //
10// //
11// Digit class for ITS upgrade //
12// //
13/////////////////////////////////////////////////////////////
14
15/* $Id$ */
16
17#include <AliDigit.h>
9b615954 18#include <TArrayI.h>
1d9af2d5 19//______________________________________________________________________
20class AliITSDigitUpgrade: public AliDigit {
21
22 public:
23 AliITSDigitUpgrade();
24 AliITSDigitUpgrade(Int_t *digits);
25 AliITSDigitUpgrade(ULong_t pixid, Float_t eloss);
26 AliITSDigitUpgrade(const AliITSDigitUpgrade &d); //copy ctor
27
9b615954 28 virtual ~AliITSDigitUpgrade() {/*destructor*/};
1d9af2d5 29 //____________________________________________________________________________________________________
30
9b615954 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")
1d9af2d5 32
9b615954 33 void AddTidOffset(Int_t offset) {for(Int_t i=0; i<kMaxLab; i++) if (fTrackIdMC[i]>-1) fTrackIdMC[i]+=offset;} //needed for merging
1d9af2d5 34
35 // setters
36
37 void SetSignal(Float_t sig) {fSignal = sig;}
38 void SetLayer(Int_t layer) {fNLayer = layer;}
0ac80088 39 void SetModule(Int_t module) {fModule = module ;}
9b615954 40 void SetNTracksIdMC(Int_t nLabels) {fNTracksIdMC = nLabels;}
1d9af2d5 41 void SetNelectrons(Double_t nele) {fNelectrons = nele;}
9b615954 42
43
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;}
1d9af2d5 48 void SetPixId(ULong_t pixid){fPixId = pixid;}
9b615954 49
50 void SetSignalID(Float_t eloss[kMaxLab]){for(Int_t i=0; i< kMaxLab; i++) fSignalID[i]=eloss[i];}
1d9af2d5 51
52 // getters
53
54 Float_t GetSignal() const {return fSignal;}
55 Int_t GetLayer() const {return fNLayer;}
0ac80088 56 Int_t GetModule() const {return fModule;}
1d9af2d5 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;}
9b615954 61 Int_t GetNTracksIdMC() const {return fNTracksIdMC;}
62 Int_t* GetTracks() {return fTrackIdMC; }
28798685 63 Int_t GetTrackID(Int_t ipart) const {if(ipart<0 || ipart>=kMaxLab) return -1; else return fTrackIdMC[ipart];}
64 Float_t GetSignalID(Int_t ipart) const {if(ipart<0 || ipart>=kMaxLab) return -1; else return fSignalID[ipart];}
1d9af2d5 65
66 void GetPosition(Int_t ilayer, Int_t nx, Int_t nz, Double_t &xloc, Double_t &zloc);
1d9af2d5 67
68 void PrintInfo();
69 inline Int_t Compare (const TObject *pObj)const;
70 Bool_t IsSortable() const {return kTRUE;}
71
72 protected:
73
28798685 74 ULong_t fPixId; // ID number of the fired pixel in a module
1d9af2d5 75 Float_t fSignal; // Signal as Eloss in the medium
28798685 76 Int_t fNLayer; // Layer
77 Int_t fModule; // Module in the layer
78 Double_t fNelectrons; // released charge due to E loss
79 Int_t fNTracksIdMC; // Number of MC particles which produced the Digit
9b615954 80 Int_t fTrackIdMC[kMaxLab]; // MC track labels
28798685 81 Float_t fSignalID[kMaxLab]; // E loss
9b615954 82
83
84 private:
85 AliITSDigitUpgrade &operator=(const AliITSDigitUpgrade &); // not implemented
86
1d9af2d5 87
1d9af2d5 88 ClassDef(AliITSDigitUpgrade,3) // Simulated digit object for ITS upgrade
89
9b615954 90
91
92};
1d9af2d5 93#endif
9b615954 94
1d9af2d5 95Int_t AliITSDigitUpgrade::Compare(const TObject *pObj) const
96{
97 // Arguments: pObj - pointer to object to compare with
8b4123ca 98 //
0ac80088 99
8b4123ca 100 Int_t result = -1;
9b615954 101 if (fModule>((AliITSDigitUpgrade*)pObj)->GetModule()) result=1;
102
0ac80088 103 else if(fModule==((AliITSDigitUpgrade*)pObj)->GetModule()){
9b615954 104 if (fPixId==((AliITSDigitUpgrade*)pObj)->GetPixId()) result=0;
105 else if(fPixId >((AliITSDigitUpgrade*)pObj)->GetPixId()) result=1;
106 }
8b4123ca 107 return result;
9b615954 108
1d9af2d5 109}
110
111