AliPhysics  58f3d52 (58f3d52)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliDalitzElectronSelector.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  * *
4  * Authors: Svein Lindal, Daniel Lohner *
5  * Version 1.0 *
6  * *
7  * Permission to use, copy, modify and distribute this software and its *
8  * documentation strictly for non-commercial purposes is hereby granted *
9  * without fee, provided that the above copyright notice appears in all *
10  * copies and that both the copyright notice and this permission notice *
11  * appear in the supporting documentation. The authors make no claims *
12  * about the suitability of this software for any purpose. It is *
13  * provided "as is" without express or implied warranty. *
14  **************************************************************************/
15 
17 //---------------------------------------------
18 // Class reconstructing primary electrons
19 //---------------------------------------------
21 
22 
24 #include "AliDalitzElectronCuts.h"
25 #include "AliAODv0.h"
26 #include "AliESDv0.h"
27 #include "AliAODEvent.h"
28 #include "AliESDEvent.h"
29 #include "TVector.h"
30 #include "AliESDtrack.h"
31 #include "AliAnalysisManager.h"
32 #include "AliInputEventHandler.h"
33 #include "TChain.h"
34 
35 class iostream;
36 
37 using namespace std;
38 
39 
40 
42 
43 //________________________________________________________________________
45  fElectronCuts(0),
46  fPositronsIndex(),
47  fElectronsIndex(),
48  fEventIsSelected(kFALSE)
49 {
50  // Default constructor
51  DefineInput(0, TChain::Class());
52 }
53 
54 //________________________________________________________________________
56 {
57  // default deconstructor
58 
59 
60 }
61 //________________________________________________________________________
63 {
64  // Initialize function to be called once before analysis
65 
66  if(fElectronCuts == 0){
67  // fElectronCuts=AliConversionCuts::GetStandardCuts2010PbPb();
68  AliError("No Cut Selection initialized");
69  }
70 
71 }
72 
73 //________________________________________________________________________
75 {
76  // Create User Output Objects
77 }
78 
79 //________________________________________________________________________
81  // User Exec
82  fEventIsSelected=ProcessEvent(fInputEvent,fMCEvent);
83 }
84 
85 //________________________________________________________________________
86 Bool_t AliDalitzElectronSelector::ProcessEvent(AliVEvent *inputEvent,AliMCEvent *mcEvent)
87 {
88  //Reset the index
89 
90  fPositronsIndex.clear();
91  fElectronsIndex.clear();
92 
93 
94  fInputEvent=inputEvent;
95  fMCEvent=mcEvent;
96 
97  if(!fInputEvent){
98  AliError("No Input event");
99  return kFALSE;
100  }
101 
102  if(!fElectronCuts){AliError("No ConversionCuts");return kFALSE;}
103 
104 
105  if(fInputEvent->IsA()==AliESDEvent::Class()){
106  ProcessESDs();
107  }
108 
109  //if(fInputEvent->IsA()==AliAODEvent::Class()){
110  //GetAODConversionGammas();
111  //}
112 
113 
114  return kTRUE;
115 }
116 
119  // Process ESD V0s for conversion photon reconstruction
120  AliESDEvent *fESDEvent=dynamic_cast<AliESDEvent*>(fInputEvent);
121  if(fESDEvent){
122  for(Int_t currentTrackIndex=0;currentTrackIndex<fESDEvent->GetNumberOfTracks();currentTrackIndex++){
123  AliESDtrack *fCurrentTrack = (AliESDtrack*)(fESDEvent->GetTrack(currentTrackIndex));
124  if(!fCurrentTrack){
125  printf("Requested Track does not exist");
126  continue;
127  }
128  if ( fElectronCuts->ElectronIsSelected( fCurrentTrack ) ) {
129  if( fCurrentTrack->GetSign() > 0.0 ){
130  fPositronsIndex.push_back(currentTrackIndex);
131  } else {
132  fElectronsIndex.push_back(currentTrackIndex);
133  }
134  }
135  }
136  }
137  return kTRUE;
138 }
139 
140 
141 //________________________________________________________________________
143 {
144 
145 }
virtual void Terminate(Option_t *)
virtual void UserExec(Option_t *option)
Bool_t ProcessEvent(AliVEvent *inputEvent, AliMCEvent *mcEvent=NULL)
int Int_t
Definition: External.C:63
const char Option_t
Definition: External.C:48
bool Bool_t
Definition: External.C:53