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 /////////////////////////////////////////////////////////////////
10 #include "AliITSOnlineSPDHitArray.h"
12 ClassImp(AliITSOnlineSPDHitArray)
14 AliITSOnlineSPDHitArray::AliITSOnlineSPDHitArray() {
16 for (Int_t i=0; i<81920; i++) {
21 AliITSOnlineSPDHitArray* AliITSOnlineSPDHitArray::CloneThis() const {
22 // makes a copy of this object and returns it
23 AliITSOnlineSPDHitArray* returnpointer = new AliITSOnlineSPDHitArray();
24 for (Int_t chip=0; chip<10; chip++) {
25 for (Int_t col=0; col<32; col++) {
26 for (Int_t row=0; row<256; row++) {
27 returnpointer->SetHits(chip,col,row,fHits[GetKey(chip,col,row)]);
34 void AliITSOnlineSPDHitArray::IncrementHits(UInt_t chip, UInt_t col, UInt_t row) {
35 fHits[GetKey(chip,col,row)] ++;
37 void AliITSOnlineSPDHitArray::SetHits(UInt_t chip, UInt_t col, UInt_t row, UInt_t hits) {
38 fHits[GetKey(chip,col,row)] = hits;
40 UInt_t AliITSOnlineSPDHitArray::GetHits(UInt_t chip, UInt_t col, UInt_t row) const {
41 return fHits[GetKey(chip,col,row)];
43 UInt_t AliITSOnlineSPDHitArray::GetKey(UInt_t chip, UInt_t col, UInt_t row) const {
44 return chip*256*32 + col*256 + row;