]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGCF/Correlations/JCORRAN/AliJCORRANTask.cxx
Add event rejection in Filter task as well to avoid any duplicated events in latter...
[u/mrichter/AliRoot.git] / PWGCF / Correlations / JCORRAN / AliJCORRANTask.cxx
CommitLineData
37dde34e 1/**************************************************************************
2 * Copyright(c) 1998-1999, 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// Analysis task for high pt particle correlations
18// author: R.Diaz, J. Rak, D.J. Kim
19// ALICE Group University of Jyvaskyla
20// Finland
21// Fill the analysis containers for ESD or AOD
22// Adapted for AliAnalysisTaskSE and AOD objects
23//////////////////////////////////////////////////////////////////////////////
24
9dc4f671 25#include "TChain.h"
26#include "TList.h"
27#include "TTree.h"
28#include "TFile.h"
37dde34e 29
37dde34e 30
31#include "AliAnalysisTaskSE.h"
32#include "AliAODHandler.h"
33
34#include "AliJCORRANTask.h"
35#include "AliAnalysisManager.h"
37dde34e 36
37#include "AliJTrack.h"
38#include "AliJMCTrack.h"
39#include "AliJPhoton.h"
9dc4f671 40//#include "AliJCaloCell.h"
37dde34e 41#include "AliJEventHeader.h"
42#include "AliJRunHeader.h"
43
44//______________________________________________________________________________
45AliJCORRANTask::AliJCORRANTask() :
46 AliAnalysisTaskSE("PWG4JCORRAN"),
9dc4f671 47 fFilter(0x0),
a2946612 48 fAliJRunHeader(0x0)
9dc4f671 49{
37dde34e 50
51 DefineInput (0, TChain::Class());
9dc4f671 52
53 fFilter = new AliJFilter();
37dde34e 54}
55
56//______________________________________________________________________________
57AliJCORRANTask::AliJCORRANTask(const char *name, TString inputformat):
58 AliAnalysisTaskSE(name),
9dc4f671 59 fFilter(0x0),
a2946612 60 fAliJRunHeader(0x0)
37dde34e 61{
62 // Constructor
9dc4f671 63 AliInfo("---- AliJCORRANTask Constructor ----");
37dde34e 64
9dc4f671 65 JUNUSED(inputformat);
37dde34e 66
67 DefineInput (0, TChain::Class());
9dc4f671 68
69 fFilter = new AliJFilter( Form("%sFilter",name), this );
37dde34e 70}
71
72//____________________________________________________________________________
73AliJCORRANTask::AliJCORRANTask(const AliJCORRANTask& ap) :
74 AliAnalysisTaskSE(ap.GetName()),
9dc4f671 75 fFilter(ap.fFilter),
a2946612 76 fAliJRunHeader(ap.fAliJRunHeader)
37dde34e 77{
37dde34e 78
9dc4f671 79 AliInfo("----DEBUG AliJCORRANTask COPY ----");
37dde34e 80
81}
82
83//_____________________________________________________________________________
84AliJCORRANTask& AliJCORRANTask::operator = (const AliJCORRANTask& ap)
85{
86 // assignment operator
87
9dc4f671 88 AliInfo("----DEBUG AliJCORRANTask operator= ----");
37dde34e 89 this->~AliJCORRANTask();
90 new(this) AliJCORRANTask(ap);
91 return *this;
92}
93
94//______________________________________________________________________________
95AliJCORRANTask::~AliJCORRANTask()
96{
97 // destructor
37dde34e 98
9dc4f671 99 delete fFilter;
9dc4f671 100 delete fAliJRunHeader;
37dde34e 101
102}
103
104//________________________________________________________________________
105
106void AliJCORRANTask::UserCreateOutputObjects()
107{
108 //=== create the jcorran outputs objects
109 if(fDebug > 1) printf("AliJCORRANTask::UserCreateOutPutData() \n");
9dc4f671 110
37dde34e 111 //=== Get AnalysisManager
112 AliAnalysisManager *man = AliAnalysisManager::GetAnalysisManager();
113 if(!man->GetOutputEventHandler()) {
114 Fatal("UserCreateOutputObjects", "This task needs an AOD handler");
115 return;
116 }
37dde34e 117
9dc4f671 118 // run the filter class
119 fFilter->SetMyTask( this );
120 fFilter->SetAliJRunHeader( fAliJRunHeader );
121 fFilter->UserCreateOutputObjects();
37dde34e 122
37dde34e 123
9dc4f671 124 cout << "Add(fAliRunHeader) in UserCreateObject() ======= " << endl;
37dde34e 125
126}
127
128//______________________________________________________________________________
9dc4f671 129void AliJCORRANTask::UserExec(Option_t* /*option*/)
37dde34e 130{
37dde34e 131
9dc4f671 132 // Processing of one event
133 if(fDebug > 5) cout << "------- AliJCORRANTask Exec-------"<<endl;
134 if(!((Entry()-1)%100)) AliInfo(Form(" Processing event # %lld", Entry()));
96db384e 135 if( fFilter->GetEventSuccess() ){
136 fFilter->UserExec("");
137 }
37dde34e 138
9dc4f671 139 if(fDebug > 5) cout << "\t------- End UserExec "<<endl;
37dde34e 140}
141
142//______________________________________________________________________________
9dc4f671 143void AliJCORRANTask::Init()
37dde34e 144{
9dc4f671 145 // Intialisation of parameters
146 AliInfo("Doing initialization") ;
37dde34e 147
9dc4f671 148 fFilter->Init();
37dde34e 149}
150
151//______________________________________________________________________________
a2946612 152void AliJCORRANTask::Terminate(Option_t *)
37dde34e 153{
87beb1a6 154 //fFilter->Terminate();
9dc4f671 155
156 // Processing when the event loop is ended
87beb1a6 157 //fAliJRunHeader->PrintOut();
9dc4f671 158 cout<<"AliJCORRANTask Analysis DONE !!"<<endl;
37dde34e 159}