]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EMCAL/AliEMCALJetFinderAlgo.cxx
ec33227636d9a8e2403f2fd2174859a1bafcfcad
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALJetFinderAlgo.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
7  * Permission to use, copy, modify and distribute this software and its   *
8  * documentation strictly for non-commercial purposes is hereby granted   *
9  * without fee, provided that the above copyright notice appears in all   *
10  * copies and that both the copyright notice and this permission notice   *
11  * appear in the supporting documentation. The authors make no claims     *
12  * about the suitability of this software for any purpose. It is          *
13  * provided "as is" without express or implied warranty.                  *
14  **************************************************************************/
15
16
17 /*
18
19 $Log$
20 Revision 1.1.1.1  2003/05/29 18:55:23  horner
21 Initial import - Mark
22
23
24 */  
25
26 //_________________________________________________________________________
27 //  Base Class for JetFinder Algorithms     
28 //                  
29 //*-- Author: Mark Horner (LBL/UCT)
30
31
32
33
34 #include "AliEMCALJetFinderAlgo.h"
35 #include "AliRun.h"
36 #include "AliEMCALGeometry.h"
37 #include "AliMagF.h"
38 ClassImp(AliEMCALJetFinderAlgo)
39
40 AliEMCALJetFinderAlgo::AliEMCALJetFinderAlgo()
41 {
42    fDebug =0;
43 }
44   AliEMCALJetFinderAlgo::~AliEMCALJetFinderAlgo()
45 {
46
47 }
48
49 void AliEMCALJetFinderAlgo::InitInput(AliEMCALJetFinderInput* input)
50 {       
51 if (fDebug>1) Info("InitInput","Beginning InitInput");          
52         fInputPointer = input; 
53         fOutputObject.Reset(kResetAll); 
54         // automatically copy parton and particle info to output object
55          
56         for (Int_t counter = 0 ; counter < fInputPointer->GetNPartons();counter++)
57         {
58                 fOutputObject.AddParton(fInputPointer->GetParton(counter));
59         }
60         for (Int_t counter = 0 ; counter < fInputPointer->GetNParticles();counter++)
61         {
62                 fOutputObject.AddParticle(fInputPointer->GetParticle(counter));
63         }
64 }
65
66 Float_t AliEMCALJetFinderAlgo::PropagatePhi(Float_t pt, Float_t charge, Bool_t& curls)
67 {
68         // Propagates phi angle to EMCAL radius
69         // //
70  Float_t b = 0.0, rEMCAL = -1.0;
71  if(rEMCAL<0) 
72  {      
73          b =  gAlice->Field()->SolenoidField();
74          rEMCAL = AliEMCALGeometry::GetInstance()->GetIPDistance();
75  }
76  Float_t dPhi = 0.;
77  Float_t rB = 3335.6 * pt / b;  // [cm]  (case of |charge|=1)
78  if (2.*rB < rEMCAL) 
79  {
80          curls = kTRUE;
81          return dPhi;
82  }
83  Float_t phi = TMath::ACos(1.-rEMCAL*rEMCAL/(2.*rB*rB));
84  dPhi = TMath::ATan2(1.-TMath::Cos(phi), TMath::Sin(phi));
85  dPhi = -TMath::Sign(dPhi, charge);
86  return dPhi;
87 }
88