]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EMCAL/AliEMCALJetFinderAlgo.cxx
Removing useless const to avoid warnings on alphacxx6
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALJetFinderAlgo.cxx
CommitLineData
f7d5860b 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
ee6b678f 17/* $Id$ */
f7d5860b 18
19//_________________________________________________________________________
20// Base Class for JetFinder Algorithms
44f59d68 21// --
f7d5860b 22//*-- Author: Mark Horner (LBL/UCT)
44f59d68 23// --
f7d5860b 24
25
26
27#include "AliEMCALJetFinderAlgo.h"
28#include "AliRun.h"
29#include "AliEMCALGeometry.h"
30#include "AliMagF.h"
31ClassImp(AliEMCALJetFinderAlgo)
32
33AliEMCALJetFinderAlgo::AliEMCALJetFinderAlgo()
34{
35 fDebug =0;
5bf42aa6 36 fOutputPointer=0;
37 fInputPointer=0;
38 fOutputAllocated=kFALSE;
f7d5860b 39}
5bf42aa6 40
41AliEMCALJetFinderAlgo::~AliEMCALJetFinderAlgo()
f7d5860b 42{
5bf42aa6 43 if (fOutputAllocated)
44 delete fOutputPointer;
45}
f7d5860b 46
5bf42aa6 47void AliEMCALJetFinderAlgo::SetOutput(AliEMCALJetFinderOutput* output) {
48 if (fOutputAllocated)
49 delete fOutputPointer;
50 fOutputPointer=output;
51 fOutputAllocated=kFALSE;
f7d5860b 52}
53
54void AliEMCALJetFinderAlgo::InitInput(AliEMCALJetFinderInput* input)
3950acef 55{
56// Take input data
f7d5860b 57if (fDebug>1) Info("InitInput","Beginning InitInput");
5bf42aa6 58 fInputPointer = input;
59 if (fOutputPointer==0) {
60
61 if (fDebug>1) Info("InitInput","Allocating output object");
62 fOutputPointer=new AliEMCALJetFinderOutput();
63 fOutputAllocated=kTRUE;
64 }
65 fOutputPointer->Reset(kResetAll);
f7d5860b 66 // automatically copy parton and particle info to output object
67
68 for (Int_t counter = 0 ; counter < fInputPointer->GetNPartons();counter++)
69 {
5bf42aa6 70 fOutputPointer->AddParton(fInputPointer->GetParton(counter));
f7d5860b 71 }
72 for (Int_t counter = 0 ; counter < fInputPointer->GetNParticles();counter++)
73 {
5bf42aa6 74 fOutputPointer->AddParticle(fInputPointer->GetParticle(counter));
f7d5860b 75 }
76}
77
78Float_t AliEMCALJetFinderAlgo::PropagatePhi(Float_t pt, Float_t charge, Bool_t& curls)
79{
80 // Propagates phi angle to EMCAL radius
81 // //
82 Float_t b = 0.0, rEMCAL = -1.0;
83 if(rEMCAL<0)
84 {
85 b = gAlice->Field()->SolenoidField();
86 rEMCAL = AliEMCALGeometry::GetInstance()->GetIPDistance();
87 }
88 Float_t dPhi = 0.;
89 Float_t rB = 3335.6 * pt / b; // [cm] (case of |charge|=1)
90 if (2.*rB < rEMCAL)
91 {
92 curls = kTRUE;
93 return dPhi;
94 }
95 Float_t phi = TMath::ACos(1.-rEMCAL*rEMCAL/(2.*rB*rB));
96 dPhi = TMath::ATan2(1.-TMath::Cos(phi), TMath::Sin(phi));
97 dPhi = -TMath::Sign(dPhi, charge);
98 return dPhi;
99}
100