From 0c53b57d2f210a6c29c69c8978041f27374044b0 Mon Sep 17 00:00:00 2001 From: schutz Date: Wed, 8 Jan 2003 17:19:00 +0000 Subject: [PATCH] class need by the TrackSegmentMaker that links pre/eval/hcal recpoints --- EMCAL/AliEMCALLink.cxx | 59 ++++++++++++++++++++++++++++++++++++++++++ EMCAL/AliEMCALLink.h | 51 ++++++++++++++++++++++++++++++++++++ 2 files changed, 110 insertions(+) create mode 100644 EMCAL/AliEMCALLink.cxx create mode 100644 EMCAL/AliEMCALLink.h diff --git a/EMCAL/AliEMCALLink.cxx b/EMCAL/AliEMCALLink.cxx new file mode 100644 index 00000000000..11041658ca5 --- /dev/null +++ b/EMCAL/AliEMCALLink.cxx @@ -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 index 00000000000..a3d6a489f0f --- /dev/null +++ b/EMCAL/AliEMCALLink.h @@ -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 -- 2.31.1