]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSSteerPid.cxx
Produce sample with given amp, delegate ADC2GeV conversion to OCDB
[u/mrichter/AliRoot.git] / ITS / AliITSSteerPid.cxx
index ed4f7b8f1906a3676c13e12e98190ebf3704e902..379a51955f9f0176e3331925b1b8cec57939f6ef 100644 (file)
@@ -1,3 +1,20 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, 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.                  *
+ **************************************************************************/
+
+/* $Id$ */
+
 /////////////////////////////////////////////////////////////////////////
 //Steering Class for PID in the ITS                                      //
 //The PID is based on the likelihood of all the four ITS' layers,        //
 // Origin: Elena Bruna bruna@to.infn.it, Massimo Masera masera@to.infn.it//
 /////////////////////////////////////////////////////////////////////////
 
+#include <TClonesArray.h>
+#include <TMath.h>
+
 #include "AliITSSteerPid.h"
 
 ClassImp(AliITSSteerPid)
 
   //______________________________________________________________
-  AliITSSteerPid::AliITSSteerPid(){
+AliITSSteerPid::AliITSSteerPid():
+fClonarr2(0),
+fVect2(0),
+fVect2lay1(0),
+fVect2lay2(0),
+fVect2lay3(0),
+fVect2lay4(0),
+fFitTree(0),
+fItem(0),
+fPCenter(0),
+fPWidth(0)
+{
   // default constructor
-  fClonarr2=0;
-  fVect2=0;
-  fItem=0;
-  fFitTree=0;
-}
+ }
 //______________________________________________________________
 AliITSSteerPid::~AliITSSteerPid(){
   // destructor
@@ -26,25 +53,32 @@ AliITSSteerPid::~AliITSSteerPid(){
 }
 
 //______________________________________________________________________
-AliITSSteerPid::AliITSSteerPid(const AliITSSteerPid &ob) :TObject(ob) {
+AliITSSteerPid::AliITSSteerPid(const AliITSSteerPid &ob) :TObject(ob),
+fClonarr2(ob.fClonarr2),
+fVect2(ob.fVect2),
+fVect2lay1(ob.fVect2lay1),
+fVect2lay2(ob.fVect2lay2),
+fVect2lay3(ob.fVect2lay3),
+fVect2lay4(ob.fVect2lay4),
+fFitTree(ob.fFitTree),
+fItem(ob.fItem),
+fPCenter(ob.fPCenter),
+fPWidth(ob.fPWidth) {
   // Copy constructor
-  // Copies are not allowed. The method is protected to avoid misuse.
-  Error("AliITSSteerPid","Copy constructor not allowed\n");
 }
 
 //______________________________________________________________________
-AliITSSteerPid& AliITSSteerPid::operator=(const AliITSSteerPid& /* ob */){
+AliITSSteerPid& AliITSSteerPid::operator=(const AliITSSteerPid& ob){
   // Assignment operator
-  // Assignment is not allowed. The method is protected to avoid misuse.
-  Error("= operator","Assignment operator not allowed\n");
+  this->~AliITSSteerPid();
+  new(this) AliITSSteerPid(ob);
   return *this;
 }
 
 //______________________________________________________________
 void AliITSSteerPid::InitLayer(TString fileITS,TString fileFitPar){
   // it opens the files useful for the PID 
-  printf("££££ InitLayer.....\n");
-  TFile *fClonarr2=new TFile (fileITS,"r");
+  fClonarr2=new TFile (fileITS,"r");
   fVect2=(TClonesArray*)fClonarr2->Get("vectfitits_0");//truncated mean
   fVect2lay1=(TClonesArray*)fClonarr2->Get("vectfitits_1");//lay 1
   fVect2lay2=(TClonesArray*)fClonarr2->Get("vectfitits_2");//lay 2
@@ -54,7 +88,6 @@ void AliITSSteerPid::InitLayer(TString fileITS,TString fileFitPar){
   TFile *fFitPar=new TFile (fileFitPar);
   fFitTree=(TTree*)fFitPar->Get("tree");
  
-   printf("££££ InitLayer.....DONE \n");
 }
 
 //______________________________________________________________
@@ -74,7 +107,8 @@ AliITSPidParItem* AliITSSteerPid::GetItemLayer(Int_t nolay,Float_t mom){
 
 //______________________________________________________________
 void AliITSSteerPid::GetParFitLayer(Int_t nolay,Float_t mom,Double_t *parp,Double_t *park,Double_t *parpi){
-  //it gives the parameters of the convoluted functions (WL, MP, WG) for protons, kaons and pions for a given momentum and ITS layer
+  //it gives the parameters of the convoluted functions (WL, MP, WG) for 
+  //protons, kaons and pions for a given momentum and ITS layer
 
   Double_t parfit0pro[3]={0,0,0};
   Double_t parfit1pro[3]={0,0,0};
@@ -107,14 +141,16 @@ void AliITSSteerPid::GetParFitLayer(Int_t nolay,Float_t mom,Double_t *parp,Doubl
 }//______________________________________________________________
 void AliITSSteerPid::GetLangausProPars(Float_t mom,Double_t *parfit0,Double_t *parfit1,Double_t *parfit3,Double_t *par){
  
-  //It finds the parameters of the convoluted Landau-Gaussian response function for protons (Width Landau, Most Probable, Width Gaussian)
+  //It finds the parameters of the convoluted Landau-Gaussian response 
+  //function for protons (Width Landau, Most Probable, Width Gaussian)
   par[0]=parfit0[0]+parfit0[1]/mom;
   par[1]=parfit1[0]/(mom*mom)+parfit1[1]/(mom*mom)*TMath::Log(mom*mom)+parfit1[2];
   par[2]=parfit3[0]/(mom*mom)+parfit3[1]/(mom*mom)*TMath::Log(mom*mom)+parfit3[2];
 }
 //______________________________________________________________
 void AliITSSteerPid::GetLangausKaoPars(Float_t mom,Double_t *parfit0,Double_t *parfit1,Double_t *parfit3,Double_t *par){
-  // It finds the parameters of the convoluted Landau-Gaussian response function for kaons (Width Landau, Most Probable, Width Gaussian)
+  // It finds the parameters of the convoluted Landau-Gaussian response 
+  //function for kaons (Width Landau, Most Probable, Width Gaussian)
 
   par[0]=parfit0[0]+parfit0[1]/(mom*mom);
   par[1]=parfit1[0]/(mom*mom)+parfit1[1]/(mom*mom)*TMath::Log(mom*mom)+parfit1[2];
@@ -123,7 +159,8 @@ void AliITSSteerPid::GetLangausKaoPars(Float_t mom,Double_t *parfit0,Double_t *p
 
 //______________________________________________________________
 void AliITSSteerPid::GetLangausPiPars(Float_t mom,Double_t *parfit0,Double_t *parfit1,Double_t *parfit3,Double_t *par){
-  //It finds the parameters of the convoluted Landau-Gaussian response function for pions (Width Landau, Most Probable, Width Gaussian)
+  //It finds the parameters of the convoluted Landau-Gaussian response 
+  //function for pions (Width Landau, Most Probable, Width Gaussian)
 
   par[0]=parfit0[0]/(mom*mom)+parfit0[1]/(mom*mom)*TMath::Log(mom*mom)+parfit0[2];
   par[1]=parfit1[0]/(mom)+parfit1[1]/(mom)*TMath::Log(mom*mom)+parfit1[2];