]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/UPGRADE/AliITSDigitUpgrade.h
In AliMUONGeometryModuleTransformer:
[u/mrichter/AliRoot.git] / ITS / UPGRADE / 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>
18
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
28 virtual ~AliITSDigitUpgrade(){/*destructor*/;}
29 //____________________________________________________________________________________________________
30
31
32 void AddTidOffset(Int_t offset) {for(Int_t i=0; i<3; i++) if (fTracks[i]>0) fTracks[i]+=offset;} //needed for merging
33
34 // setters
35
36 void SetSignal(Float_t sig) {fSignal = sig;}
37 void SetLayer(Int_t layer) {fNLayer = layer;}
0ac80088 38 void SetModule(Int_t module) {fModule = module ;}
1d9af2d5 39 void SetNelectrons(Double_t nele) {fNelectrons = nele;}
40 void SetTrackID(Int_t tid) {fTracks[0]=tid;}
41 void SetPixId(ULong_t nx, ULong_t nz) {fPixId = 100000*nx + nz ;}
42 void SetPixId(ULong_t pixid){fPixId = pixid;}
43 void SetTids(Int_t tids[3]){ for(Int_t i=0; i<3; i++) fTracks[i]=tids[i];} // tracks participating to form the digit
44 void SetSignalID(Float_t eloss[3]){for(Int_t i=0; i< 3; i++) fSignalID[i]=eloss[i];}
45
46 // getters
47
48 Float_t GetSignal() const {return fSignal;}
49 Int_t GetLayer() const {return fNLayer;}
0ac80088 50 Int_t GetModule() const {return fModule;}
1d9af2d5 51 Double_t GetNelectrons() const {return fNelectrons;}
52 ULong_t GetPixId(){return fPixId;}
53 Int_t GetxPixelNumber() const {return fPixId/100000;}
54 Int_t GetzPixelNumber() const {return fPixId%100000;}
55
56 void GetPosition(Int_t ilayer, Int_t nx, Int_t nz, Double_t &xloc, Double_t &zloc);
57 Float_t GetSignalID(Int_t ipart) {if(ipart<0 || ipart >2) return -1; else return fSignalID[ipart];}
58
59 void PrintInfo();
60 inline Int_t Compare (const TObject *pObj)const;
61 Bool_t IsSortable() const {return kTRUE;}
62
63 protected:
64
65 ULong_t fPixId;
66 Float_t fSignal; // Signal as Eloss in the medium
67 Int_t fNLayer;
0ac80088 68 Int_t fModule;
1d9af2d5 69 Double_t fNelectrons;
70 Float_t fSignalID[3];
71
72
73 ClassDef(AliITSDigitUpgrade,3) // Simulated digit object for ITS upgrade
74
75 };
76#endif
77Int_t AliITSDigitUpgrade::Compare(const TObject *pObj) const
78{
79 // Arguments: pObj - pointer to object to compare with
8b4123ca 80 //
0ac80088 81
8b4123ca 82 Int_t result = -1;
83 if (fModule>((AliITSDigitUpgrade*)pObj)->GetModule()) result=1;
0ac80088 84
85 else if(fModule==((AliITSDigitUpgrade*)pObj)->GetModule()){
8b4123ca 86 if (fPixId==((AliITSDigitUpgrade*)pObj)->GetPixId()) result=0;
87 else if(fPixId >((AliITSDigitUpgrade*)pObj)->GetPixId()) result=1;
0ac80088 88 }
8b4123ca 89 return result;
1d9af2d5 90}
91
92