1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 // Analysis task for high pt particle correlations
18 // author: R.Diaz, J. Rak, D.J. Kim
19 // ALICE Group University of Jyvaskyla
21 // Fill the analysis containers for ESD or AOD
22 // Adapted for AliAnalysisTaskSE and AOD objects
23 //////////////////////////////////////////////////////////////////////////////
31 #include "AliAnalysisTaskSE.h"
32 #include "AliAODHandler.h"
34 #include "AliJCORRANTask.h"
35 #include "AliAnalysisManager.h"
37 #include "AliJTrack.h"
38 #include "AliJMCTrack.h"
39 #include "AliJPhoton.h"
40 //#include "AliJCaloCell.h"
41 #include "AliJEventHeader.h"
42 #include "AliJRunHeader.h"
44 //______________________________________________________________________________
45 AliJCORRANTask::AliJCORRANTask() :
46 AliAnalysisTaskSE("PWG4JCORRAN"),
52 DefineInput (0, TChain::Class());
54 fFilter = new AliJFilter();
57 //______________________________________________________________________________
58 AliJCORRANTask::AliJCORRANTask(const char *name, TString inputformat):
59 AliAnalysisTaskSE(name),
65 AliInfo("---- AliJCORRANTask Constructor ----");
69 DefineInput (0, TChain::Class());
71 fFilter = new AliJFilter( Form("%sFilter",name), this );
74 //____________________________________________________________________________
75 AliJCORRANTask::AliJCORRANTask(const AliJCORRANTask& ap) :
76 AliAnalysisTaskSE(ap.GetName()),
77 fFilterEntry(ap.fFilterEntry),
79 fAliJRunHeader(ap.fAliJRunHeader)
82 AliInfo("----DEBUG AliJCORRANTask COPY ----");
86 //_____________________________________________________________________________
87 AliJCORRANTask& AliJCORRANTask::operator = (const AliJCORRANTask& ap)
89 // assignment operator
91 AliInfo("----DEBUG AliJCORRANTask operator= ----");
92 this->~AliJCORRANTask();
93 new(this) AliJCORRANTask(ap);
97 //______________________________________________________________________________
98 AliJCORRANTask::~AliJCORRANTask()
103 delete fAliJRunHeader;
107 //________________________________________________________________________
109 void AliJCORRANTask::UserCreateOutputObjects()
111 //=== create the jcorran outputs objects
112 if(fDebug > 1) printf("AliJCORRANTask::UserCreateOutPutData() \n");
114 //=== Get AnalysisManager
115 AliAnalysisManager *man = AliAnalysisManager::GetAnalysisManager();
116 if(!man->GetOutputEventHandler()) {
117 Fatal("UserCreateOutputObjects", "This task needs an AOD handler");
121 // run the filter class
122 fFilter->SetMyTask( this );
123 fFilter->SetAliJRunHeader( fAliJRunHeader );
124 fFilter->UserCreateOutputObjects();
127 cout << "Add(fAliRunHeader) in UserCreateObject() ======= " << endl;
131 //______________________________________________________________________________
132 void AliJCORRANTask::UserExec(Option_t* /*option*/)
135 // Processing of one event
136 if(fDebug > 5) cout << "------- AliJCORRANTask Exec-------"<<endl;
137 if(!((Entry()-1)%100)) AliInfo(Form(" Processing event # %lld", Entry()));
138 fFilterEntry = fEntry;
139 fFilter->UserExec("");
141 if(fDebug > 5) cout << "\t------- End UserExec "<<endl;
144 //______________________________________________________________________________
145 void AliJCORRANTask::Init()
147 // Intialisation of parameters
148 AliInfo("Doing initialization") ;
153 //______________________________________________________________________________
154 void AliJCORRANTask::Terminate(Option_t *)
156 //fFilter->Terminate();
158 // Processing when the event loop is ended
159 //fAliJRunHeader->PrintOut();
160 cout<<"AliJCORRANTask Analysis DONE !!"<<endl;