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