]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG4/PartCorrBase/AliCaloTrackESDReader.cxx
b208f9b75b63a453bb688ce1dfbf17bcdf586b83
[u/mrichter/AliRoot.git] / PWG4 / PartCorrBase / AliCaloTrackESDReader.cxx
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  **************************************************************************/
16 /* $Id:  $ */
17
18 //_________________________________________________________________________
19 // Class for reading data (ESDs) in order to do prompt gamma 
20 // or other particle identification and correlations
21 //
22 //
23 //
24 //
25 //*-- Author: Gustavo Conesa (LNF-INFN) 
26 //////////////////////////////////////////////////////////////////////////////
27
28
29 // --- ROOT system ---
30 //#include "Riostream.h"
31
32 //---- ANALYSIS system ----
33 #include "AliCaloTrackESDReader.h" 
34 #include "AliAODEvent.h"
35 #include "AliMultiEventInputHandler.h"
36 #include "AliAnalysisManager.h"
37 #include "AliMixedEvent.h"
38
39
40 ClassImp(AliCaloTrackESDReader)
41
42 //____________________________________________________________________________
43 AliCaloTrackESDReader::AliCaloTrackESDReader() : 
44 AliCaloTrackReader()
45 {
46   //Default Ctor
47   
48   //Initialize parameters
49   fDataType=kESD;
50   fReadStack          = kTRUE;
51   fReadAODMCParticles = kFALSE;
52
53 }
54
55 //____________________________________________________________________________
56 void AliCaloTrackESDReader::SetInputOutputMCEvent(AliVEvent* esd, AliAODEvent* aod, AliMCEvent* mc) {
57   // Connect the data pointers
58   
59   Bool_t tesd = kFALSE ; 
60
61   if ( strcmp(esd->GetName(), "AliMixedEvent") == 0 ) {
62     AliMultiEventInputHandler* multiEH = dynamic_cast<AliMultiEventInputHandler*>((AliAnalysisManager::GetAnalysisManager())->GetInputEventHandler());
63     if(multiEH){
64       if (multiEH->GetFormat() == 0 ) {
65         tesd = kTRUE ; 
66       }
67     }
68     else{
69       printf("AliCaloTrackESDReader::SetInputOutputMCEvent() - MultiEventHandler is NULL");
70       abort();
71     }
72   }
73   if (strcmp(esd->GetName(),"AliESDEvent") == 0) {
74     tesd = kTRUE ; 
75   }
76   
77   if(!tesd){
78     AliFatal(Form("AliCaloTrackESDReader::SetInputOutputMCEvent() - STOP ::Wrong reader, here only ESDs. Input name: %s != AliESDEvent \n",esd->GetName()));
79   }
80   
81   SetInputEvent(esd);
82   SetOutputEvent(aod);
83   SetMC(mc);
84   
85 }