Added new class needed for refactoring of the
authorphille <phille@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 29 Mar 2011 16:35:46 +0000 (16:35 +0000)
committerphille <phille@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 29 Mar 2011 16:35:46 +0000 (16:35 +0000)
raw data analysis library

EMCAL/AliCaloRawAnalyzerFitter.cxx [new file with mode: 0644]
EMCAL/AliCaloRawAnalyzerFitter.h [new file with mode: 0644]
EMCAL/CMakelibEMCALraw.pkg

diff --git a/EMCAL/AliCaloRawAnalyzerFitter.cxx b/EMCAL/AliCaloRawAnalyzerFitter.cxx
new file mode 100644 (file)
index 0000000..9684fd7
--- /dev/null
@@ -0,0 +1,72 @@
+// -*- mode: c++ -*-
+
+/**************************************************************************
+ * This file is property of and copyright by the Experimental Nuclear     *
+ * Physics Group, Dep. of Physics                                         *
+ * University of Oslo, Norway, 2007                                       *
+ *                                                                        *
+ * Author: Per Thomas Hille <perthi@fys.uio.no> for the ALICE HLT Project.*
+ * Contributors are mentioned in the code where appropriate.              *
+ * Please report bugs to perthi@fys.uio.no                                *
+ *                                                                        *
+ * 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 "AliCaloRawAnalyzerFitter.h"
+#include "TF1.h"
+
+#include <iostream>
+using std::cout;
+using std::endl;
+
+//ClassImp( AliCaloRawAnalyzerFitter)
+
+AliCaloRawAnalyzerFitter::AliCaloRawAnalyzerFitter(const char *name, const char *nameshort ) :AliCaloRawAnalyzer( name, nameshort), 
+                                                                                             fkEulerSquared(7.389056098930650227),
+                                                                                             fTf1(0),
+                                                                                             fFixTau(true)
+{
+  for(int i=0; i < ALTROMAXSAMPLES; i++)
+    {
+      fXaxis[i] = i;
+    }
+
+  // InitFormula(fTf1);
+  fTf1 = new TF1( "myformula", "[0]*((x - [1])/[2])^2*exp(-2*(x -[1])/[2])",  0, 30 ); 
+  if (fFixTau) 
+    {
+      fTf1->FixParameter(2, fTau);
+    }
+  else 
+    {
+      fTf1->ReleaseParameter(2); // allow par. to vary
+      fTf1->SetParameter(2, fTau);
+    }
+}
+
+
+AliCaloRawAnalyzerFitter::~AliCaloRawAnalyzerFitter()
+{
+
+}
+
+
+void 
+AliCaloRawAnalyzerFitter::PrintFitResult(const TF1 *f) const
+{
+  //comment
+  cout << endl;
+  cout << __FILE__ << __LINE__ << "Using this samplerange we get" << endl;
+  cout << __FILE__ << __LINE__ << "AMPLITUDE = " << f->GetParameter(0)/fkEulerSquared << ",.. !!!!" << endl;
+  cout << __FILE__ << __LINE__ << "TOF = " << f->GetParameter(1) << ",.. !!!!" << endl;
+  cout << __FILE__ << __LINE__ << "NDF = " << f->GetNDF() << ",.. !!!!" << endl;
+  //  cout << __FILE__ << __LINE__ << "STATUS = " << f->GetStatus()  << ",.. !!!!" << endl << endl;
+  cout << endl << endl;
+}
+
diff --git a/EMCAL/AliCaloRawAnalyzerFitter.h b/EMCAL/AliCaloRawAnalyzerFitter.h
new file mode 100644 (file)
index 0000000..1a49f4c
--- /dev/null
@@ -0,0 +1,65 @@
+// -*- mode: c++ -*-
+
+#ifndef ALICALORAWANALYZERFITTER_H
+#define ALICALORAWANALYZERFITTER_H
+
+/**************************************************************************
+ * This file is property of and copyright by the Experimental Nuclear     *
+ * Physics Group, Yale University, US 2011                                *
+ *                                                                        *
+ * Author: Per Thomas Hille <perthomas.hille@yale.edu> for the ALICE      *
+ * experiment. Contributors are mentioned in the code where appropriate.  *
+ * Please report bugs to  perthomas.hille@yale.edu                        *
+ *                                                                        *
+ * 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 "AliCaloRawAnalyzer.h"
+#include "AliCaloConstants.h"
+
+
+using namespace ALTRO;
+using namespace EMCAL;
+
+class  TF1;
+class  TGraph;
+
+
+class  AliCaloRawAnalyzerFitter : public AliCaloRawAnalyzer
+{
+public:
+  AliCaloRawAnalyzerFitter( const char *name, const char *nameshort );
+  virtual ~AliCaloRawAnalyzerFitter();
+  //  virtual void InitFormula( TF1*) = 0;
+  Bool_t GetFixTau() const { return fFixTau; }; 
+  void SetFixTau(Bool_t b) { fFixTau = b; };
+  TF1 * GetFit() const { return fTf1; };
+  void PrintFitResult(const TF1 *f) const;
+
+protected: 
+  const double fkEulerSquared; //e^2 = 7.389056098930650227
+  TF1 *fTf1;  // Analytical formula of the Semi Gaussian to be fitted 
+  double fXaxis[ALTROMAXSAMPLES]; //Axis if time bins, ( used by TGraph )
+  Bool_t fFixTau; // flag if tau should be fix
+
+private:
+  AliCaloRawAnalyzerFitter(const AliCaloRawAnalyzerFitter & );
+  AliCaloRawAnalyzerFitter  & operator = (const AliCaloRawAnalyzerFitter  &);
+
+  //  double fXaxis[ALTROMAXSAMPLES]; //Axis if time bins, ( used by TGraph )
+  //  const double fkEulerSquared; //e^2 = 7.389056098930650227
+  //  TF1 *fTf1;     // Analytical formula of the Semi Gaussian to be fitted
+  //  Bool_t fFixTau; // flag if tau should be fix
+  AliCaloRawAnalyzerFitter();
+  
+  //  ClassDef(AliCaloRawAnalyzerFitter, 1)
+
+};
+
+#endif
index 3133515..3016e51 100644 (file)
@@ -25,7 +25,7 @@
 # SHLIBS - Shared Libraries and objects for linking (Executables only)           #
 #--------------------------------------------------------------------------------#
 
-set ( SRCS   AliCaloRawAnalyzerFastFit.cxx AliCaloRawAnalyzerPeakFinder.cxx AliCaloRawAnalyzerLMSOffline.cxx AliCaloRawAnalyzerLMS.cxx AliCaloRawAnalyzerFakeALTRO.cxx AliCaloRawAnalyzerKStandard.cxx AliCaloRawAnalyzerNN.cxx AliCaloRawAnalyzerCrude.cxx AliCaloRawAnalyzerFactory.cxx AliCaloNeuralFit.cxx AliCaloPeakFinderVectors.cxx AliCaloFitSubarray.cxx AliCaloRawAnalyzer.cxx AliCaloBunchInfo.cxx AliCaloFitResults.cxx  AliCaloFastAltroFitv0.cxx SMcalib/AliEMCALCCUSBRawStream.cxx )
+set ( SRCS   AliCaloRawAnalyzerFastFit.cxx AliCaloRawAnalyzerPeakFinder.cxx AliCaloRawAnalyzerLMSOffline.cxx AliCaloRawAnalyzerLMS.cxx AliCaloRawAnalyzerFakeALTRO.cxx AliCaloRawAnalyzerKStandard.cxx AliCaloRawAnalyzerNN.cxx AliCaloRawAnalyzerFitter.cxx AliCaloRawAnalyzerCrude.cxx AliCaloRawAnalyzerFactory.cxx AliCaloNeuralFit.cxx AliCaloPeakFinderVectors.cxx AliCaloFitSubarray.cxx AliCaloRawAnalyzer.cxx AliCaloBunchInfo.cxx AliCaloFitResults.cxx  AliCaloFastAltroFitv0.cxx SMcalib/AliEMCALCCUSBRawStream.cxx )
 
 string (REPLACE ".cxx" ".h" HDRS "${SRCS}")