--- /dev/null
+#include "AliHLTPHOSRawAnalyzer.h"
+#include <iostream>
+
+using std::cout;
+using std::endl;
+
+
+
+AliHLTPHOSRawAnalyzer:: AliHLTPHOSRawAnalyzer():fFloatDataPtr(0), fSampleFrequency(10), fTau(2), fDTof(99999), fDAmpl(99999), n(99999)
+{
+
+
+}
+
+AliHLTPHOSRawAnalyzer::~AliHLTPHOSRawAnalyzer()
+{
+
+}
+
+AliHLTPHOSRawAnalyzer::AliHLTPHOSRawAnalyzer(AliHLTPHOSRawAnalyzer const&):fFloatDataPtr(0), fSampleFrequency(10), fTau(2), fDTof(99999), fDAmpl(99999), n(99999)
+{
+
+}
+
+/**
+* Main constructor
+* @param dataPtr Data array for wich a subarray will be taken to perform the fit
+* @param fs the sampling frequency in entities of MHz. Needed in order to calculate physical time
+**/
+AliHLTPHOSRawAnalyzer::AliHLTPHOSRawAnalyzer(double *dtaPtr, double fs):fFloatDataPtr(0), fSampleFrequency(10), fTau(2), fDTof(99999), fDAmpl(99999), n(99999)
+{
+ fFloatDataPtr = dtaPtr;
+ fSampleFrequency = fs;
+} //end
+
+
+/**
+* Attemps to level the basline to zero.
+* The baseline will be calculated from the pretrigger samples and subtracted from the
+* data array.
+* If pretrigger samples are not present then the basline correction will be incorrect.
+* @param dataPtr array for wich to correct the basline
+* @param N the number of pretrigger samples used to calculate the baseline.
+**/
+void
+AliHLTPHOSRawAnalyzer::BaselineCorrection(double *dataPtr, int N)
+{
+ fFloatDataPtr = dataPtr;
+ n=N;
+ cout << "Baseline correction not yet implemeted" << endl;
+} //end BaselineCorrection
+
+
+/**
+* Shifts the basline with the amount given by baselineValue
+* If pretrigger samples are not present then the basline correction will be incorrect.
+* @param dataPtr array for wich to correct the basline
+* @param BaslineValue the basline value to subtract..
+**/
+void
+AliHLTPHOSRawAnalyzer::BaselineCorrection(double *dataPtr, double baselineValue)
+{
+ fFloatDataPtr = dataPtr;
+ printf("\nbaselineValue = %f\n", baselineValue);
+ cout << "Baseline correction not yet implemeted" << endl;
+} //end BaslineCorrection
+
+
+/**
+ * Gives the timing in entities of sample indexes
+ * Physical time is found by multiplying with the sampling intervall (Ts).
+ **/
+float
+AliHLTPHOSRawAnalyzer::GetTiming()
+{
+ return fDTof;
+} //end GetTiming
+
+
+/**
+ * Gives the time in entities of ADC channels (quantization levels).
+ * Absolute enrgy is found by multiplying with offline calibration constants.
+ **/
+float
+AliHLTPHOSRawAnalyzer::GetEnergy()
+{
+ return fDAmpl;
+} //end GetEnergy
+
+
+/**
+ * Set data array. Overrides data data array set in the constructor.
+ **/
+void
+AliHLTPHOSRawAnalyzer::SetData(double *data)
+{
+ // double *dta;
+ // dta = data;
+ fFloatDataPtr = data;
+ // cout << "Set data not yet implemented" << endl;
+}
+
+void
+AliHLTPHOSRawAnalyzer::SetSampleFreq(double freq)
+{
+
+}
+
+int
+AliHLTPHOSRawAnalyzer::FindStartIndex(double treshold)
+{
+ printf("\ntreshold = %f \n", treshold);
+ cout << "Find Start index not yet implemented" << endl;
+ return 0;
+} //end FindStartIndex
+
+
+/**
+ * This function applies only to the Chi and Least mean square fit. An initial guess is made
+ * based on the average of the first 5 samples and the first value exeeding this value.
+ **/
+void
+AliHLTPHOSRawAnalyzer::MakeInitialGuess()
+{
+ cout << "Make initial guess not yet implemeted" << endl;
+}
+
+
+/**
+ * This function applies only to the Chi and Least mean square fit. An initial guess is made
+ * based on the average of the first 5 samples and the first value exeeding threshold + this value.
+ * @param treshold The index of the first value above treshold is ntaken to be the first value.
+ **/
+void
+AliHLTPHOSRawAnalyzer::MakeInitialGuess(int treshold)
+{
+ printf("\ntreshold = %d\n", treshold);
+ cout << "Make initial guess not yet implemeted" << endl;
+}
--- /dev/null
+#ifndef ALIHLTPHOSANALYZER_H
+#define ALIHLTPHOSANALYZER_H
+/* Copyright(c) 1998-2004, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+/* $Id$ */
+
+class AliHLTPHOSAnalyzer
+{
+ public:
+ AliHLTPHOSAnalyzer();
+ virtual ~AliHLTPHOSAnalyzer();
+ AliHLTPHOSAnalyzer(double *dataPtr, double fs);
+ AliHLTPHOSAnalyzer(const AliHLTPHOSAnalyzer & );
+ AliHLTPHOSAnalyzer & operator = (const AliHLTPHOSAnalyzer &)
+ {
+ return *this;
+ }
+
+ void BaselineCorrection(double *dataPtr, int N);
+ void BaselineCorrection(double *dataPtr, double baselineValue);
+ int FindStartIndex(double treshold);
+ float GetTiming();
+ float GetEnergy();
+ void SetData(double *data);
+ void SetSampleFreq(double freq);
+ void MakeInitialGuess();
+ void MakeInitialGuess(int treshold);
+ virtual void Evaluate(int start = 0, int lenght = 100) = 0;
+
+ protected:
+ double *fFloatDataPtr; /**<Float representation of data that should be fitted */
+ double fSampleFrequency; /**<The ADC sample frequency in MHz used under data taking */
+ double fDTofGuess; /**<Initial guess for t0*/
+ double fDAmplGuess; /**<Initial guess for amplitude*/
+ double fTau; /**<The risetime in micro seconds*/
+ double fDTof; /**<Time of flight in entities of sample intervals */
+ double fDAmpl; /**<Amplitude in entities of ADC levels*/
+ int n;
+
+};
+
+
+#endif
--- /dev/null
+
+/**************************************************************************
+ * Copyright(c) 2006, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: Per Thomas Hille for the ALICE HLT Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+#include "AliHLTPHOSRawAnalyzerChiSquareFit.h"
+#include <iostream>
+
+using std::cout;
+using std::endl;
+
+ClassImp(AliHLTPHOSRawAnalyzerChiSquareFit)
+
+AliHLTPHOSRawAnalyzerChiSquareFit::AliHLTPHOSRawAnalyzerChiSquareFit(const AliHLTPHOSRawAnalyzerChiSquareFit&):AliHLTPHOSRawAnalyzer()
+{
+
+}
+
+/**
+ * The AliHLTPHOSPeakfinder class is the class for extracting the basic signal parameters
+ * "timing" and "energy" from the PHOS raw data. Physical data will for a given readout channel be
+ * a sequense of ADC digitized 10 bit integer values, however for performance reasons all values used in
+ * calculation is of type double.
+ **/
+AliHLTPHOSRawAnalyzerChiSquareFit::AliHLTPHOSRawAnalyzerChiSquareFit():AliHLTPHOSRawAnalyzer()
+{
+ cout <<"You cannot invoke the Fitter without arguments"<<endl;;
+}
+
+
+AliHLTPHOSRawAnalyzerChiSquareFit::~AliHLTPHOSRawAnalyzerChiSquareFit()
+{
+
+} //end AliHLTPHOSRawAnalyzerChiSquareFit
+
+
+/**
+* Extraction of timing and energy using the Peakfinde Algorithm.
+* The. The parameters "start" and "length" defines a sub array of the data array
+* that will be used for the the fit. If start+length must not exeed the total length
+* of the Data array. "start" must be chosen as close as possible to t0.
+* The baseline must also be subtracted.
+* The length of "tVector" and "aVector" mus be equal to length.
+* "index + length" must not exeed the length of the data array set in the constructor.
+* @param start the start index of the subarray of the data array.
+* @param length the number of samples to use starting from index
+**/
+void
+AliHLTPHOSRawAnalyzerChiSquareFit::Evaluate(int start, int length)
+{
+ /*
+
+ */
+
+ //thats all
+} //end FitChiSquareFit
+
+
+
+
+
--- /dev/null
+#ifndef ALIHLTPHOSANALYZERCHISQUAREFIT_H
+#define ALIHLTPHOSANALYZERCHISQUAREFIT_H
+#include <Rtypes.h>
+#include "TObject.h"
+#include "AliHLTPHOSRawAnalyzer.h"
+
+/* Copyright(c) 2006, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+
+class AliHLTPHOSRawAnalyzerChiSquareFit : public AliHLTPHOSRawAnalyzer
+{
+ public:
+ AliHLTPHOSRawAnalyzerChiSquareFit();
+ AliHLTPHOSRawAnalyzerChiSquareFit(const AliHLTPHOSRawAnalyzerChiSquareFit & );
+
+ AliHLTPHOSRawAnalyzerChiSquareFit & operator = (const AliHLTPHOSRawAnalyzerChiSquareFit)
+ {
+ return *this;
+ }
+
+ virtual ~AliHLTPHOSRawAnalyzerChiSquareFit();
+ virtual void Evaluate(int start = 0, int lenght = 100);
+ private:
+
+ ClassDef(AliHLTPHOSRawAnalyzerChiSquareFit, 2)
+
+ };
+
+#endif
--- /dev/null
+/**************************************************************************
+ * Copyright(c) 2006, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: Per Thomas Hille for the ALICE HLT Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+#include "AliHLTPHOSRawAnalyzerComponent.h"
+#include <iostream>
+
+//ClassImp(AliHLTPHOSRawAnalyzerComponent)
+
+AliHLTPHOSRawAnalyzerComponent::AliHLTPHOSRawAnalyzerComponent()
+{
+
+}
+
+AliHLTPHOSRawAnalyzerComponent::~AliHLTPHOSRawAnalyzerComponent()
+{
+
+}
+
+
+AliHLTPHOSRawAnalyzerComponent::AliHLTPHOSRawAnalyzerComponent(const AliHLTPHOSRawAnalyzerComponent & ) : AliHLTProcessor()
+{
+
+}
+
+int
+AliHLTPHOSRawAnalyzerComponent::Deinit()
+{
+ return 0;
+}
+
+int
+AliHLTPHOSRawAnalyzerComponent::DoDeinit()
+{
+ return 0;
+}
+
+const char*
+AliHLTPHOSRawAnalyzerComponent::GetComponentID()
+{
+ return 0;
+}
+
+void
+AliHLTPHOSRawAnalyzerComponent::GetInputDataTypes(std::vector<AliHLTComponentDataType, std::allocator<AliHLTComponentDataType> >&)
+{
+
+}
+
+AliHLTComponentDataType
+AliHLTPHOSRawAnalyzerComponent::GetOutputDataType()
+{
+ AliHLTComponentDataType tmp;
+ return tmp;
+}
+
+void
+AliHLTPHOSRawAnalyzerComponent::GetOutputDataSize(long unsigned int&, double&)
+{
+
+}
+
+void
+AliHLTPHOSRawAnalyzerComponent::GetOutputDataSize(long int&, double&)
+{
+
+}
+
+AliHLTComponent*
+AliHLTPHOSRawAnalyzerComponent::Spawn()
+{
+ return 0;
+}
+
+int
+AliHLTPHOSRawAnalyzerComponent::DoEvent(const AliHLTComponentEventData&, const AliHLTComponentBlockData*, AliHLTComponentTriggerData&, AliHLTUInt8_t*, AliHLTUInt32_t&, std::vector<AliHLTComponentBlockData, std::allocator<AliHLTComponentBlockData> >&)
+{
+ printf("\nPHOSHLT DoEvent, not yet implemented\n");
+ return 0;
+}
--- /dev/null
+/* Copyright(c) 2006, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+#ifndef ALIHLTPHOSANALYZERCOMPONENT_H
+#define ALIHLTPHOSANALYZERCOMPONENT_H
+
+//#include <Rtypes.h>
+//#include "TObject.h"
+#include "AliHLTProcessor.h"
+#include "AliHLTPHOSRawAnalyzer.h"
+#include "AliHLTPHOSRawAnalyzerCrude.h"
+
+class AliHLTPHOSRawAnalyzerComponent: public AliHLTProcessor
+{
+ public:
+ AliHLTPHOSRawAnalyzerComponent();
+ ~AliHLTPHOSRawAnalyzerComponent();
+ AliHLTPHOSRawAnalyzerComponent(const AliHLTPHOSRawAnalyzerComponent & );
+ AliHLTPHOSRawAnalyzerComponent & operator = (const AliHLTPHOSRawAnalyzerComponent)
+ {
+ return *this;
+ };
+
+ virtual int Deinit();
+ virtual int DoDeinit();
+ virtual const char* GetComponentID();
+ virtual void GetInputDataTypes(std::vector<AliHLTComponentDataType, std::allocator<AliHLTComponentDataType> >&);
+ virtual AliHLTComponentDataType GetOutputDataType();
+ virtual void GetOutputDataSize(long unsigned int&, double&);
+ virtual void GetOutputDataSize(long int&, double&);
+ virtual AliHLTComponent* Spawn();
+ virtual int DoEvent(const AliHLTComponentEventData&, const AliHLTComponentBlockData*, AliHLTComponentTriggerData&, AliHLTUInt8_t*, AliHLTUInt32_t&, std::vector<AliHLTComponentBlockData, std::allocator<AliHLTComponentBlockData> >&);
+
+ // private:
+ protected:
+ AliHLTPHOSRawAnalyzer *analyzerPtr;
+
+ // ClassDef(AliHLTPHOSRawAnalyzerComponent, 2)
+};
+#endif
--- /dev/null
+/**************************************************************************
+ * Copyright(c) 2006, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: Per Thomas Hille for the ALICE HLT Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+#include "AliHLTPHOSRawAnalyzerCrude.h"
+#include <iostream>
+
+using std::cout;
+using std::endl;
+
+ClassImp(AliHLTPHOSRawAnalyzerCrude)
+
+
+AliHLTPHOSRawAnalyzerCrude::AliHLTPHOSRawAnalyzerCrude(const AliHLTPHOSRawAnalyzerCrude&):AliHLTPHOSRawAnalyzer()
+{
+
+}
+
+/**
+ * The AliHLTPHOSPeakfinder class is the class for extracting the basic signal parameters
+ * "timing" and "energy" from the PHOS raw data. Physical data will for a given readout channel be
+ * a sequense of ADC digitized 10 bit integer values, however for performance reasons all values used in
+ * calculation is of type double.
+ **/
+AliHLTPHOSRawAnalyzerCrude::AliHLTPHOSRawAnalyzerCrude():AliHLTPHOSRawAnalyzer()
+{
+ cout <<"You cannot invoke the Fitter without arguments"<<endl;
+}
+
+
+
+AliHLTPHOSRawAnalyzerCrude::~AliHLTPHOSRawAnalyzerCrude()
+{
+
+} //end AliHLTPHOSRawAnalyzerCrude
+
+
+
+/**
+* Extraction of timing and energy using the Peakfinde Algorithm.
+* The. The parameters "start" and "length" defines a sub array of the data array
+* that will be used for the the fit. If start+length must not exeed the total length
+* of the Data array. "start" must be chosen as close as possible to t0.
+* The baseline must also be subtracted.
+* The length of "tVector" and "aVector" mus be equal to length.
+* "index + length" must not exeed the length of the data array set in the constructor.
+* @param start the start index of the subarray of the data array.
+* @param length the number of samples to use starting from index
+* @param tVector the peakfinder vector for timing
+* @param aVector the peakfinder vector for amplitude (energy)
+**/
+void
+AliHLTPHOSRawAnalyzerCrude::Evaluate(int start, int length)
+{
+
+ double tmpAmplitudeMax =0;
+ double tmpTime = 0;
+
+ for(int i=start; i<length; i++)
+ {
+ if(fFloatDataPtr[i] > tmpAmplitudeMax)
+ {
+ tmpAmplitudeMax = fFloatDataPtr[i];
+ tmpTime = i;
+ }
+ }
+
+ fDAmpl = tmpAmplitudeMax;
+ fDTof = tmpTime;
+ //thats all
+} //end Crude
+
+
+
+
+
+
--- /dev/null
+#ifndef ALIHLTPHOSANALYZERCRUDE_H
+#define ALIHLTPHOSANALYZERCRUDE_H
+#include <Rtypes.h>
+#include "TObject.h"
+#include "AliHLTPHOSAnalyzer.h"
+
+
+/* Copyright(c) 2006, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+
+class AliHLTPHOSAnalyzerCrude : public AliHLTPHOSAnalyzer
+{
+ public:
+ AliHLTPHOSAnalyzerCrude();
+ AliHLTPHOSAnalyzerCrude(const AliHLTPHOSAnalyzerCrude & );
+ AliHLTPHOSAnalyzerCrude & operator = (const AliHLTPHOSAnalyzerCrude)
+ {
+ return *this;
+ }
+
+ virtual ~AliHLTPHOSAnalyzerCrude();
+ virtual void Evaluate(int start = 0, int lenght = 100);
+ private:
+ ClassDef(AliHLTPHOSAnalyzerCrude, 2)
+
+ };
+
+#endif
--- /dev/null
+/**************************************************************************
+ * Copyright(c) 2006, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: Per Thomas Hille for the ALICE HLT Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+#include "AliHLTPHOSRawAnalyzerCrudeComponent.h"
+
+
+//ClassImp(AliHLTPHOSRawAnalyzerCrudeComponent)
+
+
+AliHLTPHOSRawAnalyzerCrudeComponent::AliHLTPHOSRawAnalyzerCrudeComponent()
+{
+ analyzerPtr = new AliHLTPHOSRawAnalyzerCrude();
+}
+
+AliHLTPHOSRawAnalyzerCrudeComponent::~AliHLTPHOSRawAnalyzerCrudeComponent()
+{
+
+}
+
+
+AliHLTPHOSRawAnalyzerCrudeComponent::AliHLTPHOSRawAnalyzerCrudeComponent(const AliHLTPHOSRawAnalyzerCrudeComponent & ):AliHLTPHOSRawAnalyzerComponent()
+{
+
+}
+
--- /dev/null
+#ifndef ALIHLTPHOSANALYZERCRUDECOMPONENT_H
+#define ALIHLTPHOSANALYZERCRUDECOMPONENT_H
+
+#include "AliHLTPHOSRawAnalyzerComponent.h"
+
+/* Copyright(c) 2006, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+
+class AliHLTPHOSRawAnalyzerCrudeComponent: public AliHLTPHOSRawAnalyzerComponent
+{
+ AliHLTPHOSRawAnalyzerCrudeComponent();
+ ~AliHLTPHOSRawAnalyzerCrudeComponent();
+ AliHLTPHOSRawAnalyzerCrudeComponent(const AliHLTPHOSRawAnalyzerCrudeComponent & );
+ AliHLTPHOSRawAnalyzerCrudeComponent & operator = (const AliHLTPHOSRawAnalyzerCrudeComponent)
+ {
+ return *this;
+ };
+
+ //ClassDef(AliHLTPHOSRawAnalyzerCrudeComponent, 2)
+ };
+
+#endif
--- /dev/null
+
+/**************************************************************************
+ * Copyright(c) 2006, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: Per Thomas Hille for the ALICE HLT Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+#include "AliHLTPHOSRawAnalyzerKLevel.h"
+#include <iostream>
+
+using std::cout;
+using std::endl;
+
+ClassImp(AliHLTPHOSRawAnalyzerKLevel)
+
+
+AliHLTPHOSRawAnalyzerKLevel::AliHLTPHOSRawAnalyzerKLevel(const AliHLTPHOSRawAnalyzerKLevel&):AliHLTPHOSRawAnalyzer(), tKLevel(0)
+{
+
+}
+
+
+/**
+ * The AliHLTPHOSPeakfinder class is the class for extracting the basic signal parameters
+ * "timing" and "energy" from the PHOS raw data. Physical data will for a given readout channel be
+ * a sequense of ADC digitized 10 bit integer values, however for performance reasons all values used in
+ * calculation is of type double.
+ **/
+AliHLTPHOSRawAnalyzerKLevel::AliHLTPHOSRawAnalyzerKLevel():AliHLTPHOSRawAnalyzer(), tKLevel(0)
+{
+ cout <<"You cannot invoke the Fitter without arguments"<<endl;;
+}
+
+
+AliHLTPHOSRawAnalyzerKLevel::~AliHLTPHOSRawAnalyzerKLevel()
+{
+
+} //end AliHLTPHOSRawAnalyzerKLevel
+
+
+
+/**
+* Extraction of timing and energy using the Peakfinde Algorithm.
+* The. The parameters "start" and "length" defines a sub array of the data array
+* that will be used for the the fit. If start+length must not exeed the total length
+* of the Data array. "start" must be chosen as close as possible to t0.
+* The baseline must also be subtracted.
+* The length of "tVector" and "aVector" mus be equal to length.
+* "index + length" must not exeed the length of the data array set in the constructor.
+* @param start the start index of the subarray of the data array.
+* @param length the number of samples to use starting from index
+**/
+void
+AliHLTPHOSRawAnalyzerKLevel::Evaluate(int start, int length)
+{
+ //thats all
+} //end FitKLevel
+
+
+
+
--- /dev/null
+#ifndef ALIHLTPHOSANALYZERKLEVEL_H
+#define ALIHLTPHOSANALYZERKLEVEL_H
+#include <Rtypes.h>
+#include "TObject.h"
+#include "AliHLTPHOSRawAnalyzer.h"
+
+/* Copyright(c) 2006, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+class AliHLTPHOSRawAnalyzerKLevel : public AliHLTPHOSRawAnalyzer
+{
+ public:
+ AliHLTPHOSRawAnalyzerKLevel();
+ AliHLTPHOSRawAnalyzerKLevel(const AliHLTPHOSRawAnalyzerKLevel & );
+ AliHLTPHOSRawAnalyzerKLevel & operator = (const AliHLTPHOSRawAnalyzerKLevel)
+ {
+ return *this;
+ }
+
+ virtual ~AliHLTPHOSRawAnalyzerKLevel();
+ virtual void Evaluate(int start = 0, int lenght = 100);
+ private:
+ double tKLevel;
+ ClassDef(AliHLTPHOSRawAnalyzerKLevel, 2)
+
+ };
+
+#endif
--- /dev/null
+/**************************************************************************
+ * Copyright(c) 2006, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: Per Thomas Hille for the ALICE HLT Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+
+#include "AliHLTPHOSRawRawAnalyzerLMS.h"
+#include <iostream>
+
+using std::cout;
+using std::endl;
+
+ClassImp(AliHLTPHOSRawRawAnalyzerLMS)
+
+
+AliHLTPHOSRawRawAnalyzerLMS::AliHLTPHOSRawRawAnalyzerLMS(const AliHLTPHOSRawRawAnalyzerLMS&):AliHLTPHOSRawRawAnalyzer(), kfMCovarPtrPtr(0), fPCovarPtrPtr(0)
+{
+
+}
+
+
+/**
+ * The AliHLTPHOSPeakfinder class is the class for extracting the basic signal parameters
+ * "timing" and "energy" from the PHOS raw data. Physical data will for a given readout channel be
+ * a sequense of ADC digitized 10 bit integer values, however for performance reasons all values used in
+ * calculation is of type double.
+ **/
+AliHLTPHOSRawRawAnalyzerLMS::AliHLTPHOSRawRawAnalyzerLMS():AliHLTPHOSRawRawAnalyzer(), kfMCovarPtrPtr(0), fPCovarPtrPtr(0)
+{
+ cout <<"You cannot invoke the Fitter without arguments"<<endl;;
+}
+
+
+/**
+* Main constructor
+* @param dataPtr Data array for wich a subarray will be taken to perform the fit
+* @param fs the sampling frequency in entities of MHz. Needed in order to calculate physical time
+**/
+AliHLTPHOSRawRawAnalyzerLMS::AliHLTPHOSRawRawAnalyzerLMS(double *dtaPtr, double fs):AliHLTPHOSRawRawAnalyzer(),kfMCovarPtrPtr(0), fPCovarPtrPtr(0)
+{
+ fFloatDataPtr = dtaPtr;
+ fSampleFrequency = fs;
+} //end AliHLTPHOSRawRawAnalyzerLMS
+
+
+AliHLTPHOSRawRawAnalyzerLMS::~AliHLTPHOSRawRawAnalyzerLMS()
+{
+
+} //end AliHLTPHOSRawRawAnalyzerLMS
+
+
+/**
+* Extraction of timing and energy using the Peakfinde Algorithm.
+* The. The parameters "start" and "length" defines a sub array of the data array
+* that will be used for the the fit. If start+length must not exeed the total length
+* of the Data array. "start" must be chosen as close as possible to t0.
+* The baseline must also be subtracted.
+* The length of "tVector" and "aVector" mus be equal to length.
+* "index + length" must not exeed the length of the data array set in the constructor.
+* @param start the start index of the subarray of the data array.
+* @param length the number of samples to use starting from index
+**/
+void
+AliHLTPHOSRawRawAnalyzerLMS::Evaluate(int start, int length)
+{
+ /*
+
+ */
+
+ //thats all
+} //end FitLMS
+
+
+
+
+
--- /dev/null
+#ifndef ALIHLTPHOSANALYZERLMS_H
+#define ALIHLTPHOSANALYZERLMS_H
+#include <Rtypes.h>
+#include "TObject.h"
+#include "AliHLTPHOSRawAnalyzer.h"
+
+/* Copyright(c) 2006, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+
+class AliHLTPHOSRawAnalyzerLMS : public AliHLTPHOSRawAnalyzer
+{
+ public:
+ AliHLTPHOSRawAnalyzerLMS();
+ AliHLTPHOSRawAnalyzerLMS(double *dataPtr, double fs);
+ AliHLTPHOSRawAnalyzerLMS(const AliHLTPHOSRawAnalyzerLMS & );
+ AliHLTPHOSRawAnalyzerLMS & operator = (const AliHLTPHOSRawAnalyzerLMS)
+ {
+ return *this;
+ }
+
+ virtual ~AliHLTPHOSRawAnalyzerLMS();
+ virtual void Evaluate(int start = 0, int lenght = 100);
+ private:
+ double **kfMCovarPtrPtr; /**<Covariance matrix of the measurements*/
+ double **fPCovarPtrPtr; /**<Covariance matrix of the estimated parameters*/
+
+ ClassDef(AliHLTPHOSRawAnalyzerLMS, 2)
+
+ };
+
+#endif
--- /dev/null
+
+/**************************************************************************
+ * Copyright(c) 2006, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: Per Thomas Hille for the ALICE HLT Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+#include "AliHLTPHOSRawAnalyzerPeakFinder.h"
+#include <iostream>
+
+using std::cout;
+using std::endl;
+
+ClassImp(AliHLTPHOSRawAnalyzerPeakFinder)
+
+
+AliHLTPHOSRawAnalyzerPeakFinder::AliHLTPHOSRawAnalyzerPeakFinder(const AliHLTPHOSRawAnalyzerPeakFinder&):AliHLTPHOSRawAnalyzer(),tVector(0), aVector(0)
+{
+
+}
+
+
+/**
+ * The AliHLTPHOSPeakfinder class is the class for extracting the basic signal parameters
+ * "timing" and "energy" from the PHOS raw data. Physical data will for a given readout channel be
+ * a sequense of ADC digitized 10 bit integer values, however for performance reasons all values used in
+ * calculation is of type double.
+ **/
+AliHLTPHOSRawAnalyzerPeakFinder::AliHLTPHOSRawAnalyzerPeakFinder():AliHLTPHOSRawAnalyzer(),tVector(0), aVector(0)
+{
+ cout <<"You cannot invoke the Fitter without arguments"<<endl;;
+}
+
+
+
+AliHLTPHOSRawAnalyzerPeakFinder::~AliHLTPHOSRawAnalyzerPeakFinder()
+{
+
+} //end AliHLTPHOSRawAnalyzerPeakFinder
+
+void
+AliHLTPHOSRawAnalyzerPeakFinder::SetTVector(double *tVec)
+{
+ tVector = tVec;
+}
+
+void
+AliHLTPHOSRawAnalyzerPeakFinder::SetAVector(double *aVec)
+{
+ aVector = aVec;
+
+}
+
+/**
+* Extraction of timing and energy using the Peakfinde Algorithm.
+* The. The parameters "start" and "length" defines a sub array of the data array
+* that will be used for the the fit. If start+length must not exeed the total length
+* of the Data array. "start" must be chosen as close as possible to t0.
+* The baseline must also be subtracted.
+* The length of "tVector" and "aVector" mus be equal to length.
+* "index + length" must not exeed the length of the data array set in the constructor.
+* @param start the start index of the subarray of the data array.
+* @param length the number of samples to use starting from index
+* @param tVector the peakfinder vector for timing
+* @param aVector the peakfinder vector for amplitude (energy)
+**/
+void
+AliHLTPHOSRawAnalyzerPeakFinder::Evaluate(int start, int length)
+{
+ fDTof = 0;
+ fDAmpl = 0;
+
+ if(tVector == 0 || aVector == 0)
+ {
+ printf("\nError: the peakfinder vectors are not specified, aborting !!!\n");
+ }
+ else
+ {
+
+ printf("\nstart = %d, length = %d\n", start, length);
+ double tmpTime[1008];
+
+ for(int i=0; i < length; i++)
+ {
+ fDAmpl += aVector[i]*fFloatDataPtr[i];
+ }
+
+ for(int i=0; i < length; i++)
+ {
+ tmpTime[i] = tVector[i]*fFloatDataPtr[i];
+ fDTof = fDTof + tmpTime[i];
+ }
+
+ fDTof = fDTof/fDAmpl;
+ }
+ //thats all
+} //end FitPeakFinder
+
+
+
+
--- /dev/null
+#ifndef ALIHLTPHOSANALYZERPEAKFINDER_H
+#define ALIHLTPHOSANALYZERPEAKFINDER_H
+#include <Rtypes.h>
+#include "TObject.h"
+#include "AliHLTPHOSRawAnalyzer.h"
+
+/* Copyright(c) 2006, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+class AliHLTPHOSRawAnalyzerPeakFinder : public AliHLTPHOSRawAnalyzer
+{
+ public:
+ AliHLTPHOSRawAnalyzerPeakFinder();
+ AliHLTPHOSRawAnalyzerPeakFinder(const AliHLTPHOSRawAnalyzerPeakFinder & );
+ AliHLTPHOSRawAnalyzerPeakFinder & operator = (const AliHLTPHOSRawAnalyzerPeakFinder)
+ {
+ return *this;
+ }
+
+ virtual ~AliHLTPHOSRawAnalyzerPeakFinder();
+ void SetTVector(double *tVector);
+ void SetAVector(double *aVector);
+ virtual void Evaluate(int start = 0, int lenght = 100);
+ private:
+ double *tVector; /**<Peakfinder vector for TOF reconstruction*/
+ double *aVector; /**<Peakfinder vector for Energy reconstruction*/
+
+ ClassDef(AliHLTPHOSRawAnalyzerPeakFinder, 2)
+
+ };
+
+#endif
--- /dev/null
+/**************************************************************************
+ * Copyright(c) 2006, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: Per Thomas Hille for the ALICE HLT Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+#include "AliHLTPHOSRawAnalyzerPeakFinderComponent.h"
+
+
+//ClassImp(AliHLTPHOSRawAnalyzerPeakFinderComponent)
+
+
+ AliHLTPHOSRawAnalyzerPeakFinderComponent::AliHLTPHOSRawAnalyzerPeakFinderComponent():AliHLTPHOSRawAnalyzerComponent()
+{
+
+}
+
+AliHLTPHOSRawAnalyzerPeakFinderComponent::~AliHLTPHOSRawAnalyzerPeakFinderComponent()
+{
+
+}
+
+
+AliHLTPHOSRawAnalyzerPeakFinderComponent::AliHLTPHOSRawAnalyzerPeakFinderComponent(const AliHLTPHOSRawAnalyzerPeakFinderComponent & ) : AliHLTPHOSRawAnalyzerComponent()
+{
+
+}
+
+
--- /dev/null
+#ifndef ALIHLTPHOSANALYZERPEAKFINDERCOMPONENT_H
+#define ALIHLTPHOSANALYZERPEAKFINDERCOMPONENT_H
+
+/* Copyright(c) 2006, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+#include "AliHLTPHOSRawAnalyzerComponent.h"
+
+class AliHLTPHOSRawAnalyzerPeakFinderComponent: public AliHLTPHOSRawAnalyzerComponent
+{
+ AliHLTPHOSRawAnalyzerPeakFinderComponent();
+ ~AliHLTPHOSRawAnalyzerPeakFinderComponent();
+ AliHLTPHOSRawAnalyzerPeakFinderComponent(const AliHLTPHOSRawAnalyzerPeakFinderComponent & );
+ AliHLTPHOSRawAnalyzerPeakFinderComponent & operator = (const AliHLTPHOSRawAnalyzerPeakFinderComponent)
+ {
+ return *this;
+ };
+
+ //ClassDef(AliHLTPHOSRawAnalyzerPeakFinderComponent, 2)
+ };
+
+
+
+#endif