]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG4/GammaConv/ConvCorrelations/AliAnaConvCorrPhoton.cxx
Updating conv correlation software
[u/mrichter/AliRoot.git] / PWG4 / GammaConv / ConvCorrelations / AliAnaConvCorrPhoton.cxx
1 /**************************************************************************
2  * This file is property of and copyright by the ALICE HLT Project        *
3  * ALICE Experiment at CERN, All rights reserved.                         *
4  *                                                                        *
5  * Primary Author: Svein Lindal <slindal@fys.uio.no>                      *
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 /// @file   AliAnaConvCorrPhoton.cxx
17 /// @author Svein Lindal
18 /// @brief  Class used to fill calculate correlation between photons - tracks
19  
20 #include "AliAnaConvCorrPhoton.h"
21 #include "AliAODTrack.h"
22 #include "TClonesArray.h"
23 #include "AliAODConversionParticle.h"
24
25 #include <iostream>
26 // Gamma - jet correlation analysis task
27 // Authors: Svein Lindal
28
29
30 using namespace std;
31 ClassImp(AliAnaConvCorrPhoton)
32
33 //________________________________________________________________________
34 AliAnaConvCorrPhoton::AliAnaConvCorrPhoton() :
35 AliAnaConvCorrBase("photon_hadron_corr"), 
36   fSkipDecayParticles(kFALSE),
37   fDecayOnly(kFALSE)
38 {
39   //consctructor
40 }
41 //________________________________________________________________________
42 AliAnaConvCorrPhoton::AliAnaConvCorrPhoton(TString name) :
43 AliAnaConvCorrBase(name), 
44 fSkipDecayParticles(kFALSE),
45 fDecayOnly(kFALSE)
46 {
47   //consctructor
48 }
49
50
51 //________________________________________________________________________________
52 AliAnaConvCorrPhoton::~AliAnaConvCorrPhoton() {
53   //destructor
54 }
55
56 ///__________________________________________________________________________
57 void AliAnaConvCorrPhoton::CorrelateWithHadrons(const AliAODConversionParticle * const photon, const TClonesArray * const tracks, const Bool_t isolated, const Bool_t decayParticle) {
58   //See header file for documentation
59
60
61   if( decayParticle && fSkipDecayParticles ) return;
62   else if ( fDecayOnly && !decayParticle ) return;
63
64   FillTriggerCounters(photon->Pt(), isolated);
65
66   if (tracks) {
67       
68     for(int ij = 0; ij < tracks->GetEntriesFast(); ij++) {
69       AliAODTrack * track = dynamic_cast<AliAODTrack*>(tracks->At(ij));
70       if(track) {
71         
72         if ( (track->GetID() == photon->GetTrackLabel(0)) || track->GetID() == photon->GetTrackLabel(1) )   continue;
73         
74         //if (track->Pt() < GetCorrelatedPt() ) continue;
75         
76         FillHistograms(photon->Pt(), track->Pt(), GetDPhi(photon->Phi() - track->Phi()), photon->Eta() - track->Eta(), isolated);
77         
78       }
79     }
80   }
81 }