Add a draw class for the CORRFW (produces a warning, will be fixed
[u/mrichter/AliRoot.git] / PWG3 / dielectron / AliAnalysisTaskDielectronSE.cxx
1 /*************************************************************************
2 * Copyright(c) 1998-2009, ALICE Experiment at CERN, All rights reserved. *
3 *                                                                        *
4 * Author: The ALICE Off-line Project.                                    *
5 * Contributors are mentioned in the code where appropriate.              *
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
16 ///////////////////////////////////////////////////////////////////////////
17 //                                                                       //
18 //                        Basic Analysis Task                            //
19 //                      for Dielectron Analysis                          //
20 //                                                                       //
21 ///////////////////////////////////////////////////////////////////////////
22
23 #include <TChain.h>
24
25 #include <AliCFContainer.h>
26 #include <AliVEvent.h>
27
28 #include "AliDielectron.h"
29 #include "AliDielectronHistos.h"
30 #include "AliDielectronCF.h"
31 #include "AliAnalysisTaskDielectronSE.h"
32
33 ClassImp(AliAnalysisTaskDielectronSE)
34
35 //_________________________________________________________________________________
36 AliAnalysisTaskDielectronSE::AliAnalysisTaskDielectronSE() :
37   AliAnalysisTaskSE(),
38   fDielectron(0)
39 {
40   //
41   // Constructor
42   //
43 }
44
45 //_________________________________________________________________________________
46 AliAnalysisTaskDielectronSE::AliAnalysisTaskDielectronSE(const char *name) :
47   AliAnalysisTaskSE(name),
48   fDielectron(0)
49 {
50   //
51   // Constructor
52   //
53   DefineInput(0,TChain::Class());
54   DefineOutput(1, THashList::Class());
55   DefineOutput(2, AliCFContainer::Class());
56 }
57
58 //_________________________________________________________________________________
59 void AliAnalysisTaskDielectronSE::UserCreateOutputObjects()
60 {
61   //
62   // Initialise the framework objects
63   //
64   if (!fDielectron){
65     AliError("No Dielectron framework object set !!!");
66     return;
67   }
68   fDielectron->Init();
69 }
70
71 //_________________________________________________________________________________
72 void AliAnalysisTaskDielectronSE::UserExec(Option_t *)
73 {
74   //
75   // Main loop. Called for every event
76   //
77
78   if (!fDielectron) return;
79   
80   //bz for AliKF
81   Double_t bz = InputEvent()->GetMagneticField();
82   AliKFParticle::SetField( bz );
83   
84   fDielectron->Process(InputEvent());
85
86   if (fDielectron->GetHistogramList()){
87     PostData(1, const_cast<THashList*>(fDielectron->GetHistogramList()));
88   }
89   if (fDielectron->GetCFManagerPair()){
90     PostData(2, const_cast<AliCFContainer*>(fDielectron->GetCFManagerPair()->GetContainer()));
91   }
92 }
93