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 // unfolding correction for the pt
17 // author: Eulogio Serradilla <eulogio.serradilla@cern.ch>
19 //#include <Riostream.h>
27 #include "AliLnUnfolding.h"
30 ClassImp(AliLnUnfolding)
32 AliLnUnfolding::AliLnUnfolding(const TString& particle, const TString& simuFilename, const TString& outputFilename, const TString& otag)
35 , fSimuFilename(simuFilename)
36 , fOutputFilename(outputFilename)
44 AliLnUnfolding::~AliLnUnfolding()
51 Int_t AliLnUnfolding::Exec()
54 // extract the detector response from the simulation for particle/antiparticle
58 TFile* fsimu = new TFile(fSimuFilename.Data(), "read");
59 if(fsimu->IsZombie()) exit(1);
61 TFile* foutput = new TFile(fOutputFilename.Data(), "recreate");
64 foutput->mkdir(fOutputTag.Data());
65 foutput->cd(fOutputTag.Data());
68 TH2D* hResponseMtx = (TH2D*)FindObj(fsimu, fParticle + "_Prim_Response_Matrix");
69 hResponseMtx->SetName(Form("%s_Response_Matrix",fParticle.Data()));
70 hResponseMtx->Write();
72 TH1D* hMeasuredPt = (TH1D*)FindObj(fsimu, fParticle + "_PID_Pt");
73 hMeasuredPt->SetName(Form("%s_Measured_Pt", fParticle.Data()));
77 TH1D* hTruePt = (TH1D*)FindObj(fsimu, fParticle + "_Sim_PID_Prim_Pt");
78 hTruePt->SetName(Form("%s_True_Pt", fParticle.Data()));