AliPhysics  aaf9c62 (aaf9c62)
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: Pedro Gonzales *
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 //________________________________________________________________________
61 {
62  // Initialize function to be called once before analysis
63 
64  if(fElectronCuts == 0){
65  // fElectronCuts=AliConversionCuts::GetStandardCuts2010PbPb();
66  AliError("No Cut Selection initialized");
67  }
68 }
69 
70 //________________________________________________________________________
72 {
73  // Create User Output Objects
74 }
75 
76 //________________________________________________________________________
78  // User Exec
79  fEventIsSelected=ProcessEvent(fInputEvent,fMCEvent);
80 }
81 
82 //________________________________________________________________________
83 Bool_t AliDalitzElectronSelector::ProcessEvent(AliVEvent *inputEvent,AliMCEvent *mcEvent)
84 {
85  //Reset the index
86 
87  fPositronsIndex.clear();
88  fElectronsIndex.clear();
89 
90 
91  fInputEvent=inputEvent;
92  fMCEvent=mcEvent;
93 
94  if(!fInputEvent){
95  AliError("No Input event");
96  return kFALSE;
97  }
98 
99  if(!fElectronCuts){AliError("No ConversionCuts");return kFALSE;}
100 
101 
102  if(fInputEvent->IsA()==AliESDEvent::Class()){
103  ProcessESDs();
104  }
105 
106  //if(fInputEvent->IsA()==AliAODEvent::Class()){
107  //GetAODConversionGammas();
108  //}
109  return kTRUE;
110 }
111 
114  // Process ESD V0s for conversion photon reconstruction
115  AliESDEvent *fESDEvent=dynamic_cast<AliESDEvent*>(fInputEvent);
116  if(fESDEvent){
117  for(Int_t currentTrackIndex=0;currentTrackIndex<fESDEvent->GetNumberOfTracks();currentTrackIndex++){
118  AliESDtrack *fCurrentTrack = (AliESDtrack*)(fESDEvent->GetTrack(currentTrackIndex));
119  if(!fCurrentTrack){
120  printf("Requested Track does not exist");
121  continue;
122  }
123  if ( fElectronCuts->ElectronIsSelected( fCurrentTrack ) ) {
124  if( fCurrentTrack->GetSign() > 0.0 ){
125  fPositronsIndex.push_back(currentTrackIndex);
126  } else {
127  fElectronsIndex.push_back(currentTrackIndex);
128  }
129  }
130  }
131  }
132  return kTRUE;
133 }
134 
135 
136 //________________________________________________________________________
138 {
139 
140 }
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