]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EMCAL/AliCaloRawAnalyzerCrude.cxx
remove also dependency on AliESDCaloCluster, functionality already existing to get...
[u/mrichter/AliRoot.git] / EMCAL / AliCaloRawAnalyzerCrude.cxx
CommitLineData
d655d7dd 1/**************************************************************************
2 * This file is property of and copyright by the Experimental Nuclear *
3 * Physics Group, Dep. of Physics *
4 * University of Oslo, Norway, 2007 *
5 * *
6 * Author: Per Thomas Hille <perthi@fys.uio.no> for the ALICE HLT Project.*
7 * Contributors are mentioned in the code where appropriate. *
8 * Please report bugs to perthi@fys.uio.no *
9 * *
10 * Permission to use, copy, modify and distribute this software and its *
11 * documentation strictly for non-commercial purposes is hereby granted *
12 * without fee, provided that the above copyright notice appears in all *
13 * copies and that both the copyright notice and this permission notice *
14 * appear in the supporting documentation. The authors make no claims *
15 * about the suitability of this software for any purpose. It is *
16 * provided "as is" without express or implied warranty. *
17 **************************************************************************/
e37e3c84 18
19// Evaluation of amplitude
20// as max sample value - pedestal
21// Not veru accurate, but very robust
22// --------------
23// --------------
24
57839add 25#include "AliCaloRawAnalyzerCrude.h"
26#include "AliCaloFitResults.h"
27#include "AliCaloBunchInfo.h"
28
ce95bae9 29using namespace std;
57839add 30
e37e3c84 31ClassImp(AliCaloRawAnalyzerCrude)
32
33
48a2e3eb 34AliCaloRawAnalyzerCrude::AliCaloRawAnalyzerCrude() : AliCaloRawAnalyzer("Crude", "Crude")
57839add 35{
d655d7dd 36
57839add 37}
d655d7dd 38
39
57839add 40AliCaloRawAnalyzerCrude::~AliCaloRawAnalyzerCrude()
41{
d655d7dd 42
57839add 43}
d655d7dd 44
d655d7dd 45
57839add 46AliCaloFitResults
47AliCaloRawAnalyzerCrude::Evaluate(const vector<AliCaloBunchInfo> &bunchvector, const UInt_t /*altrocfg1*/, const UInt_t /*altrocfg2*/)
d655d7dd 48{
e37e3c84 49 // Evaluation of signal parameters
57839add 50 if( bunchvector.size() <= 0 )
51 {
507751ce 52 return AliCaloFitResults(AliCaloFitResults::kInvalid, AliCaloFitResults::kInvalid);
57839add 53 }
54
55 Int_t amp = 0;
507751ce 56 Int_t tof = -99;
57839add 57 const UShort_t *sig;
58
59 double ped = EvaluatePedestal( bunchvector.at(0).GetData(), bunchvector.at(0).GetLength() ) ;
d655d7dd 60
57839add 61 for( unsigned int i= 0; i < bunchvector.size(); ++i)
62 {
63 sig = bunchvector.at(i).GetData();
64 int length = bunchvector.at(i).GetLength();
65
66 for(int j = 0; j < length; j ++)
67 if( sig[j] > amp )
68 {
69 amp = sig[j];
3b8fd9fe 70 tof = bunchvector.at(i).GetStartBin() - j;
57839add 71 }
72 }
d655d7dd 73
57839add 74 //:EvaluatePedestal(const UShort_t * const data, const int length )
75 // double ped = EvaluatePedestal(sig, length) ;
507751ce 76 return AliCaloFitResults(amp, ped, AliCaloFitResults::kCrude, amp - ped, tof);
57839add 77
78} //end Crude
d655d7dd 79
d655d7dd 80