making the container name parameterized
[u/mrichter/AliRoot.git] / PWG / CaloTrackCorrBase / AliCaloTrackESDReader.cxx
CommitLineData
1c5acb87 1
2/**************************************************************************
3 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * *
5 * Author: The ALICE Off-line Project. *
6 * Contributors are mentioned in the code where appropriate. *
7 * *
8 * Permission to use, copy, modify and distribute this software and its *
9 * documentation strictly for non-commercial purposes is hereby granted *
10 * without fee, provided that the above copyright notice appears in all *
11 * copies and that both the copyright notice and this permission notice *
12 * appear in the supporting documentation. The authors make no claims *
13 * about the suitability of this software for any purpose. It is *
14 * provided "as is" without express or implied warranty. *
15 **************************************************************************/
1c5acb87 16
17//_________________________________________________________________________
18// Class for reading data (ESDs) in order to do prompt gamma
19// or other particle identification and correlations
20//
0ae57829 21//
591cc579 22//
23//
1c5acb87 24//*-- Author: Gustavo Conesa (LNF-INFN)
25//////////////////////////////////////////////////////////////////////////////
26
27
1c5acb87 28//---- ANALYSIS system ----
29#include "AliCaloTrackESDReader.h"
1c5acb87 30#include "AliAODEvent.h"
c8fe2783 31#include "AliMultiEventInputHandler.h"
32#include "AliAnalysisManager.h"
c8fe2783 33#include "AliMixedEvent.h"
f3138ecf 34#include "AliESDEvent.h"
1c5acb87 35
36ClassImp(AliCaloTrackESDReader)
37
43074325 38//______________________________________________
1c5acb87 39AliCaloTrackESDReader::AliCaloTrackESDReader() :
40AliCaloTrackReader()
41{
78219bac 42 //Default Ctor
43
44 //Initialize parameters
45 fDataType=kESD;
46 fReadStack = kTRUE;
47 fReadAODMCParticles = kFALSE;
1c5acb87 48
0ae57829 49}
1c5acb87 50
43074325 51//_________________________________________________________________
52void AliCaloTrackESDReader::SetInputOutputMCEvent(AliVEvent* esd,
53 AliAODEvent* aod,
54 AliMCEvent* mc)
55{
477d6cee 56 // Connect the data pointers
57
c8fe2783 58 Bool_t tesd = kFALSE ;
43074325 59
0de1814a 60 if ( strcmp(esd->GetName(), "AliMixedEvent") == 0 )
61 {
c8fe2783 62 AliMultiEventInputHandler* multiEH = dynamic_cast<AliMultiEventInputHandler*>((AliAnalysisManager::GetAnalysisManager())->GetInputEventHandler());
0de1814a 63 if(multiEH)
64 {
65 if (multiEH->GetFormat() == 0 )
66 {
898c9d44 67 tesd = kTRUE ;
68 }
69 }
0de1814a 70 else
71 {
898c9d44 72 printf("AliCaloTrackESDReader::SetInputOutputMCEvent() - MultiEventHandler is NULL");
73 abort();
c8fe2783 74 }
75 }
0de1814a 76 if (strcmp(esd->GetName(),"AliESDEvent") == 0)
77 {
c8fe2783 78 tesd = kTRUE ;
79 }
80
0de1814a 81 if(!tesd)
82 {
c8fe2783 83 AliFatal(Form("AliCaloTrackESDReader::SetInputOutputMCEvent() - STOP ::Wrong reader, here only ESDs. Input name: %s != AliESDEvent \n",esd->GetName()));
477d6cee 84 }
85
86 SetInputEvent(esd);
87 SetOutputEvent(aod);
88 SetMC(mc);
89
1c5acb87 90}
43074325 91
92
93