Line data Source code
1 : /////////////////////////////////////////////////////////////////
2 : // Author: Henrik Tydesjo //
3 : // This class is used as a container online. //
4 : // One object for each half stave and step in a scan. It keeps //
5 : // the nr of hits in each pixel. //
6 : // This class should only be used through the interface of the //
7 : // AliITSOnlineSPDscan class. //
8 : /////////////////////////////////////////////////////////////////
9 :
10 : #include "AliITSOnlineSPDHitArray.h"
11 :
12 116 : ClassImp(AliITSOnlineSPDHitArray)
13 :
14 0 : AliITSOnlineSPDHitArray::AliITSOnlineSPDHitArray() {
15 : // constructor
16 0 : for (Int_t i=0; i<81920; i++) {
17 0 : fHits[i]=0;
18 : }
19 0 : }
20 :
21 : AliITSOnlineSPDHitArray* AliITSOnlineSPDHitArray::CloneThis() const {
22 : // makes a copy of this object and returns it
23 0 : AliITSOnlineSPDHitArray* returnpointer = new AliITSOnlineSPDHitArray();
24 0 : for (Int_t chip=0; chip<10; chip++) {
25 0 : for (Int_t col=0; col<32; col++) {
26 0 : for (Int_t row=0; row<256; row++) {
27 0 : returnpointer->SetHits(chip,col,row,fHits[GetKey(chip,col,row)]);
28 : }
29 : }
30 : }
31 0 : return returnpointer;
32 0 : }
33 :
34 : void AliITSOnlineSPDHitArray::IncrementHits(UInt_t chip, UInt_t col, UInt_t row) {
35 0 : fHits[GetKey(chip,col,row)] ++;
36 0 : }
37 : void AliITSOnlineSPDHitArray::SetHits(UInt_t chip, UInt_t col, UInt_t row, UInt_t hits) {
38 0 : fHits[GetKey(chip,col,row)] = hits;
39 0 : }
40 : UInt_t AliITSOnlineSPDHitArray::GetHits(UInt_t chip, UInt_t col, UInt_t row) const {
41 0 : return fHits[GetKey(chip,col,row)];
42 : }
43 : UInt_t AliITSOnlineSPDHitArray::GetKey(UInt_t chip, UInt_t col, UInt_t row) const {
44 0 : return chip*256*32 + col*256 + row;
45 : }
|