1 /**************************************************************************
2 * This file is property of and copyright by the ALICE HLT Project *
3 * All rights reserved. *
5 * Primary Authors: Oystein Djuvsland *
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 **************************************************************************/
16 #include "AliHLTPHOSMIPCounter.h"
17 #include "AliHLTPHOSDigitContainerDataStruct.h"
20 AliHLTPHOSMIPCounter::AliHLTPHOSMIPCounter()
27 fUpperStartTime ( 0 ),
28 fLowerStartTime ( 0 ),
36 AliHLTPHOSMIPCounter::~AliHLTPHOSMIPCounter()
41 AliHLTPHOSMIPCounter::CountMIPs(AliHLTPHOSDigitContainerDataStruct* digitContainerPtr)
46 AliHLTPHOSDigitDataStruct *digitPtr;
47 for(UInt_t i = 0; i < digitContainerPtr->fNDigits; i++)
49 digitPtr = &(digitContainerPtr->fDigitDataStruct[i]);
50 dataPtr = digitPtr->fData;
51 if(digitPtr->fCrazyness != 0)
55 if(digitPtr->fAmplitude < fLowerBound || digitPtr->fAmplitude > fUpperBound)
59 for(Int_t time = (Int_t)(digitPtr->fTime - 2); time < (digitPtr->fTime - 3); time++)
61 if((Float_t)dataPtr[time] < (digitPtr->fAmplitude - (digitPtr->fAmplitude)/10))
69 for(Int_t sample = 0; sample < fLowerStartTime; sample++)
71 if(dataPtr[sample] > fZeroThreshold || dataPtr[sample] < -fZeroThreshold)
77 if(dataPtr[(Int_t)fUpperStartTime + 3] < fZeroThreshold)
82 fChannelHistPtr->Fill(digitPtr->fX, digitPtr->fZ);
85 fMIPCountTotal += fMIPCountEvent;
86 return fMIPCountEvent;