#include "AliAnaScale.h"
#include "AliAnalysisManager.h"
#include "AliLog.h"
+#include "Riostream.h"
//______________________________________________________________________________
AliAnaScale::AliAnaScale() :
fDebug(0),
fScale(1.0),
fInputList(0x0),
- fOutputList(0x0),
- fhInPHOSEnergy(0),
- fhOuPHOSEnergy(0)
+ fOutputList(0x0)
{
//Default constructor
}
fDebug(0),
fScale(1.0),
fInputList(0x0),
- fOutputList(0x0),
- fhInPHOSEnergy(0),
- fhOuPHOSEnergy(0)
+ fOutputList(0x0)
{
// Constructor.
// Called only after the event loop
AliInfo(Form("*** Initialization of %s", GetName())) ;
fInputList = dynamic_cast<TList*>(GetInputData(0)) ;
- fhInPHOSEnergy = dynamic_cast<TH1D*>(fInputList->At(2));
}
//________________________________________________________________________
void AliAnaScale::CreateOutputObjects()
{
// Do the Scaling
- fhOuPHOSEnergy = static_cast<TH1D*>(fhInPHOSEnergy->Clone("PHOSEnergyScaled")) ;
-
- // create output container
-
fOutputList = new TList() ;
fOutputList->SetName(GetName()) ;
-
- fOutputList->AddAt(fhOuPHOSEnergy, 0) ;
- fhOuPHOSEnergy->Scale(fScale) ;
+ TIter next(fInputList) ;
+ TObject * h ;
+ while ( (h = next()) ) {
+ if(h){
+ if ( strcmp(h->ClassName(),"TNtuple") ) {
+ char name[20] ;
+ sprintf(name, "%sScaled", h->GetName()) ;
+ TH1 * hout = dynamic_cast<TH1*> (h->Clone(name)) ;
+ hout->Scale(fScale) ;
+ fOutputList->Add(hout) ;
+ }
+ else fOutputList->Add(h) ;
+ }
+ }
+ cout<<"end"<<endl;
PostData(0, fOutputList);
}
{
// Processing when the event loop is ended
- AliInfo(Form(" *** %s Report:", GetName())) ;
- printf(" PHOS Energy Integral In : %5.3e \n", fhInPHOSEnergy->GetIntegral() ) ;
- printf(" PHOS Energy Integral Ou : %5.3e \n", fhOuPHOSEnergy->GetIntegral() ) ;
-
- TCanvas * cPHOS = new TCanvas("cPHOS", "PHOS ESD Test", 400, 10, 600, 700) ;
-
- cPHOS->Divide(2, 1);
- cPHOS->cd(1) ;
- if ( fhInPHOSEnergy->GetMaximum() > 0. )
- gPad->SetLogy();
- fhInPHOSEnergy->SetAxisRange(0, 25.);
- fhInPHOSEnergy->SetLineColor(2);
- fhInPHOSEnergy->Draw();
- cPHOS->cd(2) ;
- if ( fhOuPHOSEnergy->GetMaximum() > 0. )
- gPad->SetLogy();
- fhOuPHOSEnergy->SetAxisRange(0, 25.);
- fhOuPHOSEnergy->SetLineColor(2);
- fhOuPHOSEnergy->Draw();
}