12391a12 |
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 | /* $Id$ */ |
16 | //_________________________________________________________________________ |
17 | // Macros analyzing the ESD file |
18 | // Use Case : |
19 | // root> .L AnaESD.C++ |
20 | // root> ana() --> prints the objects stored in ESD |
21 | // |
22 | // author : Yves Schutz (CERN/SUBATECH) |
23 | // February 2004 |
24 | //_________________________________________________________________________ |
baf5b427 |
25 | #include "TFile.h" |
26 | #include "AliPHOSGetter.h" |
27 | #include "Riostream.h" |
28 | #include "AliESD.h" |
1d13ffb1 |
29 | #include "AliESDCaloTrack.h" |
30 | #include "AliEMCALRecParticle.h" |
31 | #include "AliPHOSRecParticle.h" |
baf5b427 |
32 | |
33 | void Ana() |
34 | { |
35 | AliPHOSGetter * gime = AliPHOSGetter::Instance("galice.root") ; |
36 | Int_t nEvent = gime->MaxEvent() ; |
37 | Int_t event ; |
1d13ffb1 |
38 | AliESD * esd = 0 ; |
baf5b427 |
39 | for (event = 0 ; event < nEvent; event++) { |
40 | esd = gime->ESD(event) ; |
1d13ffb1 |
41 | esd->Print(); |
42 | Int_t index ; |
43 | AliESDCaloTrack * ct ; |
44 | AliPHOSRecParticle * pp ; |
45 | AliEMCALRecParticle * ep ; |
46 | for (index = 0 ; index < esd->GetNumberOfCaloTracks() ; index++) { |
47 | ct = esd->GetCaloTrack(index) ; |
48 | pp = dynamic_cast<AliPHOSRecParticle*>(ct->GetRecParticle()) ; |
49 | ep = dynamic_cast<AliEMCALRecParticle*>(ct->GetRecParticle()) ; |
50 | if (pp) |
51 | cout << "particle # " << index << " is from PHOS " << endl ; |
52 | if(ep) |
53 | cout << "particle # " << index << " is from EMCAL " << endl ; |
54 | } |
baf5b427 |
55 | } |
56 | } |