1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
20 Author: R. GUERNANE LPSC Grenoble CNRS/IN2P3
23 // --- ROOT system ---AliEMCALTriggerRawDigit
24 #include <Riostream.h>
27 #include "AliEMCALTriggerRawDigit.h"
29 ClassImp(AliEMCALTriggerRawDigit)
31 //____________________________________________________________________________
32 AliEMCALTriggerRawDigit::AliEMCALTriggerRawDigit() : AliEMCALRawDigit(),
39 for (Int_t i = 0; i < 10; i++) fL0Times[i] = -1;
42 //____________________________________________________________________________
43 AliEMCALTriggerRawDigit::AliEMCALTriggerRawDigit(Int_t id, Int_t timeSamples[], Int_t nSamples) : AliEMCALRawDigit(id, timeSamples, nSamples),
51 for (Int_t i = 0; i < 10; i++) fL0Times[i] = -1;
54 //____________________________________________________________________________
55 AliEMCALTriggerRawDigit::~AliEMCALTriggerRawDigit()
62 //____________________________________________________________________________
63 Bool_t AliEMCALTriggerRawDigit::SetL0Time(const Int_t i)
67 for (Int_t j = 0; j < fNL0Times; j++)
71 AliDebug(1,Form("Digit id %d: L0 time %d already there! Won't add it twice",fId,i));
80 AliError("More than 10 L0 times!");
84 fL0Times[fNL0Times - 1] = i;
89 //____________________________________________________________________________
90 Bool_t AliEMCALTriggerRawDigit::GetL0Time(const Int_t i, Int_t& time) const
94 if (i < 0 || i > fNL0Times)
96 AliError("Bad index!");
105 //____________________________________________________________________________
106 Bool_t AliEMCALTriggerRawDigit::GetL0Times(Int_t times[]) const
110 for (Int_t i = 0; i < fNL0Times; i++) times[i] = fL0Times[i];
115 //____________________________________________________________________________
116 Int_t AliEMCALTriggerRawDigit::GetL0TimeSum(const Int_t time) const
122 for (Int_t i = 0; i < fNSamples; i++)
125 GetTimeSample(i, timeBin, amp);
127 if (timeBin >= time && timeBin < time + 4) value += amp;
133 //____________________________________________________________________________
134 Int_t AliEMCALTriggerRawDigit::GetTriggerBit(const TriggerType_t type, const Int_t mode) const
138 Int_t shift = kTriggerTypeEnd * mode;
139 Int_t mask = 1 << type;
141 return ((fTriggerBits >> shift) & mask);
144 //____________________________________________________________________________
145 void AliEMCALTriggerRawDigit::Print(const Option_t* /*opt*/) const
149 printf("===\n| Digit id: %4d / %d Time Samples: \n",fId,fNSamples);
150 for (Int_t i=0; i < fNSamples; i++)
153 GetTimeSample(i, timeBin, amp);
154 printf("| (%d,%d) ",timeBin,amp);
157 printf("| L0: (%d,%d) / %d Time(s): \n",GetTriggerBit(kL0,1),GetTriggerBit(kL0,0),fNL0Times);
158 for (Int_t i = 0; i < fNL0Times; i++)
161 if (GetL0Time(i, time)) printf("| %d ",time);
164 printf("| L1: g high (%d,%d) g low (%d,%d) j high (%d,%d) j low (%d,%d) / Time sum: %d\n",
165 GetTriggerBit(kL1GammaHigh,1),GetTriggerBit(kL1GammaHigh,0),GetTriggerBit(kL1GammaLow,1),GetTriggerBit(kL1GammaLow,0),
166 GetTriggerBit(kL1JetHigh,1), GetTriggerBit(kL1JetHigh,0), GetTriggerBit(kL1JetLow,1), GetTriggerBit(kL1JetLow,0),