]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG4/PartCorrBase/AliCaloTrackESDReader.cxx
Fix Coverity
[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 //---- ANALYSIS system ----
30 #include "AliCaloTrackESDReader.h" 
31 #include "AliAODEvent.h"
32 #include "AliMultiEventInputHandler.h"
33 #include "AliAnalysisManager.h"
34 #include "AliMixedEvent.h"
35 #include "AliESDEvent.h"
36
37 ClassImp(AliCaloTrackESDReader)
38
39 //______________________________________________
40 AliCaloTrackESDReader::AliCaloTrackESDReader() : 
41 AliCaloTrackReader()
42 {
43   //Default Ctor
44   
45   //Initialize parameters
46   fDataType=kESD;
47   fReadStack          = kTRUE;
48   fReadAODMCParticles = kFALSE;
49
50 }
51
52 //_________________________________________________________________
53 void AliCaloTrackESDReader::SetInputOutputMCEvent(AliVEvent* esd, 
54                                                   AliAODEvent* aod, 
55                                                   AliMCEvent* mc) 
56 {
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 }
86
87
88