]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG4/GammaConv/ConvCorrelations/AliAnaConvCorrPion.cxx
Moving gamma jet ana to separate folder. Addding several ana processors.
[u/mrichter/AliRoot.git] / PWG4 / GammaConv / ConvCorrelations / AliAnaConvCorrPion.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   AliAnaConvCorrPion.cxx
17 /// @author Svein Lindal
18 /// @brief  Class used to run conversion gamma/pion - hadron/jet analysis
19
20
21
22 #include "AliAnaConvCorrPion.h"
23 #include "AliAODTrack.h"
24 #include "TClonesArray.h"
25 #include "AliAODConversionParticle.h"
26
27 #include <iostream>
28
29
30 using namespace std;
31 ClassImp(AliAnaConvCorrPion)
32
33 //________________________________________________________________________
34 AliAnaConvCorrPion::AliAnaConvCorrPion() :
35 AliAnaConvCorrBase("pion_hadron_corr") {
36   //consctructor
37 }
38 //________________________________________________________________________
39 AliAnaConvCorrPion::AliAnaConvCorrPion(TString name) :
40 AliAnaConvCorrBase(name) {
41   //consctructor
42 }
43
44
45 //________________________________________________________________________________
46 AliAnaConvCorrPion::~AliAnaConvCorrPion() {
47   //destructor
48 }
49
50
51 ///_______________________________________________________________________________
52 void AliAnaConvCorrPion::GetTrackLabels(const AliAODConversionParticle * pion, const TClonesArray * photons, Int_t* trackLabels) {
53   ///Get the track labels of the electrons reconstructed as gamma forming the pion
54
55   for(Int_t i = 0; i< 2; i++) {
56     AliAODConversionParticle * gamma = dynamic_cast<AliAODConversionParticle*>(photons->At(pion->GetTrackLabel(i)));
57
58     if(gamma) { 
59       for(Int_t j = 0; j< 2; j++) {
60         cout << "index " << i + j + ((i>=j)?1:0) << " " << gamma->GetTrackLabel(j) << endl;
61         trackLabels[ i*2+ j] = gamma->GetTrackLabel(j);
62       }
63
64     } else {
65       AliGammaConversionAODObject * aodO = dynamic_cast<AliGammaConversionAODObject*>(photons->At(pion->GetTrackLabel(i)));
66       if(aodO) {
67         trackLabels[i*2] = aodO->GetLabel1();
68         trackLabels[i*2 + 1] = aodO->GetLabel2();
69       } else {
70         cout << "AliAnaConvCorrPion::GetTrackLabels() :: Not good!!!"<<endl;
71       }
72     }
73   }
74 }
75  
76
77 ///__________________________________________________________________________
78 void AliAnaConvCorrPion::CorrelateWithHadrons(AliAODConversionParticle * pion, const TClonesArray * tracks,  const Bool_t isolated, const Int_t nSpawn, const Int_t * const spawn) {
79   //See header file for documentation
80
81   FillTriggerCounters(pion->Pt(), isolated);
82
83
84   if (tracks) {
85     for(int ij = 0; ij < tracks->GetEntriesFast(); ij++) {
86       AliAODTrack * track = dynamic_cast<AliAODTrack*>(tracks->At(ij));
87       if(track) {
88         if(pion->IsMySpawn(track->GetID(), nSpawn, spawn)) continue;
89         
90         if (track->Pt() < GetCorrelatedPt() ) continue;
91
92         FillHistograms(pion->Pt(), track->Pt(), GetDPhi(pion->Phi() - track->Phi()), pion->Eta() - track->Eta(), isolated);
93
94       }
95     }
96   }
97 }