]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Coding rules
authorcblume <cblume@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 5 Aug 2009 16:31:44 +0000 (16:31 +0000)
committercblume <cblume@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 5 Aug 2009 16:31:44 +0000 (16:31 +0000)
22 files changed:
TRD/AliTRDCalibraFillHisto.cxx
TRD/AliTRDrawStream.cxx
TRD/AliTRDsimTR.cxx
TRD/AliTRDsimTR.h
TRD/AliTRDv1.cxx
TRD/Cal/AliTRDCalChamberStatus.h
TRD/Cal/AliTRDCalDCS.cxx
TRD/Cal/AliTRDCalDCS.h
TRD/Cal/AliTRDCalDCSFEE.cxx
TRD/Cal/AliTRDCalDCSFEE.h
TRD/Cal/AliTRDCalDCSGTU.h
TRD/Cal/AliTRDCalDCSPTR.h
TRD/Cal/AliTRDCalDet.cxx
TRD/Cal/AliTRDCalDet.h
TRD/Cal/AliTRDCalFEE.h
TRD/Cal/AliTRDCalMonitoring.h
TRD/Cal/AliTRDCalPID.cxx
TRD/Cal/AliTRDCalPID.h
TRD/Cal/AliTRDCalPIDLQ.cxx
TRD/Cal/AliTRDCalPIDLQ.h
TRD/Cal/AliTRDCalPIDNN.cxx
TRD/Cal/AliTRDCalPIDNN.h

index 0b3ff3c7a83132c4a996a52fc031a1c23fe340a7..f41194fdb32d124bd1dfd2f2873423eb53183a1d 100644 (file)
@@ -1137,8 +1137,8 @@ Bool_t AliTRDCalibraFillHisto::HandlePRFtracklet(AliTRDtrack *t, Int_t index0, I
   for(Int_t k = 0;  k < npoints; k++){
     //Take the cluster
     AliTRDcluster *cl      = (AliTRDcluster *) t->GetCluster(k+index0);
-    Short_t  *signals      = cl->GetSignals();              // signal
-    Double_t     time      = cl->GetPadTime();              // time bin
+    Short_t *signals       = cl->GetSignals();              // signal
+    Double_t time          = cl->GetPadTime();              // time bin
     Float_t padPosTracklet = line[0]+line[1]*time;          // reconstruct position from fit
     Float_t padPos         = cl->GetPadCol();               // middle pad
     Double_t dpad          = padPosTracklet - padPos;       // reconstruct position relative to middle pad from fit 
index 3412f8aac85677be82e4f2945c80ca44647f0486..11d1843ac376e0fb5c36f542b45bdd0016ed7b32 100644 (file)
@@ -780,6 +780,7 @@ AliTRDrawStream::NextChamber(AliTRDdigitsManager *const digitsManager, UInt_t **
           } \r
         } \r
 \r
+\r
       if (det != lastdet) \r
   { \r
     // If new detector found\r
index a1a4a7a899bc4dcdc0c98d2903a18f70bcd120be..f34dacaec9540f12979c6b7b82d763b867f656c8 100644 (file)
 //                                                                        //
 ////////////////////////////////////////////////////////////////////////////
 
-#include <stdlib.h>
-
 #include <TH1.h>
 #include <TRandom.h>
 #include <TMath.h>
-#include <TParticle.h>
 #include <TVirtualMC.h>
 #include <TVirtualMCStack.h>
 
 #include "AliModule.h"
-#include "AliLog.h"
-#include "AliMC.h"
 
 #include "AliTRDsimTR.h"
 
@@ -945,7 +940,9 @@ Double_t AliTRDsimTR::GetMuAi(Double_t energyMeV)
 
 //_____________________________________________________________________________
 Double_t AliTRDsimTR::Interpolate(Double_t energyMeV
-                              , Double_t *en, Double_t *mu, Int_t n)
+                                , Double_t *en
+                                , const Double_t * const mu
+                                , Int_t n)
 {
   //
   // Interpolates the photon absorbtion cross section 
@@ -967,7 +964,7 @@ Double_t AliTRDsimTR::Interpolate(Double_t energyMeV
 
 //_____________________________________________________________________________
 Int_t AliTRDsimTR::Locate(Double_t *xv, Int_t n, Double_t xval
-                      , Int_t &kl, Double_t &dx) 
+                        , Int_t &kl, Double_t &dx) 
 {
   //
   // Locates a point (xval) in a 1-dim grid (xv(n))
index a0b8b9c0d491d99a8b30941d07da6012255ea958..6c2e33ae47dddc4bd987fa034c02f92c078afc08 100644 (file)
@@ -36,7 +36,7 @@ class AliTRDsimTR : public TObject {
                            , Int_t &nPhoton, Float_t *ePhoton);
   virtual Double_t Sigma(Double_t energykeV);
   virtual Double_t Interpolate(Double_t energyMeV
-                             , Double_t *en, Double_t *mu, Int_t n);
+                             , Double_t *en, const Double_t * const mu, Int_t n);
   virtual Int_t    Locate(Double_t *xv, Int_t n, Double_t xval
                         , Int_t &kl, Double_t &dx);
   virtual Double_t Omega(Float_t rho, Float_t z, Float_t a)  { return (28.8 * TMath::Sqrt(rho * z / a)); };
index 9d16f949b1c2d39c21894f341992c433b2a8c73a..fcfa91679c88a2186c3ea9fddb7278c9fd71c85a 100644 (file)
 //                                                                        //
 ////////////////////////////////////////////////////////////////////////////
 
-#include <stdlib.h> 
-
 #include <TLorentzVector.h>
 #include <TMath.h>
 #include <TRandom.h>
-#include <TVector.h>
 #include <TVirtualMC.h>
 #include <TGeoManager.h>
 #include <TGeoMatrix.h>
 #include <TGeoPhysicalNode.h>
 
-#include "AliConst.h"
-#include "AliLog.h"
 #include "AliTrackReference.h"
 #include "AliMC.h"
 #include "AliRun.h"
@@ -41,7 +36,6 @@
 
 #include "AliTRDgeometry.h"
 #include "AliTRDCommonParam.h"
-#include "AliTRDhit.h"
 #include "AliTRDsimTR.h"
 #include "AliTRDv1.h"
 
index 2ac1cdae9d2bf158e3a21b0bf94b01442d36fc52..4435b15ccdd923f2aafc5f050cdbdc39272ee8ef 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef AliTRDCalChamberStatus_H
-#define AliTRDCalChamberStatus_H
+#ifndef ALITRDCalChamberStatus_H
+#define ALITRDCalChamberStatus_H
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  * See cxx source for full Copyright notice                               */
 
index a236c0e7dea26a876a75d0e7fb96b1c63b29b5d0..c313d099c767f88bb950f4f90d0ff686ab6da59b 100644 (file)
@@ -131,6 +131,10 @@ AliTRDCalDCS &AliTRDCalDCS::operator=(const AliTRDCalDCS &cd)
 //_____________________________________________________________________________
 void AliTRDCalDCS::EvaluateGlobalParameters()
 {
+  //
+  // Do an evaluation of all global parameters
+  //
+
   for(Int_t i=0; i<540; i++) {
     AliTRDCalDCSFEE *iDCSFEEObj;
     iDCSFEEObj = GetCalDCSFEEObj(i);
index a84f7755905b542d997716c93a2187a52a37c2f7..496d343a91afa7aa178df9dc508730dd3b3f94bf 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef AliTRDCALDCS_H
-#define AliTRDCALDCS_H
+#ifndef ALITRDCALDCS_H
+#define ALITRDCALDCS_H
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  * See cxx source for full Copyright notice                               */
 
@@ -31,9 +31,9 @@ class AliTRDCalDCS : public TNamed {
   virtual ~AliTRDCalDCS() { };
 
   void    EvaluateGlobalParameters();
-  void    SetFEEArr(TObjArray *fa)             { fFEEArr              = fa;    }
-  void    SetPTRArr(TObjArray *pa)             { fPTRArr              = pa;    }
-  void    SetGTUArr(TObjArray *ga)             { fGTUArr              = ga;    }
+  void    SetFEEArr(TObjArray * const fa)      { fFEEArr              = fa;    }
+  void    SetPTRArr(TObjArray * const pa)      { fPTRArr              = pa;    }
+  void    SetGTUArr(TObjArray * const ga)      { fGTUArr              = ga;    }
   
   Int_t   GetGlobalNumberOfTimeBins() const    { return fGNumberOfTimeBins;    }
   Int_t   GetGlobalConfigTag() const           { return fGConfigTag;           }
index e335a0f4c19e5de2eee8a5ab1b06057f02336406..bde523091e4ac9cd5c167b928e2ee5783e285f5c 100644 (file)
@@ -63,8 +63,8 @@ AliTRDCalDCSFEE::AliTRDCalDCSFEE()
   //\r
   // AliTRDCalDCSFEE default constructor\r
   //\r
-  for(Int_t i=0; i<nROB; i++) {\r
-    for(Int_t j=0; j<nMCM; j++) {\r
+  for(Int_t i=0; i<fgkROB; i++) {\r
+    for(Int_t j=0; j<fgkMCM; j++) {\r
       fRStateGSM[i][j]  = -1;\r
       fRStateNI[i][j]   = -1;\r
       fRStateEV[i][j]   = -1;\r
@@ -104,8 +104,8 @@ AliTRDCalDCSFEE::AliTRDCalDCSFEE(const char *name, const char *title)
   //\r
   // AliTRDCalDCSFEE constructor\r
   //\r
-  for(Int_t i=0; i<nROB; i++) {\r
-    for(Int_t j=0; j<nMCM; j++) {\r
+  for(Int_t i=0; i<fgkROB; i++) {\r
+    for(Int_t j=0; j<fgkMCM; j++) {\r
       fRStateGSM[i][j]  = -1;\r
       fRStateNI[i][j]   = -1;\r
       fRStateEV[i][j]   = -1;\r
index 35208842bebe492de23a02dd9dc25345c030a6eb..248e90889556e938dad8e7d3ae27a64e083e4798 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef AliTRDCALDCSFEE_H\r
-#define AliTRDCALDCSFEE_H\r
+#ifndef ALITRDCALDCSFEE_H\r
+#define ALITRDCALDCSFEE_H\r
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *\r
  * See cxx source for full Copyright notice                               */\r
 \r
@@ -80,37 +80,38 @@ class AliTRDCalDCSFEE : public TNamed {
   Int_t   GetMCMPtCnt(Int_t r,Int_t m) const         { return fRStatePTRG[r][m];     }\r
 \r
  protected:\r
-  static const Int_t nROB = 8;\r
-  static const Int_t nMCM = 18;\r
+\r
+  static const Int_t fgkROB = 8;       // Number of readout boards\r
+  static const Int_t fgkMCM = 18;      // Number of MCMs\r
   \r
-  Int_t   fStatusBit;              // 0 if everything is OK, otherwise !=0 (see impl. file)\r
-  Int_t   fDCSID;                  // ID of the DCS-Board\r
-  Int_t   fSM;                     // the number of the supermode 0..17\r
-  Int_t   fStack;                  // the number of the stack 0..4\r
-  Int_t   fLayer;                  // the number of the layer 0..5\r
-  Int_t   fNumberOfTimeBins;       // Number of timebins  \r
-  Int_t   fConfigTag;              // Configuration tag\r
-  Int_t   fSingleHitThres;         // threshold of single hits (arg of readout param)\r
-  Int_t   fThrPdClsThres;          // threshold of 3-pad clusters (arg of readout param)\r
-  Int_t   fSelNoZS;                // write every fSelNoZS'th event without ZS\r
-  Int_t   fTCFilterWeight;         // tail cancellation filter weight\r
-  Int_t   fTCFilterShortDecPar;    // tail cancellation filter short decay parameter\r
-  Int_t   fTCFilterLongDecPar;     // tail cancellation filter long decay parameter\r
-  Int_t   fFastStatNoise;          // collect statistics for fast noise mode\r
-  Int_t   fRStateGSM[nROB][nMCM];  // array of the global states of the MCMs\r
-  Int_t   fRStateNI[nROB][nMCM];   // array of the network interface states of the MCMs\r
-  Int_t   fRStateEV[nROB][nMCM];   // array of the event counters of the MCMs\r
-  Int_t   fRStatePTRG[nROB][nMCM]; // array of the pretrigger counters of the MCMs\r
-  TString fFilterType;             // filter type (p, pgt, nf)\r
-  TString fReadoutParam;           // readout parameter (zs, nozs, testpattern)\r
-  TString fTestPattern;            // value of testpattern (for readout param)\r
-  TString fTrackletMode;           // tracklet mode (trk, csmtrk, notrk)\r
-  TString fTrackletDef;            // definition for tracklet mode trk\r
-  TString fTriggerSetup;           // trigger setup (ptrg, autotrg, autol0)\r
-  TString fAddOptions;             // additional options (nopm, nion)\r
-  TString fConfigName;             // Configuration name\r
-  TString fConfigVersion;          // Configuration version\r
+  Int_t   fStatusBit;                  // 0 if everything is OK, otherwise !=0 (see impl. file)\r
+  Int_t   fDCSID;                      // ID of the DCS-Board\r
+  Int_t   fSM;                         // the number of the supermode 0..17\r
+  Int_t   fStack;                      // the number of the stack 0..4\r
+  Int_t   fLayer;                      // the number of the layer 0..5\r
+  Int_t   fNumberOfTimeBins;           // Number of timebins  \r
+  Int_t   fConfigTag;                  // Configuration tag\r
+  Int_t   fSingleHitThres;             // threshold of single hits (arg of readout param)\r
+  Int_t   fThrPdClsThres;              // threshold of 3-pad clusters (arg of readout param)\r
+  Int_t   fSelNoZS;                    // write every fSelNoZS'th event without ZS\r
+  Int_t   fTCFilterWeight;             // tail cancellation filter weight\r
+  Int_t   fTCFilterShortDecPar;        // tail cancellation filter short decay parameter\r
+  Int_t   fTCFilterLongDecPar;         // tail cancellation filter long decay parameter\r
+  Int_t   fFastStatNoise;              // collect statistics for fast noise mode\r
+  Int_t   fRStateGSM[fgkROB][fgkMCM];  // array of the global states of the MCMs\r
+  Int_t   fRStateNI[fgkROB][fgkMCM];   // array of the network interface states of the MCMs\r
+  Int_t   fRStateEV[fgkROB][fgkMCM];   // array of the event counters of the MCMs\r
+  Int_t   fRStatePTRG[fgkROB][fgkMCM]; // array of the pretrigger counters of the MCMs\r
+  TString fFilterType;                 // filter type (p, pgt, nf)\r
+  TString fReadoutParam;               // readout parameter (zs, nozs, testpattern)\r
+  TString fTestPattern;                // value of testpattern (for readout param)\r
+  TString fTrackletMode;               // tracklet mode (trk, csmtrk, notrk)\r
+  TString fTrackletDef;                // definition for tracklet mode trk\r
+  TString fTriggerSetup;               // trigger setup (ptrg, autotrg, autol0)\r
+  TString fAddOptions;                 // additional options (nopm, nion)\r
+  TString fConfigName;                 // Configuration name\r
+  TString fConfigVersion;              // Configuration version\r
 \r
-  ClassDef(AliTRDCalDCSFEE,3)      // TRD calibration class for TRD FEE parameters\r
+  ClassDef(AliTRDCalDCSFEE,3)          // TRD calibration class for TRD FEE parameters\r
 };\r
 #endif\r
index cce7164befa8b2b751f97febbde6e358da895f00..7c075950056ae442f9f45ebbf1e9594b194bd1b0 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef AliTRDCALDCSGTU_H
-#define AliTRDCALDCSGTU_H
+#ifndef ALITRDCALDCSGTU_H
+#define ALITRDCALDCSGTU_H
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  * See cxx source for full Copyright notice                               */
 
index 56bffde640e25c587f4113d56445b13440fe5944..f8957b9a4be7d708a0569ca2bebebca763bd2215 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef AliTRDCALDCSPTR_H
-#define AliTRDCALDCSPTR_H
+#ifndef ALITRDCALDCSPTR_H
+#define ALITRDCALDCSPTR_H
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  * See cxx source for full Copyright notice                               */
 
index a3b098743cf8216605f98a317d1c7f895b38e612..f0ac79c5c04e02c81047fe431d49ada8c44e5bcb 100644 (file)
@@ -108,7 +108,7 @@ void AliTRDCalDet::Copy(TObject &c) const
 }
 
 //___________________________________________________________________________________
-Double_t AliTRDCalDet::GetMean(AliTRDCalDet* outlierDet) 
+Double_t AliTRDCalDet::GetMean(AliTRDCalDet * const outlierDet) const
 {
   //
   // Calculate the mean
@@ -116,20 +116,20 @@ Double_t AliTRDCalDet::GetMean(AliTRDCalDet* outlierDet)
 
   if (!outlierDet) return TMath::Mean(kNdet,fData);
   Double_t *ddata = new Double_t[kNdet];
-  Int_t NPoints = 0;
+  Int_t nPoints = 0;
   for (Int_t i=0;i<kNdet;i++) {
     if (!(outlierDet->GetValue(i))) {
-      ddata[NPoints]= fData[NPoints];
-      NPoints++;
+      ddata[nPoints]= fData[nPoints];
+      nPoints++;
     }
   }
-  Double_t mean = TMath::Mean(NPoints,ddata);
+  Double_t mean = TMath::Mean(nPoints,ddata);
   delete [] ddata;
   return mean;
 }
 
 //_______________________________________________________________________________________
-Double_t AliTRDCalDet::GetMedian(AliTRDCalDet* outlierDet) 
+Double_t AliTRDCalDet::GetMedian(AliTRDCalDet * const outlierDet) const
 {
   //
   // Calculate the median
@@ -137,21 +137,21 @@ Double_t AliTRDCalDet::GetMedian(AliTRDCalDet* outlierDet)
 
   if (!outlierDet) return (Double_t) TMath::Median(kNdet,fData);
   Double_t *ddata = new Double_t[kNdet];
-  Int_t NPoints = 0;
+  Int_t nPoints = 0;
   for (Int_t i=0;i<kNdet;i++) {
     if (!(outlierDet->GetValue(i))) {
-      ddata[NPoints]= fData[NPoints];
-      NPoints++;
+      ddata[nPoints]= fData[nPoints];
+      nPoints++;
     }
   }
-  Double_t mean = TMath::Median(NPoints,ddata);
+  Double_t mean = TMath::Median(nPoints,ddata);
   delete [] ddata;
   return mean;
 
 }
 
 //____________________________________________________________________________________________
-Double_t AliTRDCalDet::GetRMS(AliTRDCalDet* outlierDet) 
+Double_t AliTRDCalDet::GetRMS(AliTRDCalDet * const outlierDet) const
 {
   //
   // Calculate the RMS
@@ -159,20 +159,22 @@ Double_t AliTRDCalDet::GetRMS(AliTRDCalDet* outlierDet)
 
   if (!outlierDet) return TMath::RMS(kNdet,fData);
   Double_t *ddata = new Double_t[kNdet];
-  Int_t NPoints = 0;
+  Int_t nPoints = 0;
   for (Int_t i=0;i<kNdet;i++) {
     if (!(outlierDet->GetValue(i))) {
-      ddata[NPoints]= fData[NPoints];
-      NPoints++;
+      ddata[nPoints]= fData[nPoints];
+      nPoints++;
     }
   }
-  Double_t mean = TMath::RMS(NPoints,ddata);
+  Double_t mean = TMath::RMS(nPoints,ddata);
   delete [] ddata;
   return mean;
 }
 
 //______________________________________________________________________________________________
-Double_t AliTRDCalDet::GetLTM(Double_t *sigma, Double_t fraction, AliTRDCalDet* outlierDet)
+Double_t AliTRDCalDet::GetLTM(Double_t *sigma
+                            , Double_t fraction
+                            , AliTRDCalDet * const outlierDet)
 {
   //
   //  Calculate LTM mean and sigma
@@ -180,15 +182,15 @@ Double_t AliTRDCalDet::GetLTM(Double_t *sigma, Double_t fraction, AliTRDCalDet*
 
   Double_t *ddata = new Double_t[kNdet];
   Double_t mean=0, lsigma=0;
-  UInt_t NPoints = 0;
+  UInt_t nPoints = 0;
   for (Int_t i=0;i<kNdet;i++) {
      if (!outlierDet || !(outlierDet->GetValue(i))) {
-        ddata[NPoints]= fData[NPoints];
-        NPoints++;
+        ddata[nPoints]= fData[nPoints];
+        nPoints++;
      }
   }
-  Int_t hh = TMath::Min(TMath::Nint(fraction *NPoints), Int_t(NPoints));
-  AliMathBase::EvaluateUni(NPoints,ddata, mean, lsigma, hh);
+  Int_t hh = TMath::Min(TMath::Nint(fraction *nPoints), Int_t(nPoints));
+  AliMathBase::EvaluateUni(nPoints,ddata, mean, lsigma, hh);
   if (sigma) *sigma=lsigma;
   delete [] ddata;
   return mean;
index a1542d0b65d14b7b3526cfba1f4f2cb13a435a38..49bf8e97d91cd057398169b6f949531dbaff2586 100644 (file)
@@ -12,7 +12,7 @@
 ///////////////////////////////////////////////////////////////////////////////
 
 #include "TNamed.h"
-#include "TMath.h"
+
 #include "../AliTRDgeometry.h"
 
 class TH1F;
@@ -41,10 +41,10 @@ class AliTRDCalDet : public TNamed {
                                                  { fData[AliTRDgeometry::GetDetector(p,c,s)] = value; };
 
   // statistic
-  Double_t GetMean(AliTRDCalDet *outlierDet=0);
-  Double_t GetRMS(AliTRDCalDet *outlierDet=0);
-  Double_t GetMedian(AliTRDCalDet *outlierDet=0);
-  Double_t GetLTM(Double_t *sigma=0, Double_t fraction=0.9, AliTRDCalDet *outlierDet=0);     
+  Double_t GetMean(AliTRDCalDet * const outlierDet=0) const;
+  Double_t GetRMS(AliTRDCalDet * const outlierDet=0) const;
+  Double_t GetMedian(AliTRDCalDet * const outlierDet=0) const;
+  Double_t GetLTM(Double_t * sigma=0, Double_t fraction=0.9, AliTRDCalDet * const outlierDet=0);     
 
   // Plot functions
   TH1F * MakeHisto1Distribution(Float_t min=4, Float_t max=-4, Int_t type=0);     
index 830267087d902522610177b6100969dc82dd6c89..3609d214015c3bfbffbe785bc7fdf93226a43d57 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef AliTRDCALFEE_H
-#define AliTRDCALFEE_H
+#ifndef ALITRDCALFEE_H
+#define ALITRDCALFEE_H
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  * See cxx source for full Copyright notice                               */
 
index 924c95c499d2f525630646b4dc73b0d31ef01727..2130b62617e241790d8f9987e05b620ad1aa17de 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef AliTRDCALMONITORING_H
-#define AliTRDCALMONITORING_H
+#ifndef ALITRDCALMONITORING_H
+#define ALITRDCALMONITORING_H
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  * See cxx source for full Copyright notice                               */
 
index 100faecb6d20072b0bd2c427955029bf4b321767..383ea91e989b22f111391959dd3881e2c556e76a 100644 (file)
 //                                                                      //
 //////////////////////////////////////////////////////////////////////////
 
-#include <TH1F.h>
-#include <TH2F.h>
-#include <TFile.h>
-#include <TROOT.h>
-
-#include "AliLog.h"
-#include "AliESD.h"
-#include "AliESDtrack.h"
+#include <TObjArray.h>
 
 #include "AliTRDCalPID.h"
-#include "AliTRDcalibDB.h"
 
 ClassImp(AliTRDCalPID)
 
-const Char_t* AliTRDCalPID::fPartName[AliPID::kSPECIES] = { "electron", "muon", "pion", "kaon", "proton"};
-const Char_t* AliTRDCalPID::fPartSymb[AliPID::kSPECIES] = { "EL", "MU", "PI", "KA", "PR"};
-Color_t AliTRDCalPID::fPartColor[AliPID::kSPECIES] = { kRed, kGreen, kBlue, kYellow, kMagenta};
-Float_t AliTRDCalPID::fTrackMomentum[kNMom]       = {  
-    0.6,  0.8,  1.0,  1.5,  2.0
-   ,3.0,  4.0,  5.0,  6.0,  8.0, 10.0};
-Float_t AliTRDCalPID::fTrackMomentumBinning[kNMom+1]       = {  
-    0.5,  0.7,  0.9,  1.25, 1.75, 2.5,  
-    3.5,  4.5,  5.5,  7.0,  9.0, 12.0};
+const Char_t* AliTRDCalPID::fPartName[AliPID::kSPECIES]     = { "electron", "muon", "pion", "kaon", "proton"};
+const Char_t* AliTRDCalPID::fPartSymb[AliPID::kSPECIES]     = { "EL", "MU", "PI", "KA", "PR"};
+Color_t       AliTRDCalPID::fgPartColor[AliPID::kSPECIES]   = { kRed, kGreen, kBlue, kYellow, kMagenta};
+Float_t       AliTRDCalPID::fgTrackMomentum[kNMom]          = {   0.6,   0.8,   1.0,   1.5,   2.0
+                                                              ,   3.0,   4.0,   5.0,   6.0,   8.0,  10.0  };
+Float_t       AliTRDCalPID::fgTrackMomentumBinning[kNMom+1] = {   0.5,   0.7,   0.9,   1.25,  1.75,  2.5
+                                                             ,   3.5,   4.5,   5.5,   7.0,   9.0,  12.0  };
 
 //_________________________________________________________________________
 AliTRDCalPID::AliTRDCalPID()
@@ -87,6 +77,10 @@ AliTRDCalPID::~AliTRDCalPID()
 //_________________________________________________________________________
 Int_t AliTRDCalPID::GetPartIndex(Int_t pdg)
 {
+  //
+  // Return the index to a given particle, defined by its PDG code
+  //
+
   for(Int_t is=0; is<AliPID::kSPECIES; is++){
     if(TMath::Abs(pdg) == AliPID::ParticleCode(is)) return is;
   }
index 88530ffd6c2bd39a97f05197a049bdc06f58883a..e7c82d2f4d42269951ae63f771111c5dcf9c5c23 100644 (file)
 //                                                                           //
 ///////////////////////////////////////////////////////////////////////////////
 
-#ifndef ROOT_TNamed
 #include <TNamed.h>
-#endif
 
-#ifndef ALIPID_H
 #include "AliPID.h"
-#endif
 
 class AliTRDCalPID : public TNamed
 {
@@ -38,40 +34,39 @@ class AliTRDCalPID : public TNamed
 
   virtual Bool_t   LoadReferences(Char_t *refFile) = 0;
   static  Double_t GetMomentum(Int_t ip) { 
-    return (ip<0 || ip>=kNMom) ? -1.0 : fTrackMomentum[ip]; }
+    return (ip<0 || ip>=kNMom) ? -1.0 : fgTrackMomentum[ip]; }
   static  Double_t GetMomentumBinning(Int_t ip) { 
-    return (ip<0 || ip>=kNMom+1) ? -1.0 : fTrackMomentumBinning[ip]; }
+    return (ip<0 || ip>=kNMom+1) ? -1.0 : fgTrackMomentumBinning[ip]; }
   virtual TObject *GetModel(Int_t ip, Int_t iType, Int_t iPlane) const = 0;
-  virtual Double_t GetProbability(Int_t spec, Float_t mom, Float_t *dedx
+  virtual Double_t GetProbability(Int_t spec, Float_t mom
+                                , const Float_t * const dedx
                                 , Float_t length, Int_t plane) const = 0;
-  static  Color_t  GetPartColor(Int_t i)              { return fPartColor[i]; }
+  static  Color_t  GetPartColor(Int_t i)                    { return fgPartColor[i]; }
   static  Int_t    GetPartIndex(Int_t pdg);
-  static  const Char_t  *GetPartName(Int_t i)               { return fPartName[i]; }
-  static  const Char_t  *GetPartSymb(Int_t i)               { return fPartSymb[i]; }
+  static  const Char_t  *GetPartName(Int_t i)               { return fPartName[i];   }
+  static  const Char_t  *GetPartSymb(Int_t i)               { return fPartSymb[i];   }
 
-          void     SetPartName(Int_t i, const Char_t *name) { fPartName[i] = name; }
-          void     SetPartSymb(Int_t i, const Char_t *symb) { fPartSymb[i] = symb; }
+          void     SetPartName(Int_t i, const Char_t *name) { fPartName[i] = name;   }
+          void     SetPartSymb(Int_t i, const Char_t *symb) { fPartSymb[i] = symb;   }
 
  protected:
 
   virtual void     Init() = 0;
   virtual Int_t    GetModelID(Int_t mom, Int_t spec, Int_t plane) const = 0;
 
+  static const Char_t   *fPartName[AliPID::kSPECIES];     //! Names of particle species
+  static const Char_t   *fPartSymb[AliPID::kSPECIES];     //! Symbols of particle species
+  static       Color_t   fgPartColor[AliPID::kSPECIES];   //! Colors of particle species
+  static       Float_t   fgTrackMomentum[kNMom];          //  Track momenta for which response functions are available
+  static       Float_t   fgTrackMomentumBinning[kNMom+1]; //  Defines the start and the endpoints of the momentum bins
+  TObjArray             *fModel;                          //  Model for probability estimate
+
  private:
 
   AliTRDCalPID(const AliTRDCalPID& pd);
   AliTRDCalPID    &operator=(const AliTRDCalPID &c);
 
- protected:
-
-  static const Char_t   *fPartName[AliPID::kSPECIES]; //! Names of particle species
-  static const Char_t   *fPartSymb[AliPID::kSPECIES]; //! Symbols of particle species
-  static  Color_t  fPartColor[AliPID::kSPECIES]; //! Colors of particle species
-  static  Float_t   fTrackMomentum[kNMom]; //  Track momenta for which response functions are available
-  static  Float_t   fTrackMomentumBinning[kNMom+1]; //  Defines the start and the endpoints of the momentum bins
-  TObjArray        *fModel;                //  Model for probability estimate
-
-  ClassDef(AliTRDCalPID, 3)                //  Base class for TRD PID methods
+  ClassDef(AliTRDCalPID, 4)                               //  Base class for TRD PID methods
 
 };
 #endif
index 20c52b793cbe93baed4cd4a3039f55b8ffcb6661..b2c33a2b05dc40d97ffd2d493e42a15a5f01787f 100644 (file)
@@ -26,7 +26,6 @@
 //                                                                      //
 //////////////////////////////////////////////////////////////////////////
 
-#include <TH1F.h>
 #include <TH2F.h>
 #include <TFile.h>
 #include <TROOT.h>
@@ -39,7 +38,7 @@
 
 ClassImp(AliTRDCalPIDLQ)
 
-Float_t AliTRDCalPIDLQ::fTrackSegLength[kNLength] = { 3.7, 3.9, 4.2, 5.0 };
+Float_t AliTRDCalPIDLQ::fgTrackSegLength[kNLength] = { 3.7, 3.9, 4.2, 5.0 };
 
 //_________________________________________________________________________
 AliTRDCalPIDLQ::AliTRDCalPIDLQ()
@@ -139,7 +138,7 @@ TObject* AliTRDCalPIDLQ::GetModel(Int_t ip, Int_t iType, Int_t iplane) const
   if (iType < 0 || iType >= AliPID::kSPECIES) return 0x0;
        if(ip<0 || ip>= kNMom ) return 0x0;
 
-       AliInfo(Form("Retrive dEdx histogram for %s of %5.2f GeV/c", fPartName[iType], fTrackMomentum[ip]));
+  AliInfo(Form("Retrive dEdx histogram for %s of %5.2f GeV/c", fPartName[iType], fgTrackMomentum[ip]));
   
   return fModel->At(GetModelID(ip, iType, iplane));
 }
@@ -160,16 +159,16 @@ Double_t AliTRDCalPIDLQ::GetProbability(Int_t spec, Float_t mom, Float_t *dedx,
        
        // find the interval in momentum and track segment length which applies for this data
        Int_t ilength = 1;
-  while(ilength<kNLength-1 && length>fTrackSegLength[ilength]){
+  while(ilength<kNLength-1 && length>fgTrackSegLength[ilength]){
                ilength++;
        }
        Int_t imom = 1;
-  while(imom<kNMom-1 && mom>fTrackMomentum[imom]) imom++;
+  while(imom<kNMom-1 && mom>fgTrackMomentum[imom]) imom++;
 
        Int_t nbinsx, nbinsy;
        TAxis *ax = 0x0, *ay = 0x0;
-       Double_t LQ1, LQ2;
-       Double_t mom1 = fTrackMomentum[imom-1], mom2 = fTrackMomentum[imom];
+       Double_t lq1, lq2;
+       Double_t mom1 = fgTrackMomentum[imom-1], mom2 = fgTrackMomentum[imom];
        TH2 *hist = 0x0;
        if(!(hist = (TH2D*)fModel->At(GetModelID(imom-1, spec, iplane)))){
                AliInfo(Form("Looking for spec(%d) mom(%f) Ex(%f) Ey(%f) length(%f)", spec, mom, dedx[0], dedx[1], length));
@@ -182,31 +181,31 @@ Double_t AliTRDCalPIDLQ::GetProbability(Int_t spec, Float_t mom, Float_t *dedx,
         Bool_t kX = (x < ax->GetBinUpEdge(nbinsx));
        Bool_t kY = (y < ay->GetBinUpEdge(nbinsy));
        if(kX)
-               if(kY) LQ1 = hist->GetBinContent( hist->FindBin(x, y)); 
+               if(kY) lq1 = hist->GetBinContent( hist->FindBin(x, y)); 
     //fEstimator->Estimate2D2(hist, x, y);
-               else LQ1 = hist->GetBinContent(ax->FindBin(x), nbinsy);
+               else lq1 = hist->GetBinContent(ax->FindBin(x), nbinsy);
        else
-               if(kY) LQ1 = hist->GetBinContent(nbinsx, ay->FindBin(y));
-               else LQ1 = hist->GetBinContent(nbinsx, nbinsy);
+               if(kY) lq1 = hist->GetBinContent(nbinsx, ay->FindBin(y));
+               else lq1 = hist->GetBinContent(nbinsx, nbinsy);
 
 
        if(!(hist = (TH2D*)fModel->At(GetModelID(imom, spec, iplane)))){
                AliInfo(Form("Looking for spec(%d) mom(%f) Ex(%f) Ey(%f) length(%f)", spec, mom, dedx[0], dedx[1], length));
                AliError(Form("EHistogram id %d not found in DB.", GetModelID(imom, spec, iplane)));
-               return LQ1;
+               return lq1;
        }
        if(kX)
-               if(kY) LQ2 = hist->GetBinContent( hist->FindBin(x, y)); 
+               if(kY) lq2 = hist->GetBinContent( hist->FindBin(x, y)); 
     //fEstimator->Estimate2D2(hist, x, y);
-               else LQ2 = hist->GetBinContent(ax->FindBin(x), nbinsy);
+               else lq2 = hist->GetBinContent(ax->FindBin(x), nbinsy);
        else
-               if(kY) LQ2 = hist->GetBinContent(nbinsx, ay->FindBin(y));
-               else LQ2 = hist->GetBinContent(nbinsx, nbinsy);
+               if(kY) lq2 = hist->GetBinContent(nbinsx, ay->FindBin(y));
+               else lq2 = hist->GetBinContent(nbinsx, nbinsy);
        
         // return interpolation over momentum binning
-        if(mom < fTrackMomentum[0]) return LQ1;
-        else if(mom > fTrackMomentum[kNMom-1]) return LQ2;
-        else return LQ1 + (LQ2 - LQ1)*(mom - mom1)/(mom2 - mom1);
+        if(mom < fgTrackMomentum[0]) return lq1;
+        else if(mom > fgTrackMomentum[kNMom-1]) return lq2;
+        else return lq1 + (lq2 - lq1)*(mom - mom1)/(mom2 - mom1);
 
 }
 
@@ -223,7 +222,7 @@ void AliTRDCalPIDLQ::Init()
 }
 
 //_________________________________________________________________________
-Int_t AliTRDCalPIDLQ::GetModelID(Int_t mom, Int_t spec, Int_t) const
+Int_t AliTRDCalPIDLQ::GetModelID(Int_t mom, Int_t spec, Int_t /*ii*/) const
 {  
   // returns the ID of the LQ distribution (55 Histos, ID from 1 to 55)
 
index c86c78372a6953cf1ef32473b3a2272b252d99f3..1f84331caeadc6e8278f9418191d33b09f1d279e 100644 (file)
@@ -15,9 +15,7 @@
 //                                                                        //          
 ////////////////////////////////////////////////////////////////////////////
 
-#ifndef ALITRDCALPID_H
 #include "AliTRDCalPID.h"
-#endif
 
 class AliTRDCalPIDLQ : public AliTRDCalPID
 {
@@ -34,23 +32,23 @@ class AliTRDCalPIDLQ : public AliTRDCalPID
 
   Bool_t          LoadReferences(Char_t* refFile);
   TObject*        GetModel(Int_t ip, Int_t iType, Int_t iPlane) const;
-  static Double_t GetLength(Int_t il) { return (il<0 || il>=kNLength) ? -1. : fTrackSegLength[il]; }
+  static Double_t GetLength(Int_t il) { return (il<0 || il>=kNLength) ? -1. : fgTrackSegLength[il]; }
          Double_t GetProbability(Int_t spec, Float_t mom, Float_t *dedx
                                , Float_t length, Int_t plane) const;
 
+ protected:
+
+  static Float_t  fgTrackSegLength[kNLength]; // Track segment lengths
+
  private:
 
   AliTRDCalPIDLQ(const AliTRDCalPIDLQ& pd);
   AliTRDCalPIDLQ&   operator=(const AliTRDCalPIDLQ &c);
 
   void     Init();
-  Int_t    GetModelID(Int_t mom, Int_t , Int_t) const;
-
- protected:
-
-  static Float_t  fTrackSegLength[kNLength];  // Track segment lengths
+  Int_t    GetModelID(Int_t mom, Int_t spec, Int_t ii) const;
 
-  ClassDef(AliTRDCalPIDLQ, 1)                 // LQ PID reference manager
+  ClassDef(AliTRDCalPIDLQ, 2)                 // LQ PID reference manager
 
 };
 #endif
index 8047dd48466bfd70bfe84e690a89d0433dd6fc4f..e63ad42981717efe6fa12a73bd098da18ab46124 100644 (file)
 
 #include <TFile.h>
 #include <TROOT.h>
-#include <TObject.h>
 #include <TMultiLayerPerceptron.h>
 
-#include "AliLog.h"
 #include "AliPID.h"
-#include "AliESD.h"
-#include "AliESDtrack.h"
 #include "AliTRDtrack.h"
 
 #include "AliTRDgeometry.h"
@@ -131,7 +127,7 @@ TObject *AliTRDCalPIDNN::GetModel(Int_t ip, Int_t, Int_t iplane) const
   if (ip<0 || ip>= kNMom) return 0x0;
   
   AliInfo(Form("Retrive MultiLayerPerceptron for %5.2f GeV/c for plane %d" 
-         ,fTrackMomentum[ip]
+         ,fgTrackMomentum[ip]
          ,iplane));
   
   return fModel->At(GetModelID(ip, 0, iplane));
@@ -139,7 +135,8 @@ TObject *AliTRDCalPIDNN::GetModel(Int_t ip, Int_t, Int_t iplane) const
 }
 
 //_________________________________________________________________________
-Double_t AliTRDCalPIDNN::GetProbability(Int_t spec, Float_t mom, Float_t *dedx
+Double_t AliTRDCalPIDNN::GetProbability(Int_t spec, Float_t mom
+                                      , const Float_t * const dedx
                                       , Float_t, Int_t iplane) const
 {
   //
@@ -154,9 +151,9 @@ Double_t AliTRDCalPIDNN::GetProbability(Int_t spec, Float_t mom, Float_t *dedx
   // find the interval in momentum and track segment length which applies for this data
   
   Int_t imom = 1;
-  while (imom<AliTRDCalPID::kNMom-1 && mom>fTrackMomentum[imom]) imom++;
+  while (imom<AliTRDCalPID::kNMom-1 && mom>fgTrackMomentum[imom]) imom++;
   Double_t lNN1, lNN2;
-  Double_t mom1 = fTrackMomentum[imom-1], mom2 = fTrackMomentum[imom];
+  Double_t mom1 = fgTrackMomentum[imom-1], mom2 = fgTrackMomentum[imom];
 
   TMultiLayerPerceptron *nn = 0x0;
   if(!(nn = (TMultiLayerPerceptron *) fModel->At(GetModelID(imom-1, spec, iplane/*, ilength*/)))){
@@ -182,10 +179,10 @@ Double_t AliTRDCalPIDNN::GetProbability(Int_t spec, Float_t mom, Float_t *dedx
   lNN2 = nn->Evaluate(spec, ddedx);
   
   // return interpolation over momentum binning
-  if      (mom < fTrackMomentum[0]) {
+  if      (mom < fgTrackMomentum[0]) {
     return lNN1;
   }
-  else if (mom > fTrackMomentum[AliTRDCalPID::kNMom-1]) {
+  else if (mom > fgTrackMomentum[AliTRDCalPID::kNMom-1]) {
     return lNN2;
   }
   else {
@@ -207,7 +204,7 @@ void AliTRDCalPIDNN::Init()
 }
 
 //_________________________________________________________________________
-Int_t AliTRDCalPIDNN::GetModelID(Int_t mom, Int_t, Int_t plane) const
+Int_t AliTRDCalPIDNN::GetModelID(Int_t mom, Int_t /*ii*/, Int_t plane) const
 {
   
   // returns the ID of the NN distribution (66 MLPs, ID from 56 to 121)
index 764609619d843c296c6d4d56d470cb7fe129a9a6..e165c676484f241ecb0c814d2a913ba1ab1672ad 100644 (file)
@@ -14,9 +14,7 @@
 //                                                                        //
 ////////////////////////////////////////////////////////////////////////////
 
-#ifndef ALITRDCALPID_H
 #include "AliTRDCalPID.h"
-#endif
 
 class AliTRDCalPIDNN : public AliTRDCalPID
 {
@@ -31,7 +29,9 @@ class AliTRDCalPIDNN : public AliTRDCalPID
   virtual  ~AliTRDCalPIDNN();
   Bool_t    LoadReferences(Char_t *refFile);
   TObject  *GetModel(Int_t ip, Int_t iType, Int_t iPlane) const;
-  Double_t  GetProbability(Int_t spec, Float_t mom, Float_t *dedx, Float_t length, Int_t plane) const;
+  Double_t  GetProbability(Int_t spec, Float_t mom
+                         , const Float_t * const dedx
+                         , Float_t length, Int_t plane) const;
 
  private:
 
@@ -39,7 +39,7 @@ class AliTRDCalPIDNN : public AliTRDCalPID
   AliTRDCalPIDNN &operator=(const AliTRDCalPIDNN &c);
            
   void     Init();
-  Int_t    GetModelID(Int_t mom, Int_t , Int_t) const;
+  Int_t    GetModelID(Int_t mom, Int_t ii, Int_t plane) const;
 
   ClassDef(AliTRDCalPIDNN, 1) // NN PID reference manager