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 **************************************************************************/
18 //_________________________________________________________________________
19 // A basic analysis task to analyse photon detected by PHOS
22 //////////////////////////////////////////////////////////////////////////////
30 #include "AliAnaScale.h"
31 #include "AliAnalysisManager.h"
33 #include "Riostream.h"
35 //______________________________________________________________________________
36 AliAnaScale::AliAnaScale() :
44 //______________________________________________________________________________
45 AliAnaScale::AliAnaScale(const char *name) :
46 AliAnalysisTask(name,""),
53 // Called only after the event loop
54 SetPostEventLoop(kTRUE);
56 DefineInput(0, TList::Class()) ;
58 DefineOutput(0, TList::Class()) ;
61 //______________________________________________________________________________
62 AliAnaScale::~AliAnaScale()
69 //______________________________________________________________________________
70 void AliAnaScale::ConnectInputData(const Option_t*)
72 // Initialisation of branch container and histograms
74 AliInfo(Form("*** Initialization of %s", GetName())) ;
75 fInputList = dynamic_cast<TList*>(GetInputData(0)) ;
77 //________________________________________________________________________
78 void AliAnaScale::CreateOutputObjects()
80 // Create the outputs containers
81 // Is created in Exec(), because the input must be available
85 //______________________________________________________________________________
86 void AliAnaScale::Exec(Option_t *)
90 fOutputList = new TList() ;
91 fOutputList->SetName(GetName()) ;
92 TIter next(fInputList) ;
94 while ( (h = next()) ) {
96 if ( strcmp(h->ClassName(),"TNtuple") ) {
98 sprintf(name, "%sScaled", h->GetName()) ;
99 TH1 * hout = dynamic_cast<TH1*> (h->Clone(name)) ;
100 hout->Scale(fScale) ;
101 fOutputList->Add(hout) ;
103 else fOutputList->Add(h) ;
107 PostData(0, fOutputList);
111 //______________________________________________________________________________
112 void AliAnaScale::Init()
114 // Intialisation of parameters
115 AliInfo("Doing initialisation") ;
116 // nothing to be done
119 //______________________________________________________________________________
120 void AliAnaScale::Terminate(Option_t *)
122 // Processing when the event loop is ended