2 /**************************************************************************
3 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * Author: The ALICE Off-line Project. *
6 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 //_________________________________________________________________________
19 // Class for reading data (ESDs) in order to do prompt gamma
20 // or other particle identification and correlations
25 //*-- Author: Gustavo Conesa (LNF-INFN)
26 //////////////////////////////////////////////////////////////////////////////
29 // --- ROOT system ---
30 //#include "Riostream.h"
32 //---- ANALYSIS system ----
33 #include "AliCaloTrackESDReader.h"
34 #include "AliAODEvent.h"
35 #include "AliMultiEventInputHandler.h"
36 #include "AliAnalysisManager.h"
37 #include "AliMixedEvent.h"
38 #include "AliESDVZERO.h"
41 ClassImp(AliCaloTrackESDReader)
43 //____________________________________________________________________________
44 AliCaloTrackESDReader::AliCaloTrackESDReader() :
49 //Initialize parameters
52 fReadAODMCParticles = kFALSE;
56 //____________________________________________________________________________
57 Double_t AliCaloTrackESDReader::GetBField() const {
58 //Return magnetic field
60 Double_t bfield = fInputEvent->GetMagneticField();
66 //____________________________________________________________________________
67 void AliCaloTrackESDReader::SetInputOutputMCEvent(AliVEvent* esd, AliAODEvent* aod, AliMCEvent* mc) {
68 // Connect the data pointers
70 Bool_t tesd = kFALSE ;
72 if ( strcmp(esd->GetName(), "AliMixedEvent") == 0 ) {
73 AliMultiEventInputHandler* multiEH = dynamic_cast<AliMultiEventInputHandler*>((AliAnalysisManager::GetAnalysisManager())->GetInputEventHandler());
75 if (multiEH->GetFormat() == 0 ) {
80 printf("AliCaloTrackESDReader::SetInputOutputMCEvent() - MultiEventHandler is NULL");
84 if (strcmp(esd->GetName(),"AliESDEvent") == 0) {
89 AliFatal(Form("AliCaloTrackESDReader::SetInputOutputMCEvent() - STOP ::Wrong reader, here only ESDs. Input name: %s != AliESDEvent \n",esd->GetName()));
98 //____________________________________________________________________________
99 void AliCaloTrackESDReader::FillInputVZERO(){
100 //Fill VZERO information in data member, add all the channels information.
101 AliESDVZERO* esdV0 = ((AliESDEvent*)fInputEvent)->GetVZEROData();
102 //printf("Init V0: ADC (%d,%d), Multiplicity (%d,%d) \n",fV0ADC[0],fV0ADC[1],fV0Mul[0],fV0Mul[1]);
106 for (Int_t i = 0; i < 32; i++)
108 fV0ADC[0] += (Int_t)esdV0->GetAdcV0C(i);
109 fV0ADC[1] += (Int_t)esdV0->GetAdcV0A(i);
110 fV0Mul[0] += (Int_t)esdV0->GetMultiplicityV0C(i);
111 fV0Mul[1] += (Int_t)esdV0->GetMultiplicityV0A(i);
114 printf("V0: ADC (%d,%d), Multiplicity (%d,%d) \n",fV0ADC[0],fV0ADC[1],fV0Mul[0],fV0Mul[1]);
118 printf("Cannot retrieve V0 ESD! Run w/ null V0 charges");