]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG/FLOW/Tasks/AliAnalysisTaskFilterFE.cxx
AOD handeling, added mass to the flowtracks, new task to reuse flowevent
[u/mrichter/AliRoot.git] / PWG / FLOW / Tasks / AliAnalysisTaskFilterFE.cxx
1 /*************************************************************************
2 * Copyright(c) 1998-2008, 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 // AliAnalysisTaskFilterFE:
18 //
19 // (re)tag RFP and POI in flowEvent in order to 
20 // reuse it in train
21 ////////////////////////////////////////////////////
22
23 #include "AliAnalysisManager.h"
24 #include "AliAnalysisTaskSE.h"
25 #include "AliFlowEventSimple.h"
26 #include "AliFlowTrackSimpleCuts.h"
27 #include "AliAnalysisTaskFilterFE.h"
28
29 ClassImp(AliAnalysisTaskFilterFE)
30
31 //________________________________________________________________________
32 AliAnalysisTaskFilterFE::AliAnalysisTaskFilterFE() :
33   AliAnalysisTaskSE(),
34   fCutsRFP(NULL),
35   fCutsPOI(NULL),
36   fMinA(-1.0),
37   fMaxA(-0.01),
38   fMinB(0.01),
39   fMaxB(1.0),
40   fFlowEvent(NULL)
41 {
42   // Constructor
43   cout<<"AliAnalysisTaskFilterFE::AliAnalysisTaskFilterFE()"<<endl;
44 }
45
46 //________________________________________________________________________
47 AliAnalysisTaskFilterFE::AliAnalysisTaskFilterFE(const char *name, AliFlowTrackSimpleCuts *cutsRFP, AliFlowTrackSimpleCuts *cutsPOI) :
48   AliAnalysisTaskSE(name),
49   fCutsRFP(cutsRFP),
50   fCutsPOI(cutsPOI),
51   fMinA(-1.0),
52   fMaxA(-0.01),
53   fMinB(0.01),
54   fMaxB(1.0),
55   fFlowEvent(NULL)
56 {
57   // Constructor
58   cout<<"AliAnalysisTaskFilterFE::AliAnalysisTaskFilterFE(const char *name, ...)"<<endl;
59   DefineInput( 0, AliFlowEventSimple::Class());
60   DefineOutput(1, AliFlowEventSimple::Class());
61 }
62
63 //________________________________________________________________________
64 AliAnalysisTaskFilterFE::~AliAnalysisTaskFilterFE()
65 {
66   // Destructor
67   delete fCutsRFP;
68   delete fCutsPOI;
69 }
70 //________________________________________________________________________
71 void AliAnalysisTaskFilterFE::UserCreateOutputObjects()
72 {
73   // Called at every worker node to initialize
74   cout<<"AliAnalysisTaskFilterFE::CreateOutputObjects()"<<endl;
75   PostData(1,fFlowEvent);
76 }
77
78 //________________________________________________________________________
79 void AliAnalysisTaskFilterFE::UserExec(Option_t *)
80 {
81   // Main loop
82   fFlowEvent = dynamic_cast<AliFlowEventSimple*>(GetInputData(0)); // from TaskSE
83   if (!fFlowEvent) return;
84   if(fCutsRFP) fFlowEvent->TagRP(fCutsRFP);
85   if(fCutsPOI) fFlowEvent->TagPOI(fCutsPOI);
86   fFlowEvent->TagSubeventsInEta(fMinA,fMaxA,fMinB,fMaxB);
87   PostData(1,fFlowEvent);
88 }