bug in loop, wrong varialble in increment
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALTriggerPatch.cxx
CommitLineData
916f1e76 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15
16/*
17
18
19
20Patch object implementation: one patch is made of subregions (Olivier's nomenclature)
21Author: R. GUERNANE LPSC Grenoble CNRS/IN2P3
22*/
23
24#include "AliEMCALTriggerPatch.h"
de39a0ff 25#include "AliLog.h"
916f1e76 26
27ClassImp(AliEMCALTriggerPatch)
28
29//____________
30AliEMCALTriggerPatch::AliEMCALTriggerPatch() : TObject(),
31fPosition(0x0),
de39a0ff 32fSum(0),
33fTime(0),
34fPeaks(0)
916f1e76 35{
36 // Default constructor
37}
38
39//____________
de39a0ff 40AliEMCALTriggerPatch::AliEMCALTriggerPatch(Int_t i, Int_t j, Int_t k, Int_t l) : TObject(),
41fPosition(new TVector2(i, j)),
42fSum(k),
43fTime(l),
44fPeaks(0)
916f1e76 45{
de39a0ff 46 //
916f1e76 47}
48
916f1e76 49//____________________________________________________________________
50AliEMCALTriggerPatch::AliEMCALTriggerPatch(const AliEMCALTriggerPatch& other) : TObject(other),
de39a0ff 51fPosition(new TVector2(*other.fPosition)),
52fSum(other.fSum),
53fTime(other.fTime),
54fPeaks(other.fPeaks)
916f1e76 55{
56 // Copy ctor
57}
58
59//____________
60AliEMCALTriggerPatch::~AliEMCALTriggerPatch()
61{
de39a0ff 62 //
916f1e76 63 if (fPosition) delete fPosition;
64}
65
66//____________
de39a0ff 67void AliEMCALTriggerPatch::SetPeak(Int_t x, Int_t y, Int_t sizeX, Int_t sizeY)
916f1e76 68{
de39a0ff 69 //
70 if (sizeX * sizeY > 31) AliError("32b limit exceeded!");
71
72 fPeaks = (fPeaks | (1 << (y * sizeX + x)));
916f1e76 73}
74
de39a0ff 75//____________
76void AliEMCALTriggerPatch::Print(const Option_t*) const
916f1e76 77{
de39a0ff 78 //
79 printf("]> Patch at (%2d , %2d) w/ sum %3d time %2d\n",
80 (int)fPosition->X(), (int)fPosition->Y(), fSum, fTime);
916f1e76 81}