1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
16 //_________________________________________________________________________
17 // Macros analyzing the ESD file
19 // root> .L AnaESD.C++
20 // root> ana() --> prints the objects stored in ESD
22 // author : Yves Schutz (CERN/SUBATECH)
24 //_________________________________________________________________________
25 #if !defined(__CINT__) || defined(__MAKECINT__)
29 #include "AliPHOSGetter.h"
30 #include "AliPHOSGeometry.h"
31 #include "Riostream.h"
33 #include "AliESDtrack.h"
34 #include "AliESDCaloTrack.h"
35 #include "AliEMCALRecParticle.h"
36 #include "AliPHOSRecParticle.h"
37 #include "AliKalmanTrack.h"
40 void Match(TParticle * pp, AliESDtrack * cp, Double_t * dist) ;
41 TH1D * heta = new TH1D("heta", "Eta correlation", 100, 0., 360.) ;
42 TH1D * hphi = new TH1D("hphi", "Phi correlation", 100, 0., 360.) ;
48 AliPHOSGetter * gime = AliPHOSGetter::Instance("galice.root") ;
49 Int_t nEvent = gime->MaxEvent() ;
52 for (event = 0 ; event < nEvent; event++) {
53 esd = gime->ESD(event) ;
57 AliESDCaloTrack * ct ;
58 for (caloindex = 0 ; caloindex < esd->GetNumberOfCaloTracks() ; caloindex++) {
59 // get the calorimeter type of particles (PHOS or EMCAL)
60 ct = esd->GetCaloTrack(caloindex) ;
61 TParticle * part = ct->GetRecParticle() ;
65 for (cpindex = 0 ; cpindex < esd->GetNumberOfTracks() ; cpindex++) {
66 // get the charged tracks from central tracking
67 cp = esd->GetTrack(cpindex) ;
68 Match(part, cp, dist) ;
70 heta->Fill( dist[1] ) ;
71 hphi->Fill( dist[2] ) ;
78 void Match(TParticle * part, AliESDtrack * cp, Double_t * dist)
80 // Calculates the distance (x,z) between the particle detected by PHOS and
81 // the charged particle reconstructed by the global tracking
84 AliPHOSRecParticle * pp = dynamic_cast<AliPHOSRecParticle*>(part) ;
85 AliEMCALRecParticle * ep = dynamic_cast<AliEMCALRecParticle*>(part) ;
90 if (pp) { // it is a PHOS particle
91 Double_t cpTheta, cpPhi ;
92 Double_t phTheta, phPhi ;
93 cpTheta = cpPhi = phTheta = phPhi = 0. ;
94 // cout << "PHOS particle # " << " pos ("
95 // << pp->GetPos().X() << ", " << pp->GetPos().Y() << ", " << pp->GetPos().Z() << ")" << endl ;
97 AliPHOSGetter * gime = AliPHOSGetter::Instance() ;
98 gime->PHOSGeometry()->ImpactOnEmc(*pp, phN, phZ, phX) ;
99 Double_t xyzAtPHOS[3] ;
100 cp->GetOuterXYZ(xyzAtPHOS) ;
101 if ( (xyzAtPHOS[0] + xyzAtPHOS[1] + xyzAtPHOS[2]) != 0.) { //it has reached PHOS
102 //the next check are only if we want high quality tracks
103 // ULong_t status = cp->GetStatus() ;
104 // if ((status & AliESDtrack::kTRDput)==0)
106 // if ((status & AliESDtrack::kTRDStop)!=0)
108 // cout << "Charged particle # " << " pos ("
109 // << xyzAtPHOS[0] << ", " << xyzAtPHOS[1] << ", " << xyzAtPHOS[2] << ")" << endl ;
110 TVector3 poscp(xyzAtPHOS[0], xyzAtPHOS[1], xyzAtPHOS[2]) ;
113 gime->PHOSGeometry()->ImpactOnEmc(poscp, cpN, cpZ, cpX) ;
114 if (cpN) {// we are inside the PHOS acceptance
115 // cout << "Charged Matching 1: " << cpN << " " << cpZ << " " << cpX << endl ;
116 // cout << "Charged Matching 2: " << phN << " " << phZ << " " << phX << endl ;
117 dist[0] = TMath::Sqrt( (cpZ-phZ)*(cpZ-phZ) + (cpX-phX)*(cpX-phX)) ;
119 phTheta = pp->Theta() ;
122 tempo.SetMomentum(xyzAtPHOS[0], xyzAtPHOS[1], xyzAtPHOS[2], 0.) ;
123 cpTheta = tempo.Theta() ;
124 cpPhi = tempo.Phi() ;
125 //cout << phTheta << " " << phPhi << " " << endl
126 //cout << cpTheta << " " << cpPhi-phPhi << " " << endl ;
128 dist[1] = (phTheta - cpTheta)*TMath::RadToDeg() ;
129 dist[2] = (phPhi - cpPhi)*TMath::RadToDeg() ;
133 //cout << "EMCAL particle # " << endl ;