]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
class need by the TrackSegmentMaker that links pre/eval/hcal recpoints
authorschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 8 Jan 2003 17:19:00 +0000 (17:19 +0000)
committerschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 8 Jan 2003 17:19:00 +0000 (17:19 +0000)
EMCAL/AliEMCALLink.cxx [new file with mode: 0644]
EMCAL/AliEMCALLink.h [new file with mode: 0644]

diff --git a/EMCAL/AliEMCALLink.cxx b/EMCAL/AliEMCALLink.cxx
new file mode 100644 (file)
index 0000000..1104165
--- /dev/null
@@ -0,0 +1,59 @@
+/**************************************************************************
+ * 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.                  *
+ **************************************************************************/
+/* $Id$ */
+//_________________________________________________________________________
+//  Algorithm class used only by AliEMCALTrackSegmentMaker 
+//  Links recpoints into tracksegments                               
+//*-- Author: Dmitri Peressounko (SUBATECH)
+//*-- Author: Adapted from PHOS by Y. Schutz (SUBATECH)
+
+// --- ROOT system ---
+
+// --- Standard library ---
+
+// --- AliRoot header files ---
+
+#include "AliEMCALLink.h"
+
+ClassImp(AliEMCALLink)
+//____________________________________________________________________________
+  AliEMCALLink::AliEMCALLink(Float_t prod, Int_t ec, Int_t rp, unsigned int what)
+{
+  // ctor
+
+  if (gDebug == 2 ) 
+    Info("ctor", "prod = %f, ec=%d , rp=%d, what=%d", prod, ec, rp, what) ;  
+  fProd   = prod ;  
+  fECALN  = ec ;
+  fOtherN = rp ;
+  fWhat   = what ;
+}
+
+//____________________________________________________________________________
+Int_t AliEMCALLink::Compare(const TObject * obj) const
+{
+  // Compare according to the distance between two recpoints in a track segment 
+
+  Int_t rv ;
+
+  AliEMCALLink * link = (AliEMCALLink *)obj ;
+
+  if(GetProd() < link->GetProd() ) 
+    rv = -1 ;
+  else 
+    rv = 1 ;
+
+  return rv ;
+}
diff --git a/EMCAL/AliEMCALLink.h b/EMCAL/AliEMCALLink.h
new file mode 100644 (file)
index 0000000..a3d6a48
--- /dev/null
@@ -0,0 +1,51 @@
+#ifndef ALIEMCALLINK_H
+#define ALIEMCALLINK_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/* $Id$ */
+
+//_________________________________________________________________________
+//  Algorithm class used only by AliEMCALTrackSegmentMaker 
+//  Links recpoints
+// into tracksegments                
+//*-- Author: Dmitri Peressounko (SUBATECH)
+//*-- Author: Adapted from PHOS by Y. Schutz (SUBATECH)
+
+// --- ROOT system ---
+
+#include "TObject.h"
+
+// --- Standard library ---
+
+// --- AliRoot header files ---
+
+class AliEMCALLink : public  TObject
+{
+  
+public:
+  
+  AliEMCALLink( Float_t prod, Int_t ec, Int_t rp, unsigned int what) ;  // ctor            
+  virtual ~AliEMCALLink(){
+    // dtor
+  }
+  Int_t   Compare(const TObject * obj) const ;
+  const Int_t GetECAL(void) const { return fECALN ; }  
+  const Int_t GetOther(void) const { return fOtherN ; } 
+  const Float_t GetProd(void) const { return fProd ; }   
+  const Bool_t IsLinkToPRE(void) const  {if (fWhat) return kFALSE; else return kTRUE;}
+  const Bool_t IsLinkToHCAL(void) const {if (fWhat) return kTRUE;  else return kFALSE;}
+  Bool_t  IsSortable() const{ return kTRUE; }
+  
+private:
+  
+  Int_t fECALN ;     // ECAL index
+  Int_t fOtherN ;    // index of the linked recpoint 
+  Float_t fProd ;    // Scalar produc of the direction of the 2 recpoints
+  unsigned int fWhat ; // PRE (=0) or HCAL (=1)
+  
+  ClassDef(AliEMCALLink,1)  // Auxilliary algorithm class used by AliEMCALTrackSegmentMaker
+    
+};
+
+#endif // AliEMCALLINK_H