LCOV - code coverage report
Current view: top level - STEER/STEERBase - AliTPCdEdxInfo.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 35 90 38.9 %
Date: 2016-06-14 17:26:59 Functions: 6 17 35.3 %

          Line data    Source code
       1             : 
       2             : //##################################################################
       3             : //
       4             : // Simple class to store TPC dE/dx info for different pad regions.
       5             : //
       6             : // Origin: Marian Ivanov, Alexander Kalweit 
       7             : //
       8             : //##################################################################
       9             : 
      10             : #include "AliTPCdEdxInfo.h"
      11             : #include "TObjArray.h"
      12             : #include "TGraphErrors.h"
      13             : #include "AliExternalTrackParam.h"
      14             : 
      15             : 
      16             : TObjArray * AliTPCdEdxInfo::fArraySectorCalibration=0;
      17             : 
      18         176 : ClassImp(AliTPCdEdxInfo)
      19             : 
      20             : AliTPCdEdxInfo::AliTPCdEdxInfo():
      21         520 :   TObject(),
      22         520 :   fTPCsignalRegion(),
      23         520 :   fTPCsignalRegionQmax(),
      24         520 :   fTPCsignalNRegion(),
      25         520 :   fTPCsignalNRowRegion()
      26        2600 : {
      27             :   // Default constructor
      28        4160 :   for (Int_t i=0;i<3; i++){
      29        1560 :     fTPCsignalRegion[i]=0;
      30        1560 :     fTPCsignalRegionQmax[i]=0;
      31        1560 :     fTPCsignalNRegion[i]=0;
      32        1560 :     fTPCsignalNRowRegion[i]=0;
      33             :   }
      34         520 :   fTPCsignalRegion[3]=0;
      35         520 :   fTPCsignalRegionQmax[3]=0;
      36             :   
      37        1040 : }
      38             : 
      39             : //_______________________________________________________________________________________________
      40             : AliTPCdEdxInfo::AliTPCdEdxInfo(const AliTPCdEdxInfo& source):
      41           0 :     TObject(),
      42           0 :     fTPCsignalRegion(),
      43           0 :     fTPCsignalRegionQmax(),
      44           0 :     fTPCsignalNRegion(),
      45           0 :     fTPCsignalNRowRegion()
      46           0 : {
      47             :     //
      48             :     // copy constructor
      49             :     //
      50           0 :     for (Int_t i=0;i<3; i++){
      51           0 :       fTPCsignalRegion[i]     = source.fTPCsignalRegion[i];
      52           0 :       fTPCsignalRegionQmax[i] = source.fTPCsignalRegionQmax[i];
      53           0 :       fTPCsignalNRegion[i]    = source.fTPCsignalNRegion[i];
      54           0 :       fTPCsignalNRowRegion[i] = source.fTPCsignalNRowRegion[i];
      55             :     }
      56           0 :     fTPCsignalRegion[3]       = source.fTPCsignalRegion[3];
      57           0 :     fTPCsignalRegionQmax[3]   = source.fTPCsignalRegionQmax[3];
      58             :     
      59           0 : }
      60             : 
      61             : //_______________________________________________________________________________________________
      62             : AliTPCdEdxInfo& AliTPCdEdxInfo::operator=(const AliTPCdEdxInfo& source)
      63             : {
      64             :     //
      65             :     // assignment operator
      66             :     //
      67             : 
      68         208 :   if (&source == this) return *this;
      69         104 :   TObject::operator=(source);
      70             : 
      71         832 :   for (Int_t i=0;i<3; i++){
      72         312 :     fTPCsignalRegion[i]     = source.fTPCsignalRegion[i];
      73         312 :     fTPCsignalRegionQmax[i] = source.fTPCsignalRegionQmax[i];
      74         312 :     fTPCsignalNRegion[i]    = source.fTPCsignalNRegion[i];
      75         312 :     fTPCsignalNRowRegion[i] = source.fTPCsignalNRowRegion[i];
      76             :   }
      77         104 :   fTPCsignalRegion[3]       = source.fTPCsignalRegion[3];
      78         104 :   fTPCsignalRegionQmax[3]   = source.fTPCsignalRegionQmax[3];
      79             :   
      80         104 :   return *this;
      81             : 
      82         104 : }
      83             : 
      84             : //_______________________________________________________________________________________________
      85             : void  AliTPCdEdxInfo::GetTPCSignalRegionInfo(Double_t signal[4], Char_t ncl[3], Char_t nrows[3]) const {
      86             :   //
      87             :   // Get the TPC dEdx variables per region
      88             :   //
      89             :   // Double32_t  fTPCsignalRegion[4]; // TPC dEdx signal in 4 different regions - 0 - IROC, 1- OROC medium, 2 - OROC long, 3- OROC all, (default truncation used)  
      90             :   // Char_t      fTPCsignalNRegion[3]; // number of clusters above threshold used in the dEdx calculation
      91             :   // Char_t      fTPCsignalNRowRegion[3]; // number of crosed rows used in the dEdx calculation - signal below threshold included
      92             :   //
      93           0 :   for (Int_t i=0; i<3; i++){
      94           0 :     signal[i]=fTPCsignalRegion[i];
      95           0 :     ncl[i]=fTPCsignalNRegion[i];
      96           0 :     nrows[i]=fTPCsignalNRowRegion[i];
      97             :   }
      98           0 :   signal[3]=fTPCsignalRegion[3];
      99           0 :   return; 
     100             : }
     101             : 
     102             : //_______________________________________________________________________________________________
     103             : void  AliTPCdEdxInfo::GetTPCSignals(Double_t signal[4]) const {
     104             :   //
     105             :   // Set the TPC dEdx variables per region
     106             :   //
     107             :   // Double32_t  fTPCsignalRegionQmax[4]; // TPC dEdx signal in 4 different regions - 0 - IROC, 1- OROC medium, 2 - OROC long, 3- OROC all, (default truncation used)
     108             :   //
     109           0 :   for (Int_t i=0;i<4; i++){
     110           0 :     signal[i]=fTPCsignalRegion[i];
     111             :   }
     112           0 : }
     113             : 
     114             : //_______________________________________________________________________________________________
     115             : void  AliTPCdEdxInfo::SetTPCSignalRegionInfo(Double_t signal[4], Char_t ncl[3], Char_t nrows[3]){
     116             :   //
     117             :   // Set the TPC dEdx variables per region
     118             :   //
     119             :   // Double32_t  fTPCsignalRegion[4]; // TPC dEdx signal in 4 different regions - 0 - IROC, 1- OROC medium, 2 - OROC long, 3- OROC all, (default truncation used)  
     120             :   // Char_t      fTPCsignalNRegion[3]; // number of clusters above threshold used in the dEdx calculation
     121             :   // Char_t      fTPCsignalNRowRegion[3]; // number of crosed rows used in the dEdx calculation - signal below threshold included
     122             :   //
     123        1224 :   for (Int_t i=0;i<3; i++){
     124         408 :     fTPCsignalRegion[i]=signal[i];
     125         408 :     fTPCsignalNRegion[i]=ncl[i];
     126         408 :     fTPCsignalNRowRegion[i]=nrows[i];
     127             :   }
     128         136 :   fTPCsignalRegion[3]=signal[3];
     129         136 :   return;
     130             : }
     131             : 
     132             : //_______________________________________________________________________________________________
     133             : void  AliTPCdEdxInfo::SetTPCSignals(Double_t signal[4]){
     134             :   //
     135             :   // Set the TPC dEdx variables per region
     136             :   //
     137             :   // Double32_t  fTPCsignalRegionQmax[4]; // TPC dEdx signal in 4 different regions - 0 - IROC, 1- OROC medium, 2 - OROC long, 3- OROC all, (default truncation used)
     138             :   //
     139           0 :   for (Int_t i=0;i<4; i++){
     140           0 :     fTPCsignalRegion[i]=signal[i];
     141             :   }
     142           0 : }
     143             : 
     144             : //_______________________________________________________________________________________________
     145             : void  AliTPCdEdxInfo::GetTPCSignalRegionInfoQmax(Double_t signal[4], Char_t ncl[3], Char_t nrows[3]) const {
     146             :   //
     147             :   // Get the TPC dEdx variables per region
     148             :   //
     149             :   // Double32_t  fTPCsignalRegionQmax[4]; // TPC dEdx signal in 4 different regions - 0 - IROC, 1- OROC medium, 2 - OROC long, 3- OROC all, (default truncation used)
     150             :   // Char_t      fTPCsignalNRegion[3]; // number of clusters above threshold used in the dEdx calculation
     151             :   // Char_t      fTPCsignalNRowRegion[3]; // number of crosed rows used in the dEdx calculation - signal below threshold included
     152             :   //
     153           0 :   for (Int_t i=0; i<3; i++){
     154           0 :     signal[i]=fTPCsignalRegionQmax[i];
     155           0 :     ncl[i]=fTPCsignalNRegion[i];
     156           0 :     nrows[i]=fTPCsignalNRowRegion[i];
     157             :   }
     158           0 :   signal[3]=fTPCsignalRegionQmax[3];
     159           0 :   return;
     160             : }
     161             : 
     162             : //_______________________________________________________________________________________________
     163             : void  AliTPCdEdxInfo::GetTPCSignalsQmax(Double_t signal[4]) const {
     164             :   //
     165             :   // Set the TPC dEdx variables per region
     166             :   //
     167             :   // Double32_t  fTPCsignalRegionQmax[4]; // TPC dEdx signal in 4 different regions - 0 - IROC, 1- OROC medium, 2 - OROC long, 3- OROC all, (default truncation used)
     168             :   //
     169           0 :   for (Int_t i=0;i<4; i++){
     170           0 :     signal[i]=fTPCsignalRegionQmax[i];
     171             :   }
     172           0 : }
     173             : 
     174             : //_______________________________________________________________________________________________
     175             : void  AliTPCdEdxInfo::SetTPCSignalRegionInfoQmax(Double_t signal[4], Char_t ncl[3], Char_t nrows[3]){
     176             :   //
     177             :   // Set the TPC dEdx variables per region
     178             :   //
     179             :   // Double32_t  fTPCsignalRegionQmax[4]; // TPC dEdx signal in 4 different regions - 0 - IROC, 1- OROC medium, 2 - OROC long, 3- OROC all, (default truncation used)
     180             :   // Char_t      fTPCsignalNRegion[3]; // number of clusters above threshold used in the dEdx calculation
     181             :   // Char_t      fTPCsignalNRowRegion[3]; // number of crosed rows used in the dEdx calculation - signal below threshold included
     182             :   //
     183           0 :   for (Int_t i=0;i<3; i++){
     184           0 :     fTPCsignalRegionQmax[i]=signal[i];
     185           0 :     fTPCsignalNRegion[i]=ncl[i];
     186           0 :     fTPCsignalNRowRegion[i]=nrows[i];
     187             :   }
     188           0 :   fTPCsignalRegionQmax[3]=signal[3];
     189           0 :   return;
     190             : }
     191             : 
     192             : //_______________________________________________________________________________________________
     193             : void  AliTPCdEdxInfo::SetTPCSignalsQmax(Double_t signal[4]){
     194             :   //
     195             :   // Set the TPC dEdx variables per region
     196             :   //
     197             :   // Double32_t  fTPCsignalRegionQmax[4]; // TPC dEdx signal in 4 different regions - 0 - IROC, 1- OROC medium, 2 - OROC long, 3- OROC all, (default truncation used)
     198             :   //
     199        1496 :   for (Int_t i=0;i<4; i++){
     200         544 :     fTPCsignalRegionQmax[i]=signal[i];
     201             :   }
     202         136 : }
     203             : 
     204             : 
     205             : Double_t AliTPCdEdxInfo::GetWeightedMean(Int_t qType, Int_t wType, Double_t w0, Double_t w1, Double_t w2) const
     206             : {
     207             :   //
     208             :   // Get weighted mean of the dEdx information
     209             :   //
     210           0 :   const Double_t *info = (qType==0)? fTPCsignalRegion :  fTPCsignalRegionQmax;
     211           0 :   const Char_t *ninfo = (wType==0)? fTPCsignalNRegion:  fTPCsignalNRowRegion;
     212           0 :   Double_t weight[3]={w0,w1,w2};
     213             :   Double_t sum=0;
     214             :   Double_t sumw=0;
     215           0 :   for (Int_t i=0; i<3; i++){
     216           0 :     sum+= info[i]*Double_t(ninfo[i])*weight[i];
     217           0 :     sumw+= ninfo[i]*weight[i];
     218             :   }
     219           0 :   Double_t result = (sumw>0) ? sum/sumw:0;
     220           0 :   return result;
     221           0 : }
     222             : 
     223             : //
     224             : // Apply second order calibration  of the dEdx
     225             : //
     226             : 
     227             : void  AliTPCdEdxInfo::RegisterSectorCalibration(TGraphErrors* gainSector, Int_t regionID, Int_t calibID){
     228             :   //
     229             :   // Register sector calibration
     230             :   //
     231             :   // create if arrray does not exist
     232           0 :   if (!fArraySectorCalibration) fArraySectorCalibration= new TObjArray((calibID+1)*3*10); // boook space for calibration pointer
     233             :   // resize if not enough booked
     234           0 :   if (fArraySectorCalibration->GetSize()<(calibID+1)*3) fArraySectorCalibration->Expand((calibID+1)*3);
     235             :   //
     236           0 :   fArraySectorCalibration->AddAt(gainSector, 3*calibID+regionID);
     237           0 : }
     238             : 
     239             : // Double_t AliTPCdEdxInfo::GetNormalizeddEdx(AliExternalTrackParam *param, Double_t bz,  Int_t regionID, Int_t calibID, Int_t qID){
     240             : //   //
     241             : //   //
     242             : //   // 
     243             : //   static AliTPCParamSR paramSR;
     244             : //   static Double_t radius[3] ={0.5*(paramSR.GetInnerRadiusLow()+paramSR.GetInnerRadiusUp()),
     245             : //                            0.5*(paramSR.GetPadRowRadii(36,0)+paramSR.GetPadRowRadii(36,paramSR.GetNRowUp1()-1)),
     246             : //                            0.5*(paramSR.GetPadRowRadii(36,0)+paramSR.GetPadRowRadii(36,paramSR.GetNRowUp()-1))};
     247             : //   Double_t phi= param->GetParameterAtRadius(radius[regionID],bz,7);
     248             : 
     249             : //   TGraphErrors * graphSectorCorection = fArraySectorCalibration->At(regionID+3*calibID);
     250             : //   Double_t dEdx = 0;
     251             : //   if (qID==0) dEdx = fTPCsignalRegion[regionID];
     252             : //   if (qID==1) dEdx = fTPCsignalRegionQmax[regionID];
     253             : //   if (graphSectorCorection) dEdx /=graphSectorCorection->EvalAt(sector);
     254             : //   return dEdx;
     255             : // }
     256             : 
     257             : 
     258             : 
     259             : Double_t   AliTPCdEdxInfo::GetdEdxInfo(AliExternalTrackParam *param, Int_t regionID, Int_t calibID, Int_t qID, Int_t valueID){
     260             :   //
     261             :   //
     262             :   //
     263             : 
     264           0 :   return param->GetParameter()[regionID];
     265             : }
     266             : 
     267             : 

Generated by: LCOV version 1.11