Fix
[u/mrichter/AliRoot.git] / PHOS / Checker.C
CommitLineData
4f36a998 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 checking what has been produced by Simulation.C and Reconstruction.C
18// Use Case :
19// root> .L Checking.C++
20// root> check("HSDRE", "PHOS EMCAL") --> checks how many hits, Sdigits, Digits and
21// Reconstruction objects and ESD have been produced
22// author : Yves Schutz (CERN/SUBATECH)
23// February 2004
24//_________________________________________________________________________
25
26#include "AliPHOSGetter.h"
27#include "AliEMCALGetter.h"
28#include "AliESD.h"
29#include "Riostream.h"
30#include "TString.h"
31
32void check(TString opt="HSDRE", TString name="all")
33{
34 if ( name.Contains("PHOS") ) {
35 AliPHOSGetter * gime = AliPHOSGetter::Instance("galice.root") ;
36 cout << ">>>>>>>>>>>> PHOS:" ;
37 Int_t event ;
38 for (event = 0; event < gime->MaxEvent(); event++) {
39 gime->Event(event) ;
40 cout << " event # " << event << endl ;
41 if ( opt.Contains("H") )
42 cout << " Hits # " << gime->Hits()->GetEntries() << endl ;
43 if ( opt.Contains("S") )
44 cout << " SDigits # " << gime->SDigits()->GetEntries() << endl ;
45 if ( opt.Contains("D") )
46 cout << " Digits # " << gime->Digits()->GetEntries() << endl ;
47 if ( opt.Contains("R") ){
48 cout << " EMC Recpoints # " << gime->EmcRecPoints()->GetEntries() << endl ;
49 cout << " CPV Recpoints # " << gime->CpvRecPoints()->GetEntries() << endl ;
50 cout << " Track Segments# " << gime->TrackSegments()->GetEntries() << endl ;
51 cout << " Rec Particles # " << gime->RecParticles()->GetEntries() << endl ;
52 }
53 }
54 }
55 if ( name.Contains("EMCAL") ) {
56 AliEMCALGetter * gime = AliEMCALGetter::Instance("galice.root") ;
57 cout << ">>>>>>>>>>>> EMCAL:" ;
58 Int_t event ;
59 for (event = 0; event < gime->MaxEvent(); event++) {
60 gime->Event(event) ;
61 cout << " event # " << event << endl ;
62 if ( opt.Contains("H") )
63 cout << " Hits # " << gime->Hits()->GetEntries() << endl ;
64 if ( opt.Contains("S") )
65 cout << " SDigits # " << gime->SDigits()->GetEntries() << endl ;
66 if ( opt.Contains("D") )
67 cout << " Digits # " << gime->Digits()->GetEntries() << endl ;
68 if ( opt.Contains("R") ){
69 cout << " EMC Recpoints # " << gime->ECARecPoints()->GetEntries() << endl ;
70 cout << " Rec Particles # " << gime->RecParticles()->GetEntries() << endl ;
71 }
72 }
73 }
74 if ( opt.Contains("E") ) {
75 AliPHOSGetter * gime = AliPHOSGetter::Instance("galice.root") ;
76 Int_t nEvent = gime->MaxEvent() ;
77 Int_t event ;
78 AliESD * esd ;
79 for (event = 0 ; event < nEvent; event++) {
80 esd = gime->ESD(event) ;
81 esd->Print();
82 }
83 }
84}