new FMD analysis correction class
authorhdalsgaa <hdalsgaa@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 5 Aug 2009 10:19:25 +0000 (10:19 +0000)
committerhdalsgaa <hdalsgaa@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 5 Aug 2009 10:19:25 +0000 (10:19 +0000)
FMD/analysis/AliFMDAnaCalibEventSelectionEfficiency.cxx [new file with mode: 0644]
FMD/analysis/AliFMDAnaCalibEventSelectionEfficiency.h [new file with mode: 0644]

diff --git a/FMD/analysis/AliFMDAnaCalibEventSelectionEfficiency.cxx b/FMD/analysis/AliFMDAnaCalibEventSelectionEfficiency.cxx
new file mode 100644 (file)
index 0000000..be61655
--- /dev/null
@@ -0,0 +1,78 @@
+
+#include "AliFMDAnaCalibEventSelectionEfficiency.h"
+#include <TH2F.h>
+#include <TH1F.h>
+#include <TBrowser.h>
+
+ClassImp(AliFMDAnaCalibEventSelectionEfficiency)
+#if 0
+; // For Emacs
+#endif 
+
+//____________________________________________________________________
+AliFMDAnaCalibEventSelectionEfficiency::AliFMDAnaCalibEventSelectionEfficiency() : TObject(),
+                                                                    fCorrection(),
+                                                                    fIsInit(kFALSE)
+{
+  
+  
+  
+}
+
+
+//____________________________________________________________________
+AliFMDAnaCalibEventSelectionEfficiency::AliFMDAnaCalibEventSelectionEfficiency(const AliFMDAnaCalibEventSelectionEfficiency& o) : TObject(o),                                                               fCorrection(o.fCorrection),                                                     fIsInit(o.fIsInit)
+{
+  // Copy ctor 
+}
+//____________________________________________________________________
+AliFMDAnaCalibEventSelectionEfficiency&
+AliFMDAnaCalibEventSelectionEfficiency::operator=(const AliFMDAnaCalibEventSelectionEfficiency& o) 
+{
+  // Assignment operator 
+  
+  return (*this);
+}
+//____________________________________________________________________
+void AliFMDAnaCalibEventSelectionEfficiency::Init() {
+
+  fCorrection.SetName("EventSelectionEffCorrection");
+  
+  fIsInit = kTRUE;
+
+}
+//____________________________________________________________________
+void AliFMDAnaCalibEventSelectionEfficiency::SetCorrection(TH1F* hCorrection) {
+  
+  fCorrection.SetBins(hCorrection->GetNbinsX(),
+                     hCorrection->GetXaxis()->GetXmin(),
+                     hCorrection->GetXaxis()->GetXmax());
+  for(Int_t i=1; i<=hCorrection->GetNbinsX(); i++) {
+    fCorrection.SetBinContent(i,hCorrection->GetBinContent(i));
+    fCorrection.SetBinError(i,hCorrection->GetBinError(i));
+  }
+  
+
+}
+//____________________________________________________________________
+Float_t AliFMDAnaCalibEventSelectionEfficiency::GetCorrection(Int_t vtxbin) {
+
+  if( (vtxbin-1) > fCorrection.GetNbinsX() || vtxbin < 0)
+    return 0;
+  
+  Float_t correction = fCorrection.GetBinContent(vtxbin+1);
+  
+  return correction;
+
+}
+
+//____________________________________________________________________
+void AliFMDAnaCalibEventSelectionEfficiency::Browse(TBrowser* b)
+{
+  
+}
+
+//____________________________________________________________________
+//
+// EOF
+//
diff --git a/FMD/analysis/AliFMDAnaCalibEventSelectionEfficiency.h b/FMD/analysis/AliFMDAnaCalibEventSelectionEfficiency.h
new file mode 100644 (file)
index 0000000..49d9b30
--- /dev/null
@@ -0,0 +1,33 @@
+#ifndef ALIFMDANACALIBEVENTSELECTIONEFFICIENCY_H
+#define ALIFMDANACALIBEVENTSELECTIONEFFICIENCY_H
+
+#include <TObject.h>
+#include <TObjArray.h>
+#include <TH1F.h>
+#include <TAxis.h>
+#include <TList.h>
+
+class TBrowser;
+
+class AliFMDAnaCalibEventSelectionEfficiency : public TObject
+{
+  
+ public:
+  
+  AliFMDAnaCalibEventSelectionEfficiency();
+  AliFMDAnaCalibEventSelectionEfficiency(const AliFMDAnaCalibEventSelectionEfficiency& o);
+  AliFMDAnaCalibEventSelectionEfficiency& operator=(const AliFMDAnaCalibEventSelectionEfficiency& o);
+  
+  void    Init();
+  Bool_t  IsFolder() const { return kTRUE; }
+  void    Browse(TBrowser* b);
+  void    SetCorrection(TH1F* hCorrection);
+  Float_t GetCorrection(Int_t vtxbin);
+ protected:
+  
+  TH1F fCorrection;
+  Bool_t fIsInit;
+  ClassDef(AliFMDAnaCalibEventSelectionEfficiency,1);
+};
+
+#endif