LCOV - code coverage report
Current view: top level - PHOS/PHOSrec - AliPHOSRecCpvManager.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 1 72 1.4 %
Date: 2016-06-14 17:26:59 Functions: 1 13 7.7 %

          Line data    Source code
       1             : /**************************************************************************
       2             :  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
       3             :  *                                                                        *
       4             :  * Author: The ALICE Off-line Project.                                    *
       5             :  * Contributors are mentioned in the code where appropriate.              *
       6             :  *                                                                        *
       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             :  **************************************************************************/
      15             : 
      16             : /* $Id$ */
      17             : 
      18             : //_________________________________________________________________________
      19             : // Class for the management by the CPV reconstruction.
      20             : ////                  
      21             : //*-- Author   : Boris Polichtchouk (IHEP, Protvino) 6 Mar 2001
      22             : //
      23             : // --- ROOT system ---
      24             : 
      25             : #include <TMath.h>
      26             : 
      27             : // --- Standard library ---
      28             : 
      29             : // --- AliRoot header files ---
      30             : 
      31             : #include "AliPHOSRecCpvManager.h"
      32             : #include "AliPHOSGeometry.h" 
      33             : 
      34          20 : ClassImp(AliPHOSRecCpvManager) 
      35             : 
      36             : //____________________________________________________________________________
      37           0 : AliPHOSRecCpvManager::AliPHOSRecCpvManager() :
      38           0 :   fOneGamChisqCut(3.),
      39           0 :   fOneGamInitialStep(0.00005),
      40           0 :   fOneGamChisqMin(1.),
      41           0 :   fOneGamStepMin(0.0005),
      42           0 :   fOneGamNumOfIterations(50),
      43           0 :   fTwoGamInitialStep(0.00005),
      44           0 :   fTwoGamChisqMin(1.),
      45           0 :   fTwoGamEmin(0.1),
      46           0 :   fTwoGamStepMin(0.00005),
      47           0 :   fTwoGamNumOfIterations(50),  
      48           0 :   fThr0(0.),
      49           0 :   fSqdCut(0.) 
      50           0 : {
      51             :   // Put a comment here
      52           0 :   SetTitle("Cpv Reconstruction Manager");
      53           0 : }
      54             : 
      55             : AliPHOSRecCpvManager::~AliPHOSRecCpvManager(void) 
      56           0 : {
      57             :   // Put a comment here
      58           0 : }
      59             : 
      60             : Float_t AliPHOSRecCpvManager::Dispersion(Float_t etot, Float_t ai) const
      61             : {
      62             :   //"Dispresion" of energy deposition in the cell.
      63             :   // etot is the total shower energy, ai is the
      64             :   // calculated cell response,
      65             :   // ei is the measured cell response.
      66             : 
      67             :   const Float_t kConst = 1.5;
      68           0 :   return kConst*ai*(1.-ai/etot);
      69             : }
      70             : 
      71             : Float_t AliPHOSRecCpvManager::OneGamChi2(Float_t ai, Float_t ei, Float_t etot, Float_t& Gi) const
      72             : {
      73             :   //"Chi2" for one cell.
      74             :   // etot is the total "shower" energy, ai is the
      75             :   // calculated cell response,
      76             :   // ei is the measured cell response.
      77             : 
      78             :   const Float_t kConst = 1.5;
      79             : 
      80           0 :   Float_t da = ai - ei;
      81           0 :   Float_t d = kConst*ai*(1.-ai/etot);
      82             : 
      83           0 :   Float_t dd = da/d;
      84           0 :   Gi = dd*(2.- dd*kConst*(1.-2.*ai/etot));
      85             : 
      86           0 :   Info("OneGamChi2", " OneGamChi2 (ai,ei,etot,&Gi,chi2) %f %f %f %f %f", ai, ei, etot, Gi, da*da/d );
      87             : 
      88           0 :   return da*da/d;
      89             : 
      90             : }
      91             : 
      92             : Float_t AliPHOSRecCpvManager::TwoGamChi2(Float_t ai, Float_t ei, Float_t etot, Float_t& gi) const 
      93             : {
      94             :   // Put a comment here
      95             : 
      96             :   const Float_t kConst = 1.5;
      97             : 
      98           0 :   Float_t da = ai - ei;
      99           0 :   Float_t d = kConst*ai*(1.-ai/etot);
     100             : 
     101           0 :   Float_t dd = da/d;
     102           0 :   gi = dd*(2.- dd*kConst*(1.-2.*ai/etot));
     103             : 
     104           0 :   return da*da/d;
     105             :  
     106             : }
     107             : 
     108             : void AliPHOSRecCpvManager::AG(Float_t ei, Float_t xi, Float_t yi, Float_t& ai, Float_t& gxi, Float_t& gyi )
     109             : {
     110             :   //Calculates amplitude (ai) and gradients (gxi, gyi) of CPV pad response.
     111             :   //Integrated response (total "shower energy") is e, 
     112             :   //xi and yi are the distances along x and y from reference point 
     113             :   // to the pad center.
     114             : 
     115           0 :   AliPHOSGeometry * geom =  AliPHOSGeometry::GetInstance() ;
     116             : 
     117           0 :   Float_t celZ = geom->GetPadSizeZ();
     118           0 :   Float_t celY = geom->GetPadSizePhi();
     119             : 
     120             : //  //    Info("AG", "celZ: %f celY: %f", celZ, celY) ;
     121             : 
     122           0 :   Float_t dx = celZ/2.;
     123           0 :   Float_t dy = celY/2.;
     124             : 
     125             : //  //    Float_t x = xi*celZ;
     126             : //  //    Float_t y = yi*celZ;
     127             : 
     128           0 :   Float_t x = xi*celZ;
     129           0 :   Float_t y = yi*celY;
     130             : 
     131             :   Float_t e = ei;
     132             : 
     133           0 :   Float_t a = Fcml(x+dx,y+dy) - Fcml(x+dx,y-dy) - Fcml(x-dx,y+dy) + Fcml(x-dx,y-dy);
     134           0 :   ai = a*e;
     135             : 
     136             : 
     137           0 :   Float_t gx = GradX(x+dx,y+dy) - GradX(x+dx,y-dy) - GradX(x-dx,y+dy) + GradX(x-dx,y-dy);
     138           0 :   gxi = gx*e*e;
     139             : 
     140           0 :   Float_t gy = GradY(x+dx,y+dy) - GradY(x+dx,y-dy) - GradY(x-dx,y+dy) + GradY(x-dx,y-dy);
     141           0 :   gyi = gy*e*e;
     142             : 
     143           0 : }
     144             : 
     145             : Float_t AliPHOSRecCpvManager::Fcml(Float_t x, Float_t y)
     146             : {
     147             :   //Cumulative function
     148             : 
     149             :   const Float_t ka = 1.0;
     150             :   const Float_t kb = 0.70;
     151             : 
     152           0 :   Float_t fff  = TMath::ATan(x*y/(  kb*TMath::Sqrt(  (kb*kb) + x*x+y*y)))
     153           0 :     - TMath::ATan(x*y/(3*kb*TMath::Sqrt((3*kb)*(3*kb) + x*x+y*y)))
     154           0 :     + TMath::ATan(x*y/(5*kb*TMath::Sqrt((5*kb)*(5*kb) + x*x+y*y))) 
     155           0 :     - TMath::ATan(x*y/(7*kb*TMath::Sqrt((7*kb)*(7*kb) + x*x+y*y)))
     156           0 :     + TMath::ATan(x*y/(9*kb*TMath::Sqrt((9*kb)*(9*kb) + x*x+y*y))); 
     157             :   
     158           0 :   Float_t fcml = ka*fff/TMath::TwoPi();
     159             : //    Info("Fcml", "fcml: %f", fcml) ;
     160           0 :   return fcml;
     161             : 
     162             : }
     163             : 
     164             : 
     165             : Float_t AliPHOSRecCpvManager::GradX(Float_t x, Float_t y)
     166             : {
     167             :   // Put a comment here
     168             : 
     169             :   const Float_t ka = 1.0;
     170             :   const Float_t kb = 0.70;
     171             : 
     172           0 :   Float_t skv      = kb*kb + x*x + y*y;
     173             : 
     174           0 :   Float_t sqskv=TMath::Sqrt(skv);
     175           0 :   Float_t yxskv=y*(1.-x/sqskv)*(1.+x/sqskv);
     176             :   
     177             :   Float_t gradient = 
     178           0 :       yxskv*  kb*sqskv/( kb*kb*skv+x*x*y*y)
     179           0 :     - yxskv*3*kb*sqskv/((3*kb)*(3*kb)*skv+x*x*y*y)
     180           0 :     + yxskv*5*kb*sqskv/((5*kb)*(5*kb)*skv+x*x*y*y)
     181           0 :     - yxskv*7*kb*sqskv/((7*kb)*(7*kb)*skv+x*x*y*y)
     182           0 :     + yxskv*9*kb*sqskv/((9*kb)*(9*kb)*skv+x*x*y*y);
     183             :       
     184           0 :   Float_t grad    = ka*gradient/TMath::TwoPi();
     185           0 :   return grad;
     186             : }
     187             : 
     188             : 
     189             : Float_t AliPHOSRecCpvManager::GradY(Float_t x, Float_t y)
     190             : {
     191             :   // Put a comment here
     192             :   
     193             :   const Float_t ka = 1.0;
     194             :   const Float_t kb = 0.70;
     195             :  
     196           0 :   Float_t skv      = kb*kb + x*x + y*y;
     197             : 
     198           0 :   Float_t sqskv=TMath::Sqrt(skv);
     199           0 :   Float_t xyskv=x*(1.-y/sqskv)*(1.+y/sqskv);
     200             : 
     201             :   Float_t gradient = 
     202           0 :       xyskv*  kb*sqskv/( kb*kb*skv+x*x*y*y)
     203           0 :     - xyskv*3*kb*sqskv/((3*kb)*(3*kb)*skv+x*x*y*y)
     204           0 :     + xyskv*5*kb*sqskv/((5*kb)*(5*kb)*skv+x*x*y*y)
     205           0 :     - xyskv*7*kb*sqskv/((7*kb)*(7*kb)*skv+x*x*y*y)
     206           0 :     + xyskv*9*kb*sqskv/((9*kb)*(9*kb)*skv+x*x*y*y);
     207             :   
     208           0 :   Float_t grad    = ka*gradient/TMath::TwoPi();
     209           0 :   return grad;
     210             : }
     211             : 
     212             : 

Generated by: LCOV version 1.11