Adding new class for taking into account the cluster displacement (M.Ivanov)
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 2 Feb 2004 13:34:41 +0000 (13:34 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 2 Feb 2004 13:34:41 +0000 (13:34 +0000)
TRD/AliTRDclusterCorrection.cxx [new file with mode: 0644]
TRD/AliTRDclusterCorrection.h [new file with mode: 0644]
TRD/TRDLinkDef.h
TRD/TRDcorrection.root [new file with mode: 0644]
TRD/libTRD.pkg

diff --git a/TRD/AliTRDclusterCorrection.cxx b/TRD/AliTRDclusterCorrection.cxx
new file mode 100644 (file)
index 0000000..9510162
--- /dev/null
@@ -0,0 +1,86 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line 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.                  *
+ **************************************************************************/
+///////////////////////////////////////////////////////////////////////////////
+//                                                                           //
+//  TRD clusterCorrection                                                    //
+//  marian.ivanov@cern.ch                                                    //
+//                                                                           //
+/////////////////////////////////////////////////////////////////////////////// 
+
+#include "AliTRDclusterCorrection.h"
+#include "TFile.h"
+
+ClassImp(AliTRDclusterCorrection)
+
+AliTRDclusterCorrection * gTRDclusterCorrection=0;
+
+AliTRDclusterCorrection::AliTRDclusterCorrection()
+{
+  //
+  //default constructor for correction
+  //
+  for (Int_t iplane=0;iplane<6;iplane++)
+    for (Int_t itime=0;itime<30;itime++)
+      for(Int_t iangle=0;iangle<20;iangle++){  
+       fCorrections[iplane][itime][iangle][0]=0;
+       fCorrections[iplane][itime][iangle][1]=0;
+      }
+  fOffsetAngle =0;
+}
+
+
+void AliTRDclusterCorrection::SetCorrection(Int_t plane,Int_t timebin, Float_t angle, 
+                                           Float_t value, Float_t sigma)
+{
+  Int_t iangle = int( (angle-fOffsetAngle+1.)*10.+0.5);
+  if (iangle<0) return;
+  if (iangle>=20) return;
+  fCorrections[plane][timebin][iangle][0] = value;
+  fCorrections[plane][timebin][iangle][1] = sigma;
+}
+
+Float_t AliTRDclusterCorrection::GetCorrection(Int_t plane, Int_t timebin, Float_t angle)
+{
+  Int_t iangle = int( (angle-fOffsetAngle+1.)*10.+0.5);
+  if (iangle<0) return 0.;
+  if (iangle>=20) return 0.;
+  return fCorrections[plane][timebin][iangle][0];
+}
+
+Float_t AliTRDclusterCorrection::GetSigma(Int_t plane, Int_t timebin, Float_t angle)
+{
+  Int_t iangle = int( (angle-fOffsetAngle+1.)*10.+0.5);
+  if (iangle<0) return 1.;
+  if (iangle>=20) return 1.;
+  return fCorrections[plane][timebin][iangle][1];
+}
+
+
+AliTRDclusterCorrection *  AliTRDclusterCorrection::GetCorrection()
+{
+  if (gTRDclusterCorrection!=0) return gTRDclusterCorrection;
+  //
+  TFile * f  = new TFile("$ALICE_ROOT/TRD/TRDcorrection.root");
+  if (!f){
+    ////
+    gTRDclusterCorrection = new AliTRDclusterCorrection();
+    return gTRDclusterCorrection;
+  }
+  gTRDclusterCorrection = (AliTRDclusterCorrection*)f->Get("TRDcorrection");
+  if (gTRDclusterCorrection==0)  gTRDclusterCorrection = new AliTRDclusterCorrection();
+  return gTRDclusterCorrection;
+  
+}
diff --git a/TRD/AliTRDclusterCorrection.h b/TRD/AliTRDclusterCorrection.h
new file mode 100644 (file)
index 0000000..32b9cc9
--- /dev/null
@@ -0,0 +1,28 @@
+#ifndef ALITRDCLUSTERCORRECTON_H
+#define ALITRDCLUSTERCORRECTON_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+
+#include "TObject.h"
+
+class AliTRDclusterCorrection : public TObject {
+
+ public:  
+  AliTRDclusterCorrection();
+  Float_t GetCorrection(Int_t plane, Int_t timebin, Float_t angle);
+  Float_t GetSigma(Int_t plane, Int_t timebin, Float_t angle);
+  Float_t GetOffsetAngle(){return fOffsetAngle;}
+  void SetOffsetAngle(Float_t angle){fOffsetAngle=angle;}
+  void SetCorrection(Int_t plane,Int_t timebin, Float_t angle, Float_t value,Float_t sigma);
+  Float_t GetAngle(Int_t i){return (i-10.)/10.+fOffsetAngle;}
+  static  AliTRDclusterCorrection * GetCorrection();
+ protected:
+  Float_t  fCorrections[6][30][20][2];
+  Float_t fOffsetAngle;
+                                
+  ClassDef(AliTRDclusterCorrection,1) // ClusterCorrection for the TRD
+};
+
+#endif
index 2eaa788..82a7e41 100644 (file)
@@ -26,6 +26,7 @@
 #pragma link C++ class  AliTRDclusterizerV0+;
 #pragma link C++ class  AliTRDclusterizerV1+;
 #pragma link C++ class  AliTRDclusterizerMI+;
+#pragma link C++ class  AliTRDclusterCorrection+;
 
 #pragma link C++ class  AliTRDrecPoint+;
 #pragma link C++ class  AliTRDsegmentArray+;
diff --git a/TRD/TRDcorrection.root b/TRD/TRDcorrection.root
new file mode 100644 (file)
index 0000000..b2c1acb
Binary files /dev/null and b/TRD/TRDcorrection.root differ
index 6350b12..960f59f 100644 (file)
@@ -39,7 +39,8 @@ SRCS= AliTRD.cxx \
       AliTRDparameter.cxx \
       AliTRDPartID.cxx    \
       AliTRDclusterMI.cxx      \
-      AliTRDclusterizerMI.cxx  
+      AliTRDclusterizerMI.cxx  \
+      AliTRDclusterCorrection.cxx      
 
 HDRS= $(SRCS:.cxx=.h)