1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Authors: Svein Lindal, Daniel Lohner *
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 **************************************************************************/
16 ////////////////////////////////////////////////
17 //---------------------------------------------
18 // Class reconstructing primary electrons
19 //---------------------------------------------
20 ////////////////////////////////////////////////
23 #include "AliDalitzElectronSelector.h"
24 #include "AliDalitzElectronCuts.h"
27 #include "AliAODEvent.h"
28 #include "AliESDEvent.h"
30 #include "AliESDtrack.h"
31 #include "AliAnalysisManager.h"
32 #include "AliInputEventHandler.h"
42 ClassImp(AliDalitzElectronSelector)
44 //________________________________________________________________________
45 AliDalitzElectronSelector::AliDalitzElectronSelector(const char *name) : AliAnalysisTaskSE(name),
49 fEventIsSelected(kFALSE)
51 // Default constructor
52 DefineInput(0, TChain::Class());
55 //________________________________________________________________________
56 AliDalitzElectronSelector::~AliDalitzElectronSelector()
58 // default deconstructor
62 //________________________________________________________________________
63 void AliDalitzElectronSelector::Init()
65 // Initialize function to be called once before analysis
67 if(fElectronCuts == 0){
68 // fElectronCuts=AliConversionCuts::GetStandardCuts2010PbPb();
69 AliError("No Cut Selection initialized");
74 //________________________________________________________________________
75 void AliDalitzElectronSelector::UserCreateOutputObjects()
77 // Create User Output Objects
80 //________________________________________________________________________
81 void AliDalitzElectronSelector::UserExec(Option_t *){
83 fEventIsSelected=ProcessEvent(fInputEvent,fMCEvent);
86 //________________________________________________________________________
87 Bool_t AliDalitzElectronSelector::ProcessEvent(AliVEvent *inputEvent,AliMCEvent *mcEvent)
91 fPositronsIndex.clear();
92 fElectronsIndex.clear();
95 fInputEvent=inputEvent;
99 AliError("No Input event");
103 if(!fElectronCuts){AliError("No ConversionCuts");return kFALSE;}
106 if(fInputEvent->IsA()==AliESDEvent::Class()){
110 //if(fInputEvent->IsA()==AliAODEvent::Class()){
111 //GetAODConversionGammas();
118 ///________________________________________________________________________
119 Bool_t AliDalitzElectronSelector::ProcessESDs(){
120 // Process ESD V0s for conversion photon reconstruction
121 AliESDEvent *fESDEvent=dynamic_cast<AliESDEvent*>(fInputEvent);
123 for(Int_t currentTrackIndex=0;currentTrackIndex<fESDEvent->GetNumberOfTracks();currentTrackIndex++){
124 AliESDtrack *fCurrentTrack = (AliESDtrack*)(fESDEvent->GetTrack(currentTrackIndex));
126 printf("Requested Track does not exist");
129 if ( fElectronCuts->ElectronIsSelected( fCurrentTrack ) ) {
130 if( fCurrentTrack->GetSign() > 0.0 ){
131 fPositronsIndex.push_back(currentTrackIndex);
133 fElectronsIndex.push_back(currentTrackIndex);
142 //________________________________________________________________________
143 void AliDalitzElectronSelector::Terminate(Option_t *)