/************************************************************************* * Copyright(c) 1998-2008, ALICE Experiment at CERN, All rights reserved. * * * * Author: The ALICE Off-line Project. * * Contributors are mentioned in the code where appropriate. * * * * Permission to use, copy, modify and distribute this software and its * * documentation strictly for non-commercial purposes is hereby granted * * without fee, provided that the above copyright notice appears in all * * copies and that both the copyright notice and this permission notice * * appear in the supporting documentation. The authors make no claims * * about the suitability of this software for any purpose. It is * * provided "as is" without express or implied warranty. * **************************************************************************/ /********************************** * analysis task for nested loops * * * * authors: Naomi van der Kolk * * (kolk@nikhef.nl) * * Raimond Snellings * * (snelling@nikhef.nl) * * Ante Bilandzic * * (anteb@nikhef.nl) * * *******************************/ class TFile; class TString; class TList; class AliAnalysisTaskSE; #include "Riostream.h" #include "AliFlowEventSimple.h" #include "AliAnalysisTaskNestedLoops.h" #include "AliFlowAnalysisWithNestedLoops.h" using std::cout; using std::endl; ClassImp(AliAnalysisTaskNestedLoops) //================================================================================================================ AliAnalysisTaskNestedLoops::AliAnalysisTaskNestedLoops(const char *name, Bool_t useParticleWeights): AliAnalysisTaskSE(name), fEvent(NULL), fNL(NULL), fListHistos(NULL), fHarmonic(0), fOppositeChargesPOI(kFALSE), fEvaluateDifferential3pCorrelator(kFALSE), fUseParticleWeights(useParticleWeights), fUsePhiWeights(kFALSE), fUsePtWeights(kFALSE), fUseEtaWeights(kFALSE), fWeightsList(NULL), fEvaluateNestedLoopsForRAD(kTRUE), fEvaluateNestedLoopsForQC(kFALSE), fEvaluateNestedLoopsForMH(kFALSE) { // constructor cout<<"AliAnalysisTaskNestedLoops::AliAnalysisTaskNestedLoops(const char *name, Bool_t useParticleWeights)"<SetHarmonic(fHarmonic); fNL->SetOppositeChargesPOI(fOppositeChargesPOI); fNL->SetEvaluateDifferential3pCorrelator(fEvaluateDifferential3pCorrelator); if(fUseParticleWeights) { // Pass the flags to class: if(fUsePhiWeights) fNL->SetUsePhiWeights(fUsePhiWeights); if(fUsePtWeights) fNL->SetUsePtWeights(fUsePtWeights); if(fUseEtaWeights) fNL->SetUseEtaWeights(fUseEtaWeights); // Get data from input slot #1 which is used for weights: if(GetNinputs()==2) { fWeightsList = (TList*)GetInputData(1); } // Pass the list with weights to class: if(fWeightsList) fNL->SetWeightsList(fWeightsList); } fNL->SetEvaluateNestedLoopsForRAD(fEvaluateNestedLoopsForRAD); fNL->SetEvaluateNestedLoopsForQC(fEvaluateNestedLoopsForQC); fNL->SetEvaluateNestedLoopsForMH(fEvaluateNestedLoopsForMH); fNL->Init(); if(fNL->GetHistList()) { fListHistos = fNL->GetHistList(); // fListHistos->Print(); } else { Printf("ERROR: Could not retrieve histogram list (NL, Task::UserCreateOutputObjects()) !!!!"); } PostData(1,fListHistos); } // end of void AliAnalysisTaskNestedLoops::UserCreateOutputObjects() //================================================================================================================ void AliAnalysisTaskNestedLoops::UserExec(Option_t *) { // main loop (called for each event) fEvent = dynamic_cast(GetInputData(0)); // Nested Loops: if(fEvent) { fNL->Make(fEvent); } else { cout<<"WARNING: No input data (NL, Task::UserExec()) !!!!"<GetOutputHistograms(fListHistos); fNL->Finish(); PostData(1,fListHistos); } else { cout<<" WARNING: histogram list pointer is empty (NL, Task::Terminate()) !!!!"<