]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
added AliPHOSLogbackCluster
authorhqvigsta <henrik.qvigstad@cern.ch>
Tue, 11 Feb 2014 12:17:39 +0000 (13:17 +0100)
committerhqvigsta <henrik.qvigstad@cern.ch>
Tue, 11 Feb 2014 13:22:17 +0000 (14:22 +0100)
PWGGA/PHOSTasks/ClusterSelection/AliPHOSLogbackCluster.cxx [new file with mode: 0644]
PWGGA/PHOSTasks/ClusterSelection/AliPHOSLogbackCluster.h [new file with mode: 0644]

diff --git a/PWGGA/PHOSTasks/ClusterSelection/AliPHOSLogbackCluster.cxx b/PWGGA/PHOSTasks/ClusterSelection/AliPHOSLogbackCluster.cxx
new file mode 100644 (file)
index 0000000..d1b4384
--- /dev/null
@@ -0,0 +1,50 @@
+/**************************************************************************
+ * Copyright(c) 1998-2007, 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.                  *
+ **************************************************************************/
+
+/* $Id$ */
+
+#include "AliPHOSLogbackCluster.h"
+
+ClassImp(AliPHOSLogbackCluster)
+
+//______________________________________________________________________________
+AliPHOSLogbackCluster::AliPHOSLogbackCluster(AliVCluster* cluster) 
+: fE( cluster->E() )
+{
+  //TODO: fCoreE
+
+  cluster->GetPosition( fPosition );
+}
+
+AliPHOSLogbackCluster::~AliPHOSLogbackCluster()
+{
+}
+
+
+TLorentzVector AliPHOSLogbackCluster::GetMomentum(Double_t * vertex)
+{
+   // Returns TLorentzVector with momentum of the cluster. Only valid for clusters 
+  // identified as photons or pi0 (overlapped gamma) produced on the vertex
+  // Vertex can be recovered with esd pointer doing:  
+  //" Double_t vertex[3] ; esd->GetVertex()->GetXYZ(vertex) ; "
+
+  Double_t pos[3]={ fPosition[0] - vertex[0], 
+                   fPosition[1] - vertex[1], 
+                   fPosition[2] - vertex[2]  };
+  
+  Double_t r = TMath::Sqrt(pos[0]*pos[0]+pos[1]*pos[1]+pos[2]*pos[2]   ) ; 
+    
+  return TLorentzVector( fEnergy*pos[0]/r,  fEnergy*pos[1]/r,  fEnergy*pos[2]/r,  fEnergy) ;
+}
diff --git a/PWGGA/PHOSTasks/ClusterSelection/AliPHOSLogbackCluster.h b/PWGGA/PHOSTasks/ClusterSelection/AliPHOSLogbackCluster.h
new file mode 100644 (file)
index 0000000..777d86d
--- /dev/null
@@ -0,0 +1,39 @@
+#ifndef AliAODCaloCluster_H
+#define AliAODCaloCluster_H
+/* Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/* $Id$ */
+
+//-------------------------------------------------------------------------
+//     AOD calorimeter cluster class (for PHOS and EMCAL)
+//     Author: Markus Oldenburg, CERN, 
+//             Gustavo Conesa, INFN
+//-------------------------------------------------------------------------
+
+#include "TObject.h"
+#include "TLorentzVector.h"
+
+class AliPHOSLogbackCluster : public TObject {
+ public:
+  AliPHOSLogbackCluster(AliVCluster* cluster);
+  
+  virtual ~AliPHOSLogbackCluster();
+  
+  virtual Double_t E() const {return fE;}
+  virtual Double_t CoreE() const {return fCoreE;}
+  
+  virtual TLorentzVector GetMomentum(TLorentzVector &momentum, Double_t * vertex);
+
+ protected:
+  AliPHOSLogbackCluster(const AliPHOSLogbackCluster& clus); 
+  AliPHOSLogbackCluster& operator=(const AliPHOSLogbackCluster& clus);
+
+  Double_t fE;
+  Double_t fCoreE;
+  Double_t fPosition[3];
+  
+  ClassDef(AliPHOSLogbackCluster,1);
+};
+
+#endif