]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
explicit initializations
authorgconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 12 Aug 2010 08:00:09 +0000 (08:00 +0000)
committergconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 12 Aug 2010 08:00:09 +0000 (08:00 +0000)
15 files changed:
EMCAL/AliEMCALDigit.cxx
EMCAL/AliEMCALDigitizer.cxx
EMCAL/AliEMCALGeoUtils.cxx
EMCAL/AliEMCALGeometry.cxx
EMCAL/AliEMCALPIDUtils.cxx
EMCAL/AliEMCALRawDigit.cxx
EMCAL/AliEMCALRawUtils.cxx
EMCAL/AliEMCALRecPoint.cxx
EMCAL/AliEMCALSDigitizer.cxx
EMCAL/AliEMCALSurvey.cxx
EMCAL/AliEMCALTrack.cxx
EMCAL/AliEMCALTracker.cxx
EMCAL/AliEMCALv1.cxx
EMCAL/AliEMCALv2.cxx
EMCAL/AliEMCALv3.cxx

index b23fd68a45f4cd3ae5b93834ef19870f32b8607b..c4fb9e18da162660db8c9cc04815087630b42657 100644 (file)
@@ -246,7 +246,7 @@ Int_t AliEMCALDigit::Compare(const TObject * obj) const
   // Compares two digits with respect to its Id
   // to sort according increasing Id
 
-  Int_t rv ;
+  Int_t rv = 2 ;
 
   AliEMCALDigit * digit = (AliEMCALDigit *)obj ; 
 
@@ -513,12 +513,11 @@ ostream& operator << ( ostream& out , const AliEMCALDigit & digit)
   // Prints the data of the digit
   
   out << "ID " << digit.fId << " Energy = " << digit.fAmp <<  " Time = " << digit.fTime << endl ; 
-  Int_t i,j ;
-  for(i=0;i<digit.fNprimary;i++) 
+  for(Int_t i=0;i<digit.fNprimary;i++) 
     out << "Primary " << i+1 << " = " << digit.fPrimary[i] 
        << " : DE " << digit.fDEPrimary[i] << endl ;
    
-  for(j=0;j<digit.fNiparent;j++)
+  for(Int_t j=0;j<digit.fNiparent;j++)
     out << "Iparent " << j+1 << " = " << digit.fIparent[j] 
        << " : DE " << digit.fDEParent[j] << endl ;
   out << "Position in list = " << digit.fIndexInList << endl ; 
index 6e1685240af8c82b4d2a806d805ba0c85c6b1d8f..9a745fbfd2cc9a1dd5d9249ebec1020d5180350d 100644 (file)
@@ -311,7 +311,7 @@ void AliEMCALDigitizer::Digitize(Int_t event)
   nEMC = geom->GetNCells();
   AliDebug(1,Form("nEMC %i (number cells in EMCAL) | %s \n", nEMC, geom->GetName()));
   
-  Int_t absID ;
+  Int_t absID = -1 ;
 
   digits->Expand(nEMC) ;
 
@@ -326,8 +326,8 @@ void AliEMCALDigitizer::Digitize(Int_t event)
   //take all the inputs to add together and load the SDigits
   TObjArray * sdigArray = new TObjArray(fInput) ;
   sdigArray->AddAt(emcalLoader->SDigits(), 0) ;
+  
   Int_t i ;
-
   for(i = 1 ; i < fInput ; i++){
     TString tempo(fEventNames[i]) ; 
     tempo += i ;
@@ -444,12 +444,12 @@ void AliEMCALDigitizer::Digitize(Int_t event)
       //Find next signal module
       nextSig = nEMC + 1 ;
       for(i = 0 ; i < fInput ; i++){
-       sdigits = dynamic_cast<TClonesArray *>(sdigArray->At(i)) ;
-       Int_t curNext = nextSig ;
-       if(sdigits->GetEntriesFast() > index[i] ){
-         curNext = dynamic_cast<AliEMCALDigit *>(sdigits->At(index[i]))->GetId() ;       
-       }
-       if(curNext < nextSig) nextSig = curNext ;
+        sdigits = dynamic_cast<TClonesArray *>(sdigArray->At(i)) ;
+        Int_t curNext = nextSig ;
+        if(sdigits->GetEntriesFast() > index[i] ){
+          curNext = dynamic_cast<AliEMCALDigit *>(sdigits->At(index[i]))->GetId() ;      
+        }
+        if(curNext < nextSig) nextSig = curNext ;
       }
     }
     // add the noise now
@@ -584,8 +584,8 @@ void AliEMCALDigitizer::Exec(Option_t *option)
   else if (fManager) 
     fLastEvent = fFirstEvent ; // what is this ??
 
-  Int_t nEvents   = fLastEvent - fFirstEvent + 1;
-  Int_t ievent;
+  Int_t nEvents = fLastEvent - fFirstEvent + 1;
+  Int_t ievent  = -1;
 
   TClonesArray* digitsTRG = new TClonesArray("AliEMCALRawDigit", 32 * 96);
   TClonesArray* digitsTMP = new TClonesArray("AliEMCALDigit",    32 * 96);
@@ -686,7 +686,7 @@ void AliEMCALDigitizer::Digits2FastOR(TClonesArray* digitsTMP, TClonesArray* dig
                // to be compliant with %4 per TRU
                if (itru == 31) iphim -= 2;
                
-               Int_t trgid;
+               Int_t trgid = 0;
                Bool_t isOK = geom->GetAbsFastORIndexFromPositionInTRU(itru, ietam, iphim % 4, trgid);
                
                AliDebug(2,Form("trigger digit id: %d itru: %d isOK: %d\n",trgid,itru,isOK));
@@ -945,11 +945,10 @@ void AliEMCALDigitizer::Print(Option_t*)const
       nStreams =  GetNInputStreams() ;
     else 
       nStreams = fInput ; 
+  
+    AliRunLoader *rl=0;
     
     Int_t index = 0 ;  
-
-    AliRunLoader *rl=0;
-
     for (index = 0 ; index < nStreams ; index++) {  
       TString tempo(fEventNames[index]) ; 
       tempo += index ;
index ffa81239dfa7545fda7925a36fefc4536d05ef9b..2b486c2ec1e8890d8d5694756424184f5e914ced 100644 (file)
@@ -124,7 +124,7 @@ AliEMCALGeoUtils::AliEMCALGeoUtils(const Text_t* name, const Text_t* title)
   fNETAdiv = fEMCGeometry->GetNETAdiv();
   fNPHIdiv = fEMCGeometry->GetNPHIdiv();
   fNCellsInModule = fNPHIdiv*fNETAdiv;
-  static int i;
+  static int i=0;
   Int_t nSMod = fEMCGeometry->GetNumberOfSuperModules();
   fPhiBoundariesOfSM.Set(nSMod);
   fPhiCentersOfSM.Set(nSMod/2);
@@ -137,7 +137,7 @@ AliEMCALGeoUtils::AliEMCALGeoUtils(const Text_t* name, const Text_t* title)
   Double_t phiMax =  0.;
   for(Int_t sm=0; sm<nSMod; sm++) {
     fEMCGeometry->GetPhiBoundariesOfSM(sm,phiMin,phiMax);
-       i=sm/2;
+    i=sm/2;
     fPhiCentersOfSM[i] = fEMCGeometry->GetPhiCenterOfSM(sm);
   }
   fNCells = fEMCGeometry->GetNCells();
@@ -244,7 +244,7 @@ void AliEMCALGeoUtils::GetGlobal(const TVector3 &vloc, TVector3 &vglob, int ind)
 void AliEMCALGeoUtils::GetGlobal(Int_t absId , double glob[3]) const
 {
   // Alice numbering scheme - Jun 03, 2006
-  static Int_t nSupMod, nModule, nIphi, nIeta;
+  static Int_t nSupMod=0, nModule=-1, nIphi=-1, nIeta=-1;
   static double loc[3];
 
   glob[0]=glob[1]=glob[2]=0.0; // bad case
@@ -276,8 +276,8 @@ void AliEMCALGeoUtils::GetGlobal(Int_t absId , TVector3 &vglob) const
 void AliEMCALGeoUtils::PrintCellIndexes(Int_t absId, int pri, const char *tit) const
 {
   // Service methods
-  Int_t nSupMod, nModule, nIphi, nIeta;
-  Int_t iphi, ieta;
+  Int_t nSupMod=0, nModule=-1, nIphi=-1, nIeta=-1;
+  Int_t iphi=-1, ieta=-1;
   TVector3 vg;
 
   GetCellIndex(absId,  nSupMod, nModule, nIphi, nIeta);
@@ -354,7 +354,7 @@ void  AliEMCALGeoUtils::GetModuleIndexesFromCellIndexesInSModule(Int_t nSupMod,
                        Int_t &iphim, Int_t &ietam, Int_t &nModule) const
 {
   // Transition from cell indexes (ieta,iphi) to module indexes (ietam,iphim, nModule)
-  static Int_t nphi;
+  static Int_t nphi=0;
   nphi  = GetNumberOfModuleInPhiDirection(nSupMod);  
 
   ietam  = ieta/fNETAdiv;
@@ -366,8 +366,8 @@ void  AliEMCALGeoUtils::GetModuleIndexesFromCellIndexesInSModule(Int_t nSupMod,
 Int_t  AliEMCALGeoUtils::GetAbsCellIdFromCellIndexes(Int_t nSupMod, Int_t iphi, Int_t ieta) const
 {
   // Transition from super module number(nSupMod) and cell indexes (ieta,iphi) to absId
-  static Int_t ietam, iphim, nModule;
-  static Int_t nIeta, nIphi; // cell indexes in module
+  static Int_t ietam=-1, iphim=-1, nModule=-1;
+  static Int_t nIeta=-1, nIphi=-1; // cell indexes in module
 
   GetModuleIndexesFromCellIndexesInSModule(nSupMod, iphi, ieta, ietam, iphim, nModule);
 
@@ -383,7 +383,7 @@ Bool_t AliEMCALGeoUtils::SuperModuleNumberFromEtaPhi(Double_t eta, Double_t phi,
 { 
   // Return false if phi belongs a phi cracks between SM
  
-  static Int_t i;
+  static Int_t i=0;
 
   if(TMath::Abs(eta) > fEtaMaxOfTRD1) return kFALSE;
 
@@ -409,8 +409,8 @@ Bool_t AliEMCALGeoUtils::GetAbsCellIdFromEtaPhi(Double_t eta, Double_t phi, Int_
 {
   // Nov 17,2006
   // stay here - phi problem as usual 
-  static Int_t nSupMod, i, ieta, iphi, etaShift, nphi;
-  static Double_t absEta=0.0, d=0.0, dmin=0.0, phiLoc;
+  static Int_t nSupMod=0, i=0, ieta=-1, iphi=-1, etaShift=0, nphi=0;
+  static Double_t absEta=0.0, d=0.0, dmin=0.0, phiLoc=0.;
   absId = nSupMod = - 1;
   if(SuperModuleNumberFromEtaPhi(eta, phi, nSupMod)) {
     // phi index first
@@ -515,7 +515,7 @@ Int_t  AliEMCALGeoUtils::GetSuperModuleNumber(Int_t absId)  const
   // Return the number of the  supermodule given the absolute
   // ALICE numbering id
 
-  static Int_t nSupMod, nModule, nIphi, nIeta;
+  static Int_t nSupMod=0, nModule=-1, nIphi=-1, nIeta=-1;
   GetCellIndex(absId, nSupMod, nModule, nIphi, nIeta);
   return nSupMod;
 } 
@@ -528,7 +528,7 @@ void AliEMCALGeoUtils::GetModulePhiEtaIndexInSModule(Int_t nSupMod, Int_t nModul
   // ietam, iphi - indexes of module in two dimensional grid of SM
   // ietam - have to change from 0 to fNZ-1
   // iphim - have to change from 0 to nphi-1 (fNPhi-1 or fNPhi/2-1)
-  static Int_t nphi;
+  static Int_t nphi = 0;
 
   if(fKey110DEG == 1 && nSupMod>=10) nphi = fNPhi/2;
   else                               nphi = fNPhi;
@@ -555,7 +555,7 @@ int &iphi, int &ieta) const
   // ieta - have to change from 0 to (fNZ*fNETAdiv-1)
   // iphi - have to change from 0 to (fNPhi*fNPHIdiv-1 or fNPhi*fNPHIdiv/2-1)
   //
-  static Int_t iphim, ietam;
+  static Int_t iphim=-1, ietam=-1;
 
   GetModulePhiEtaIndexInSModule(nSupMod,nModule, iphim, ietam); 
   //  ieta  = ietam*fNETAdiv + (1-nIeta); // x(module) = -z(SM) 
@@ -584,7 +584,7 @@ Bool_t AliEMCALGeoUtils::RelPosCellInSModule(Int_t absId, Double_t &xr, Double_t
   // Shift index taking into account the difference between standard SM 
   // and SM of half size in phi direction
   const Int_t kphiIndexShift = fCentersOfCellsPhiDir.GetSize()/4; // Nov 22, 2006; was 6 for cas 2X2
-  static Int_t nSupMod, nModule, nIphi, nIeta, iphi, ieta;
+  static Int_t nSupMod=0, nModule=-1, nIphi=-1, nIeta=-1, iphi=-1, ieta=-1;
   if(!CheckAbsCellId(absId)) return kFALSE;
 
   GetCellIndex(absId, nSupMod, nModule, nIphi, nIeta);
@@ -842,7 +842,7 @@ void AliEMCALGeoUtils::ImpactOnEmcal(TVector3 vtx, Double_t theta, Double_t phi,
   GetAbsCellIdFromEtaPhi(direction.Eta(),direction.Phi(),absId);
   
   //tower absID hitted -> tower/module plane (evaluated at the center of the tower)
-  Int_t nSupMod, nModule, nIphi, nIeta;
+  Int_t nSupMod=0, nModule=-1, nIphi=-1, nIeta=-1;
   Double_t loc[3],loc2[3],loc3[3];
   Double_t glob[3]={},glob2[3]={},glob3[3]={};
   
@@ -852,7 +852,7 @@ void AliEMCALGeoUtils::ImpactOnEmcal(TVector3 vtx, Double_t theta, Double_t phi,
   GetCellIndex(absId, nSupMod, nModule, nIphi, nIeta);
 
   //look at 2 neighbours-s cell using nIphi={0,1} and nIeta={0,1}
-  Int_t nIphi2,nIeta2,absId2,absId3;
+  Int_t nIphi2=-1,nIeta2=-1,absId2=-1,absId3=-1;
   if(nIeta==0) nIeta2=1;
   else nIeta2=0;
   absId2=GetAbsCellId(nSupMod,nModule,nIphi,nIeta2);  
@@ -927,10 +927,9 @@ Bool_t AliEMCALGeoUtils::IsInEMCAL(Double_t x, Double_t y, Double_t z) const {
   Double_t r=sqrt(x*x+y*y);
 
   if ( r > fEnvelop[0] ) {
-     Double_t theta;
-     theta  =    TMath::ATan2(r,z);
-     Double_t eta;
-     if(theta == 0) 
+     Double_t theta  = TMath::ATan2(r,z);
+     Double_t eta    = 9999;
+     if(theta < 1e-5) // before theta == 0, not allowed by coding convention 
        eta = 9999;
      else 
        eta    =   -TMath::Log(TMath::Tan(theta/2.));
@@ -993,7 +992,7 @@ Bool_t AliEMCALGeoUtils::GetPositionInTRUFromAbsFastORIndex(const Int_t id, Int_
 {
        //Trigger mapping method, get position in TRU from FasOr Index
        
-       Int_t iADC;
+       Int_t iADC = 0;
        
        Bool_t isOK = GetTRUFromAbsFastORIndex(id, iTRU, iADC);
        
@@ -1021,7 +1020,7 @@ Bool_t AliEMCALGeoUtils::GetPositionInSMFromAbsFastORIndex(const Int_t id, Int_t
 {
        //Trigger mapping method, get position in Super Module from FasOr Index
 
-       Int_t iTRU;
+       Int_t iTRU = 0;
        Bool_t isOK = GetPositionInTRUFromAbsFastORIndex(id, iTRU, iEta, iPhi);
        
        if (!isOK) return kFALSE;
index ddd23f24866ddb6b5e6d09786966328841911d9f..bc6e5cdefb0738c5ccf1e473af2b9c7717785505 100644 (file)
@@ -164,8 +164,8 @@ Bool_t AliEMCALGeometry::RelPosCellInSModule(Int_t absId, Double_t distEff, Doub
   // Shift index taking into account the difference between standard SM 
   // and SM of half size in phi direction
   const  Int_t kphiIndexShift = fCentersOfCellsPhiDir.GetSize()/4; // Nov 22, 2006; was 6 for cas 2X2
-  static Int_t nSupMod, nModule, nIphi, nIeta, iphi, ieta;
-  static Int_t iphim, ietam;
+  static Int_t nSupMod=0, nModule=-1, nIphi=-1, nIeta=-1, iphi=-1, ieta=-1;
+  static Int_t iphim=-1, ietam=-1;
   static AliEMCALShishKebabTrd1Module *mod = 0;
   static TVector2 v;
   if(!CheckAbsCellId(absId)) return kFALSE;
index 3fff29c413a557f097bf3979a8eb71b097f66c76..3975b94884c243ea3d0e5d77686d7833be0aa08a 100644 (file)
 //
 //     kElectron :  fPIDFinal[0]
 //     kMuon     :  fPIDFinal[1]
-//     kPion     :  fPIDFinal[2]
-//     kKaon     :  fPIDFinal[3]
+//     kPion       :  fPIDFinal[2]
+//     kKaon       :  fPIDFinal[3]
 //     kProton   :  fPIDFinal[4]
 //     kPhoton   :  fPIDFinal[5]
-//     kPi0      :  fPIDFinal[6]
+//     kPi0        :  fPIDFinal[6]
 //     kNeutron  :  fPIDFinal[7]
 //     kKaon0    :  fPIDFinal[8]
 //     kEleCon   :  fPIDFinal[9]
@@ -243,7 +243,6 @@ Double_t AliEMCALPIDUtils::DistEnergy(const Double_t energy, const Int_t type)
   // Compute the values of the weigh for a given energy the parametrised distribution using the data initialised before.
   //
   Double_t constante = 0.;
-  Double_t  energyParam;
   
   switch (type) {
     
@@ -251,18 +250,16 @@ Double_t AliEMCALPIDUtils::DistEnergy(const Double_t energy, const Int_t type)
     constante  = 1.;    
     break;
   case 2:
-      constante  = 1.;
+    constante  = 1.;
     break;
   case 3:
     constante  = PowerExp(energy, fHadronEnergyProb);
     break;
   }
   
-  energyParam = constante;
+  //   cout << "Weight   " << constante << " for energy  "<< energy<< " GeV "<<  endl;
   
-  // //   cout << "Weight   " << constante << " for energy  "<< energy<< " GeV "<<  endl;
-  
-  return energyParam;
+  return constante;
 }
 
 
@@ -274,8 +271,7 @@ Double_t AliEMCALPIDUtils::Polynomial(const Double_t x, const Double_t *params)
   // with the array of parameters passed as the second arg
   //
   
-  Double_t y;
-  y  = params[0];
+  Double_t y  = params[0];
   y += params[1] * x;
   y += params[2] * x * x;
   y += params[3] * x * x * x;
@@ -292,8 +288,7 @@ Double_t AliEMCALPIDUtils::Polynomial0(const Double_t *params) const
   // with the array of parameters passed as the second arg
   //
   
-  Double_t y;
-  y  = params[0];
+  Double_t y  = params[0];
   return y;
 }
 
@@ -305,17 +300,17 @@ Double_t AliEMCALPIDUtils::Polynomialinv(const Double_t x, const Double_t *param
   // with the array of parameters passed as the second arg
   //
   
-  Double_t y;
+  Double_t y=0.;
+  
   if(x>0){
-  y  = params[0];
-  y += params[1] / x;
-  y += params[2] / (x * x);
-  y += params[3] / (x * x * x);
-  y += params[4] / (x * x * x * x);
-  y += params[5] / (x * x * x * x * x);
+    y  = params[0];
+    y += params[1] / x;
+    y += params[2] / (x * x);
+    y += params[3] / (x * x * x);
+    y += params[4] / (x * x * x * x);
+    y += params[5] / (x * x * x * x * x);
   }  
-  else
-    y=0.;
+  
   return y;
   
 }
@@ -327,7 +322,7 @@ Double_t AliEMCALPIDUtils::PolynomialMixed1(const Double_t x, const Double_t *pa
   // with the array of parameters passed as the second arg
   //
   
-  Double_t y;
+  Double_t y=0.;
   if(x>0){
     y  = params[0] / x;
     y += params[1] ;
@@ -336,8 +331,7 @@ Double_t AliEMCALPIDUtils::PolynomialMixed1(const Double_t x, const Double_t *pa
     //   y += params[4] * 0.;
     //   y += params[5] * 0.;
   }  
-  else
-    y=0.;
+
   
   return y;
   
@@ -351,7 +345,7 @@ Double_t AliEMCALPIDUtils::PolynomialMixed2(const Double_t x, const Double_t *pa
   // with the array of parameters passed as the second arg
   //
   
-  Double_t y;
+  Double_t y=0.;
   if(x>0){
     y  = params[0] / ( x * x);
     y += params[1] / x;
@@ -360,8 +354,6 @@ Double_t AliEMCALPIDUtils::PolynomialMixed2(const Double_t x, const Double_t *pa
     y += params[4] * x * x ;
     //   y += params[5] * 0.;
   }  
-  else
-    y=0.;
 
   return y;
   
@@ -376,10 +368,8 @@ Double_t AliEMCALPIDUtils::PowerExp(const Double_t x, const Double_t *params) co
   // par[0]*TMath::Power(x[0],par[1])
   // par[0]*TMath::Exp((x[0]-par[1])*par[2]);
   
-  Double_t y;
-  
-  y  = params[0] *TMath::Power( x,params[1]);
-  y += params[2] *TMath::Exp((x-params[3])*params[4]);
+  Double_t y = params[0] *TMath::Power( x,params[1]);
+  y         += params[2] *TMath::Exp((x-params[3])*params[4]);
   
   return y;
   
@@ -414,7 +404,7 @@ void AliEMCALPIDUtils::SetLowFluxParam()
 {
   
   // as a first step, all array elements are initialized to 0.0
-  Int_t i, j;
+  Int_t i=0, j=0;
   
   for (i = 0; i < 6; i++) {
     for (j = 0; j < 6; j++) {
@@ -565,7 +555,7 @@ void AliEMCALPIDUtils::SetHighFluxParam()
 {
   
   // as a first step, all array elements are initialized to 0.0
-  Int_t i, j;
+  Int_t i=0, j=0;
   for (i = 0; i < 6; i++) {
     for (j = 0; j < 6; j++) {
       fGamma[i][j]      = fHadron[i][j] = fPiZero[i][j] = 0.;
index 970408c6d7ffbbd3b06230abbdeccd5ff8a75db7..49d583d60932c0b9c056f18daf64af5752c5cf29 100644 (file)
@@ -93,7 +93,7 @@ void AliEMCALRawDigit::Print(const Option_t* /*opt*/) const
        printf("===\nDigit id: %4d / %d Time Samples: \n",fId,fNSamples);
        for (Int_t i=0; i < fNSamples; i++) 
        {
-               Int_t timeBin, amp;
+               Int_t timeBin=-1, amp=0;
                GetTimeSample(i, timeBin, amp);
                printf("(%d,%d) ",timeBin,amp);
        }
@@ -107,7 +107,7 @@ Int_t AliEMCALRawDigit::Compare(const TObject* obj) const
        // Compares two digits with respect to its Id
        // to sort according increasing Id
 
-       Int_t rv;
+       Int_t rv=2;
 
        AliEMCALRawDigit* digit = (AliEMCALRawDigit *)obj; 
 
index dad0953c2a27d27373fd384da12d8c1edbb53cd9..bc903e71e0b44b7fdf162ccd947cdb7faf07423b 100644 (file)
@@ -477,7 +477,7 @@ void AliEMCALRawUtils::Raw2Digits(AliRawReader* reader,TClonesArray *digitsArr,
                
                AliDebug(1,Form("Found TRG digit in TRU: %2d ADC: %2d",itru,in.GetColumn()));
                
-               Int_t idtrg;
+               Int_t idtrg=0;
                
                Bool_t isOK = fGeom->GetAbsFastORIndexFromTRU(itru, in.GetColumn(), idtrg);
                
@@ -790,11 +790,11 @@ Double_t AliEMCALRawUtils::RawResponseFunction(Double_t *x, Double_t *par)
   // N:   par[3]
   // ped: par[4]
   //
-  Double_t signal ;
-  Double_t tau =par[2];
-  Double_t n =par[3];
+  Double_t signal = 0. ;
+  Double_t tau = par[2];
+  Double_t n   = par[3];
   Double_t ped = par[4];
-  Double_t xx = ( x[0] - par[1] + tau ) / tau ;
+  Double_t xx  = ( x[0] - par[1] + tau ) / tau ;
 
   if (xx <= 0) 
     signal = ped ;  
@@ -823,9 +823,9 @@ Double_t AliEMCALRawUtils::RawResponseFunctionLog(Double_t *x, Double_t *par)
   // N:   par[3]
   // ped: par[4]
   //
-  Double_t signal ;
-  Double_t tau =par[2];
-  Double_t n =par[3];
+  Double_t signal = 0. ;
+  Double_t tau = par[2];
+  Double_t n   = par[3];
   //Double_t ped = par[4]; // not used
   Double_t xx = ( x[0] - par[1] + tau ) / tau ;
 
index a31a838be444ba2da0f235ec8772125a3fd15a4e..72786d8cb14645f1051949fe3ba1a0c6cfbfbdbe 100644 (file)
@@ -308,7 +308,7 @@ Int_t AliEMCALRecPoint::Compare(const TObject * obj) const
 
   Float_t delta = 1 ; //Width of "Sorting row". 
        
-  Int_t rv ; 
+  Int_t rv = 2 
 
   AliEMCALRecPoint * clu = (AliEMCALRecPoint *)obj ; 
 
@@ -476,7 +476,7 @@ void  AliEMCALRecPoint::EvalDispersion(Float_t logWeight, TClonesArray * digits)
 
   Double_t d = 0., wtot = 0., w = 0.;
   Int_t iDigit=0, nstat=0;
-  AliEMCALDigit * digit ;
+  AliEMCALDigit * digit=0;
        
   // Calculates the dispersion in cell units 
   Double_t etai, phii, etaMean=0.0, phiMean=0.0; 
@@ -633,7 +633,7 @@ void AliEMCALRecPoint::EvalLocalPosition(Float_t logWeight, TClonesArray * digit
        // Calculates the center of gravity in the local EMCAL-module coordinates 
        //  Info("Print", " logWeight %f : cluster energy %f ", logWeight, fAmp); // for testing
                
-       AliEMCALDigit * digit;
+       AliEMCALDigit * digit=0;
        Int_t i=0, nstat=0;
        
        static Double_t dist  = TmaxInCm(Double_t(fAmp));
@@ -711,7 +711,7 @@ void AliEMCALRecPoint::EvalGlobalPosition(Float_t logWeight, TClonesArray * digi
   // Calculates the center of gravity in the global ALICE coordinates 
   //  Info("Print", " logWeight %f : cluster energy %f ", logWeight, fAmp); // for testing
   
-  AliEMCALDigit * digit;
+  AliEMCALDigit * digit=0;
   Int_t i=0, nstat=0;
        
   static Double_t dist  = TmaxInCm(Double_t(fAmp));
@@ -789,8 +789,8 @@ Double_t phiSlope, TClonesArray * digits)
 {
   // Aug 14-16, 2007 - for fit 
   // Aug 31 - should be static ??
-  static Double_t ycorr;
-  static AliEMCALDigit *digit;
+  static Double_t ycorr=0;
+  static AliEMCALDigit *digit=0;
   Int_t i=0, nstat=0;
   Double_t clXYZ[3]={0.,0.,0.}, clRmsXYZ[3]={0.,0.,0.}, xyzi[3], wtot=0., w=0.; 
 
@@ -864,8 +864,8 @@ Bool_t AliEMCALRecPoint::EvalLocalPosition2(TClonesArray * digits, TArrayD &ed)
 Bool_t AliEMCALRecPoint::EvalLocalPositionFromDigits(TClonesArray *digits, TArrayD &ed, TVector3 &locPos)
 {
   // Used when digits should be recalibrated
-  static Double_t deff, w0, esum;
-  static Int_t iDigit;
+  static Double_t deff=0, w0=0, esum=0;
+  static Int_t iDigit=0;
   //  static AliEMCALDigit *digit;
 
   if(ed.GetSize() && (digits->GetEntries()!=ed.GetSize())) return kFALSE;
@@ -883,7 +883,7 @@ Bool_t AliEMCALRecPoint::EvalLocalPositionFromDigits(TClonesArray *digits, TArra
 Bool_t AliEMCALRecPoint::EvalLocalPositionFromDigits(const Double_t esum, const Double_t deff, const Double_t w0, TClonesArray *digits, TArrayD &ed, TVector3 &locPos)
 {
   //Evaluate position of digits in supermodule.
-  static AliEMCALDigit *digit;
+  static AliEMCALDigit *digit=0;
 
   Int_t i=0, nstat=0;
   Double_t clXYZ[3]={0.,0.,0.}, xyzi[3], wtot=0., w=0.; 
@@ -958,9 +958,9 @@ void AliEMCALRecPoint::EvalCoreEnergy(Float_t logWeight, TClonesArray * digits)
   // Unfinished - Nov 15,2006
   // Distance is calculate in (phi,eta) units
 
-  AliEMCALDigit * digit ;
+  AliEMCALDigit * digit = 0 ;
 
-  Int_t iDigit;
+  Int_t iDigit=0;
 
   if (!fLocPos.Mag()) {
     EvalLocalPosition(logWeight, digits);
@@ -998,7 +998,7 @@ void  AliEMCALRecPoint::EvalElipsAxis(Float_t logWeight,TClonesArray * digits)
 
   AliEMCALDigit * digit = 0;
        
-  Double_t etai , phii, w
+  Double_t etai =0, phii=0, w=0
   int nSupMod=0, nModule=0, nIphi=0, nIeta=0;
   int iphi=0, ieta=0;
   for(Int_t iDigit=0; iDigit<fMulDigit; iDigit++) {
@@ -1072,7 +1072,7 @@ void  AliEMCALRecPoint::EvalPrimaries(TClonesArray * digits)
   // have contributed to this RecPoint and calculate deposited energy 
   // for each track
   
-  AliEMCALDigit * digit ;
+  AliEMCALDigit * digit =0;
   Int_t * primArray = new Int_t[fMaxTrack] ;
   Float_t * dEPrimArray = new Float_t[fMaxTrack] ;
 
@@ -1124,7 +1124,7 @@ void  AliEMCALRecPoint::EvalParents(TClonesArray * digits)
 {
   // Constructs the list of parent particles (tracks) which have contributed to this RecPoint
  
-  AliEMCALDigit * digit ;
+  AliEMCALDigit * digit=0 ;
   Int_t * parentArray = new Int_t[fMaxTrack] ;
   Float_t * dEParentArray = new Float_t[fMaxTrack] ;
 
@@ -1253,7 +1253,6 @@ Float_t AliEMCALRecPoint::GetMaximalEnergy(void) const
   Float_t menergy = 0. ;
 
   Int_t iDigit;
-
   for(iDigit=0; iDigit<fMulDigit; iDigit++) {
  
     if(fEnergyList[iDigit] > menergy) 
@@ -1305,11 +1304,11 @@ Int_t  AliEMCALRecPoint::GetNumberOfLocalMax(AliEMCALDigit **  maxAt, Float_t *
   // Calculates the number of local maxima in the cluster using fLocalMaxCut as the minimum
   // energy difference between two local maxima
 
-  AliEMCALDigit * digit ;
-  AliEMCALDigit * digitN ;
+  AliEMCALDigit * digit  = 0;
+  AliEMCALDigit * digitN = 0;
   
-  Int_t iDigitN ;
-  Int_t iDigit ;
+  Int_t iDigitN = 0 ;
+  Int_t iDigit  = 0 ;
 
   for(iDigit = 0; iDigit < fMulDigit; iDigit++)
     maxAt[iDigit] = (AliEMCALDigit*) digits->At(fDigitsList[iDigit])  ;
@@ -1319,7 +1318,7 @@ Int_t  AliEMCALRecPoint::GetNumberOfLocalMax(AliEMCALDigit **  maxAt, Float_t *
       digit = maxAt[iDigit] ;
           
       for(iDigitN = 0; iDigitN < fMulDigit; iDigitN++) {       
-       digitN = (AliEMCALDigit *) digits->At(fDigitsList[iDigitN]) ; 
+        digitN = (AliEMCALDigit *) digits->At(fDigitsList[iDigitN]) ; 
        
        if ( AreNeighbours(digit, digitN) ) {
          if (fEnergyList[iDigit] > fEnergyList[iDigitN] ) {    
@@ -1365,11 +1364,11 @@ Int_t AliEMCALRecPoint::GetPrimaryIndex() const
 void AliEMCALRecPoint::EvalTime(TClonesArray * digits){
   // time is set to the time of the digit with the maximum energy
 
-  Float_t maxE = 0;
-  Int_t maxAt = 0;
+  Float_t maxE  = 0;
+  Int_t   maxAt = 0;
   for(Int_t idig=0; idig < fMulDigit; idig++){
     if(fEnergyList[idig] > maxE){
-      maxE = fEnergyList[idig] ;
+      maxE  = fEnergyList[idig] ;
       maxAt = idig;
     }
   }
@@ -1387,7 +1386,7 @@ void AliEMCALRecPoint::Paint(Option_t *)
   Coord_t x = pos.X()     ;
   Coord_t y = pos.Z()     ;
   Color_t markercolor = 1 ;
-  Size_t  markersize = 1. ;
+  Size_t  markersize  = 1.;
   Style_t markerstyle = 5 ;
   
   if (!gPad->IsBatch()) {
@@ -1405,11 +1404,10 @@ Double_t AliEMCALRecPoint::TmaxInCm(const Double_t e , const Int_t key)
   // e energy in GeV)
   // key  =  0(gamma, default)
   //     !=  0(electron)
-  static Double_t ca = 4.82;  // shower max parameter - first guess; ca=TMath::Log(1000./8.07)
-  static Double_t x0 = 1.23;  // radiation lenght (cm)
-  static Double_t tmax = 0.;   // position of electromagnetic shower max in cm
+  static Double_t ca   = 4.82;  // shower max parameter - first guess; ca=TMath::Log(1000./8.07)
+  static Double_t x0   = 1.23;  // radiation lenght (cm)
+  static Double_t tmax = 0.;    // position of electromagnetic shower max in cm
 
-  tmax = 0.0;
   if(e>0.1) {
     tmax = TMath::Log(e) + ca;
     if      (key==0) tmax += 0.5; 
@@ -1478,8 +1476,7 @@ void AliEMCALRecPoint::Print(Option_t *opt) const
 Double_t  AliEMCALRecPoint::GetPointEnergy() const
 {
   //Returns energy ....
-  static double e;
-  e=0.0;
+  static double e=0.0;
   for(int ic=0; ic<GetMultiplicity(); ic++) e += double(fEnergyList[ic]);
   return e;
 }
index 86fedf03ed482da50f4ddcb0a38f587a36d1e9f2..5ddce2827fe8c889e2dd017803129c9536b45216 100644 (file)
@@ -260,11 +260,11 @@ void AliEMCALSDigitizer::Exec(Option_t *option)
        }
        Int_t nEvents   = fLastEvent - fFirstEvent + 1;
        
-       Int_t ievent;
        Float_t energy=0.; // de * fSampling - 23-nov-04
        rl->LoadKinematics();
        rl->LoadHits("EMCAL");
-       
+  
+  Int_t ievent;
        for (ievent = fFirstEvent; ievent <= fLastEvent; ievent++) {
                rl->GetEvent(ievent);
                TTree * treeS = emcalLoader->TreeS();
index 0f38d5056da4c7c8f6b1b066b9680d6f2a37b66e..7782097a479582a252cc0d52c098d092e5d70da1 100644 (file)
@@ -287,7 +287,7 @@ void AliEMCALSurvey::InitSuperModuleData(const TObjArray *svypts)
   //Center of supermodules
   Float_t *pars = geom->GetSuperModulesPars();
   Double_t rpos = (geom->GetEnvelop(0) + geom->GetEnvelop(1))/2.;
-  Double_t phi, phiRad, xpos, ypos, zpos;
+  Double_t phi=0, phiRad=0, xpos=0, ypos=0, zpos=0;
 
   AliEMCALSuperModuleCoords *idealSM = new AliEMCALSuperModuleCoords[fNSuperModule];
   for (Int_t smodnum = 0; smodnum < geom->GetNumberOfSuperModules(); ++smodnum) {
@@ -475,7 +475,7 @@ void AliEMCALSurvey::InitSuperModuleData(const Double_t *xReal, const Double_t *
   //Center of supermodules
   Float_t *pars = geom->GetSuperModulesPars();
   Double_t rpos = (geom->GetEnvelop(0) + geom->GetEnvelop(1))/2.;
-  Double_t phi, phiRad, xpos, ypos, zpos;
+  Double_t phi=0, phiRad=0, xpos=0, ypos=0, zpos=0;
 
   zpos = pars[2];
 
index 6b9218712bf3eccf608f662cb86c6f703b1ac184..b21a064cd2ba52a6a716afcbe1d04907b7bd0b85 100755 (executable)
@@ -73,7 +73,7 @@ AliEMCALTrack::AliEMCALTrack(const AliESDtrack& t)
        //
 
        // parameters are chosen according to static variable fUseOuterParams
-       Double_t alpha, x, params[5], cov[15];
+       Double_t alpha=0., x=0., params[5], cov[15];
        if (fgUseOuterParams) {
          if(t.GetOuterParam()){
            t.GetOuterExternalParameters(alpha, x, params);
@@ -144,7 +144,7 @@ Int_t AliEMCALTrack::Compare(const TObject *obj) const
        
        AliEMCALTrack *that = (AliEMCALTrack*)obj;
        
-       Double_t thisP[3], thisVal, thatP[3], thatVal;
+       Double_t thisP[3], thisVal=0., thatP[3], thatVal=0.;
        
        if (fgSortByPt) {
                this->GetPxPyPz(thisP);
@@ -179,7 +179,7 @@ Bool_t AliEMCALTrack::PropagateTo(Double_t xk, Double_t d, Double_t x0)
        // the local track reference frame is adjusted accordingly.
        //
                
-       Double_t y;
+       Double_t y=0.;
        Double_t field = GetBz();
        Double_t width = TMath::Pi() / 9.0; // width of TPC/TRD/EMCAL sector (= 20 deg)
        Double_t ymax  = TMath::Abs(xk * TMath::Tan(0.5 * width)); // max allowed Y in local coords at distance xk
@@ -192,7 +192,7 @@ Bool_t AliEMCALTrack::PropagateTo(Double_t xk, Double_t d, Double_t x0)
        if (TMath::Abs(y) <= ymax) return SimplePropagation(xk, d, x0);
        
        // otherwise, try change a sector to find one where the propagation is ok
-       Int_t    i, incr, istart, nloops;
+       Int_t    i=0, incr=0, istart=0, nloops=0;
        Double_t alpha = GetAlpha();
        incr = (y > ymax) ? 1 : -1;
        if (alpha < 0.0) alpha += TMath::TwoPi();
index d8ab4ead65541e931f3536aac37776305f6f9f9f..80e5cf3e3db5d0c28bad41effd31a303a8190df1 100644 (file)
@@ -194,7 +194,7 @@ TTree* AliEMCALTracker::SearchTrueMatches()
        outTree->Branch("indexT", &indexT, "indexT/I");
        outTree->Branch("label",  &label , "label/I");
        
-       Double_t dist;
+       Double_t dist=0.;
        Int_t ic, nClusters = (Int_t)fClusters->GetEntries();
        Int_t it, nTracks = fTracks->GetEntries();
        
@@ -347,9 +347,9 @@ Int_t AliEMCALTracker::LoadTracks(AliESDEvent *esd)
        Int_t nTracks = esd->GetNumberOfTracks();
        fTracks = new TObjArray(0);
        
-       Int_t i, j;
-       Bool_t isKink;
-       Double_t alpha; 
+       Int_t i=0, j=0;
+       Bool_t isKink=kFALSE;
+       Double_t alpha=0.
        for (i = 0; i < nTracks; i++) {
                AliESDtrack *esdTrack = esd->GetTrack(i);
                // set by default the value corresponding to "no match"
@@ -601,8 +601,8 @@ Double_t AliEMCALTracker::CheckPair
                x0 = 0.0;
        }
        if (fNPropSteps) {
-               Int_t i;
-               Double_t r;
+               Int_t i=0;
+               Double_t r=0.;
                cout.setf(ios::fixed);
                cout.precision(5);
                if (isTrue) cout << "Init : " << rt << ' ' << x << ' ' << y << ' ' << z << endl;
@@ -651,10 +651,9 @@ Double_t AliEMCALTracker::CheckPair
        TVector3 vt(x, y, z);
        Double_t angle = TMath::Abs(vc.Angle(vt)) * TMath::RadToDeg();
        // check: where is the track?
-       Double_t r, phiT, phiC;
-       r = TMath::Sqrt(pos[0]*pos[0] + pos[1]*pos[1]);
-       phiT = TMath::ATan2(pos[1], pos[0]) * TMath::RadToDeg();
-       phiC = vc.Phi() * TMath::RadToDeg();
+//     Double_t r    = TMath::Sqrt(pos[0]*pos[0] + pos[1]*pos[1]);
+//     Double_t phiT = TMath::ATan2(pos[1], pos[0]) * TMath::RadToDeg();
+//     Double_t phiC = vc.Phi() * TMath::RadToDeg();
        //cout << "Propagated R, phiT, phiC = " << r << ' ' << phiT << ' ' << phiC << endl;
        
        if (angle > fCutAngle) {
@@ -717,7 +716,7 @@ Double_t AliEMCALTracker::CheckPairV2
        
        Double_t distance = 2.0 * fMaxDist;
        
-       Double_t x0, rho;
+       Double_t x0=0., rho=0.;
        if (fTrackCorrMode == kTrackCorrMMB) {
                Double_t pos1[3], pos2[3], param[6];
                tr->GetXYZ(pos1);
@@ -749,7 +748,7 @@ Double_t AliEMCALTracker::CheckPairV2
        TVector3 vc(cl->X(), cl->Y(), cl->Z());
        // rotate the vector in order to put all clusters on a plane intersecting 
        // vertically the X axis; the angle depends on the sector
-       Double_t clusterRot, clusterPhi = vc.Phi() * TMath::RadToDeg();
+       Double_t clusterRot=0., clusterPhi = vc.Phi() * TMath::RadToDeg();
        if (clusterPhi < 0.0) clusterPhi += 360.0;
        if (clusterPhi < 100.0) {
                clusterRot = -90.0;
@@ -775,7 +774,7 @@ Double_t AliEMCALTracker::CheckPairV2
        // compute the 'phi' coordinate of the intersection point to 
        // the EMCAL surface
        Double_t x = vc.X();
-       Double_t y;
+       Double_t y = 0.;
        track->GetYAt(vc.X(), track->GetBz(), y);
        Double_t tmp = x*TMath::Cos(track->GetAlpha()) - y*TMath::Sin(track->GetAlpha());
        y = x*TMath::Sin(track->GetAlpha()) + y*TMath::Cos(track->GetAlpha());
@@ -821,12 +820,12 @@ Double_t AliEMCALTracker::CheckPairV3
        
        AliEMCALTrack tr(*track);
        
-       Int_t    sector;
+       Int_t    sector=-1;
        Double_t distance = 2.0 * fMaxDist;
-       Double_t dx, dy, dz;
-       Double_t phi, alpha, slope, tgtXnum, tgtXden, sectorWidth = 20.0 * TMath::DegToRad();
-       Double_t xcurr, xprop, param[6] = {0., 0., 0., 0., 0., 0.}, x0, rho, bz;
-       Double_t x[3], x1[3], x2[3];
+       Double_t dx=0., dy=0., dz=0.;
+       Double_t phi=0., alpha=0., slope=0., tgtXnum=0., tgtXden=0., sectorWidth = 20.0 * TMath::DegToRad();
+       Double_t xcurr=0., xprop=0., param[6] = {0., 0., 0., 0., 0., 0.}, x0=0., rho=0., bz=0.;
+       Double_t x[3]= {0., 0., 0.}, x1[3]= {0., 0., 0.}, x2[3]= {0., 0., 0.};
        
        // get initial track position
        xcurr = tr.GetX();
@@ -848,7 +847,7 @@ Double_t AliEMCALTracker::CheckPairV3
        if (!tr.GetXYZAt(xprop, bz, x2)) return distance;
        //AliKalmanTrack::MeanMaterialBudget(x1, x2, param);
        rho = param[0]*param[4];
-       x0 = param[1];
+       x0  = param[1];
        if (!tr.PropagateTo(xprop, x0, rho)) return distance;
        //if (!tr.PropagateTo(xprop, 0.0, 0.0)) return distance;
        
@@ -872,8 +871,8 @@ Bool_t AliEMCALTracker::PropagateToEMCAL(AliEMCALTrack *tr)
        // Propagates the track to the proximity of the EMCAL surface
        //
        
-       Double_t xcurr, xtemp, xprop = 438.0, step = 10.0, param[6], x0, rho, bz;
-       Double_t x1[3], x2[3];
+       Double_t xcurr=0., xtemp=0., xprop = 438.0, step = 10.0, param[6]= {0., 0., 0., 0., 0., 0.}, x0=0., rho=0., bz=0.;
+       Double_t x1[3]= {0., 0., 0.}, x2[3]= {0., 0., 0.};
        
        // get initial track position
        xcurr = tr->GetX();
@@ -917,11 +916,11 @@ Int_t AliEMCALTracker::CreateMatches()
        
        // initialize counters and indexes
        Int_t count = 0;
-       Int_t ic, nClusters = (Int_t)fClusters->GetEntries();
-       Int_t it, nTracks = fTracks->GetEntries();
+       Int_t ic=0, nClusters = (Int_t)fClusters->GetEntries();
+       Int_t it=0, nTracks = fTracks->GetEntries();
        
        // external loop on clusters, internal loop on tracks
-       Double_t dist;
+       Double_t dist=0.;
        for (ic = 0; ic < nClusters; ic++) {
                AliEMCALMatchCluster *cluster = (AliEMCALMatchCluster*)fClusters->At(ic);
                for (it = 0; it < nTracks; it++) {
@@ -964,8 +963,8 @@ Int_t AliEMCALTracker::SolveCompetitions()
        Int_t count = 0;
        
        // initialize flags to check repetitions
-       Int_t ic, nClusters = (Int_t)fClusters->GetEntries();
-       Int_t it, nTracks = fTracks->GetEntries();
+       Int_t ic=0, nClusters = (Int_t)fClusters->GetEntries();
+       Int_t it=0, nTracks = fTracks->GetEntries();
        Bool_t *usedC = new Bool_t[nClusters];
        Bool_t *usedT = new Bool_t[nTracks];
        for (ic = 0; ic < nClusters; ic++) usedC[ic] = kFALSE;
@@ -1016,7 +1015,7 @@ TVector3 AliEMCALTracker::FindExtrapolationPoint(Double_t x,Double_t y,Double_t
   if (!tr->PropagateToGlobal(x,y,z, 0.0, 0.0)) {
     return error;
   }
-  Double_t pos[3];
+  Double_t pos[3]= {0., 0., 0.};
   tr->GetXYZ(pos);
   TVector3 ExTrPos(pos[0],pos[1],pos[2]);
   return ExTrPos;
@@ -1068,7 +1067,7 @@ AliEMCALTracker::AliEMCALMatchCluster::AliEMCALMatchCluster(Int_t index, AliESDC
        // Translates an AliESDCaloCluster object into the internal format.
        // Index of passed cluster in its native array must be specified.
        //
-       Float_t clpos[3];
+       Float_t clpos[3]= {0., 0., 0.};
        caloCluster->GetPosition(clpos);
        
        fX = (Double_t)clpos[0];
index 52c48c1dd60a5c9ff93012286a704b3460c2bffb..7b2be756b7f85c688b985a060ac649bf8efee21d 100644 (file)
@@ -92,10 +92,10 @@ void AliEMCALv1::AddHit(Int_t shunt, Int_t primary, Int_t tracknumber, Int_t ipa
     // Add a hit to the hit list.
     // An EMCAL hit is the sum of all hits in a tower section
     //   originating from the same entering particle 
-    Int_t hitCounter;
+    Int_t hitCounter=0;
     
-    AliEMCALHit *newHit;
-    AliEMCALHit *curHit;
+    AliEMCALHit *newHit=0;
+    AliEMCALHit *curHit=0;
     Bool_t deja = kFALSE;
 
     newHit = new AliEMCALHit(shunt, primary, tracknumber, iparent, ienergy, id, hits, p);
@@ -122,7 +122,7 @@ void AliEMCALv1::AddHit(Int_t shunt, Int_t primary, Int_t tracknumber, Int_t ipa
 void AliEMCALv1::StepManager(void){
   // Accumulates hits as long as the track stays in a tower
 
-  Int_t          id[2];           // (phi, Eta) indices
+  Int_t          id[2]={0,0};           // (phi, Eta) indices
   // position wrt MRS and energy deposited
   Float_t        xyzte[5]={0.,0.,0.,0.,0.};// position wrt MRS, time and energy deposited
   Float_t        pmom[4]={0.,0.,0.,0.};
@@ -134,8 +134,8 @@ void AliEMCALv1::StepManager(void){
   
   AliEMCALGeometry * geom = GetGeometry() ; 
 
-  TParticle *part;
-  Int_t parent;
+  TParticle *part=0;
+  Int_t parent=-1;
 
   static Int_t idXPHI = gMC->VolId("XPHI");
   if(gMC->CurrentVolID(copy) == idXPHI ) { // We are in a Scintillator Layer 
@@ -215,7 +215,7 @@ void AliEMCALv1::StepManager(void){
          else
            birkC1Mod=fBirkC1;
        }
-       Float_t dedxcm;
+       Float_t dedxcm=0.;
        if (gMC->TrackStep()>0) 
          dedxcm=1000.*gMC->Edep()/gMC->TrackStep();
        else
index 4ca0f071d6ed276f06ec420671c60566e8b54ae4..4f93f9fc40300ad856e66a54adc6909f802333e6 100644 (file)
@@ -89,11 +89,9 @@ void AliEMCALv2::AddHit(Int_t shunt, Int_t primary, Int_t tracknumber, Int_t ipa
     // Add a hit to the hit list.
     // An EMCAL hit is the sum of all hits in a tower section
     //   originating from the same entering particle 
-    static Int_t hitCounter;
-    static AliEMCALHit *newHit, *curHit;
-    static Bool_t deja;
-
-    deja = kFALSE;
+    static Int_t hitCounter=0.;
+    static AliEMCALHit *newHit=0, *curHit=0;
+    static Bool_t deja=kFALSE;
 
     newHit = new AliEMCALHit(shunt, primary, tracknumber, iparent, ienergy, id, hits, p);
     for ( hitCounter = fNhits-1; hitCounter >= 0 && !deja; hitCounter-- ) {
@@ -127,8 +125,8 @@ void AliEMCALv2::StepManager(void){
   static TLorentzVector pos;  // Lorentz vector of the track current position.
   static TLorentzVector mom;  // Lorentz vector of the track current momentum.
   static Float_t ienergy = 0; // part->Energy();
-  static TString curVolName;
-  static int supModuleNumber, moduleNumber, yNumber, xNumber, absid;
+  static TString curVolName="";
+  static int supModuleNumber=-1, moduleNumber=-1, yNumber=-1, xNumber=-1, absid=-1;
   static int keyGeom=1;  //real TRD1 geometry
   static const char *vn = "SCMX"; // Apr 13, 2006 - only TRD1 case now
   static int nSMOP[7]={1,3,5,7,9,11}; // 30-mar-05
@@ -146,8 +144,8 @@ void AliEMCALv2::StepManager(void){
     if(gMC->VolId("WSUC")==1) printf(" WSUC - cosmic ray stand geometry \n");
   }
   Int_t tracknumber =  gAlice->GetMCApp()->GetCurrentTrackNumber();
-  Int_t parent;
-  TParticle* part;
+  Int_t parent=0;
+  TParticle* part=0;
 
   curVolName = gMC->CurrentVolName();
   if(curVolName.Contains(vn) || curVolName.Contains("SCX")) { // We are in a scintillator layer; SCX for 3X3
@@ -271,7 +269,7 @@ void AliEMCALv2::StepManager(void){
          else                                   birkC1Mod = fBirkC1;
        }
 
-       Float_t dedxcm;
+       Float_t dedxcm=0.;
        if (gMC->TrackStep()>0)  dedxcm=1000.*gMC->Edep()/gMC->TrackStep();
        else                     dedxcm=0;
        lightYield=lightYield/(1.+birkC1Mod*dedxcm+fBirkC2*dedxcm*dedxcm);
@@ -454,7 +452,7 @@ void AliEMCALv2::DrawAlicWithHits(int mode)
   TClonesArray *hits = Hits();
   Int_t nhits = hits->GetEntries(), absId, nSupMod, nModule, nIphi, nIeta, iphi, ieta;
   AliEMCALHit *hit = 0;
-  Double_t de, des=0.;
+  Double_t de=0., des=0.;
   for(Int_t i=0; i<nhits; i++) {
     hit   = (AliEMCALHit*)hits->UncheckedAt(i);
     absId = hit->GetId();
index ba25771c8706d9fc7343cbe26741af173edf6a1a..92efeee66384f50e64fdfeafa4052c844ac3b966 100644 (file)
@@ -93,15 +93,13 @@ void AliEMCALv3::AddHit(Int_t shunt, Int_t primary, Int_t tracknumber, Int_t ipa
     // Add a hit to the hit list.
     // An EMCAL hit is the sum of all hits in a tower section
     //   originating from the same entering particle 
-    static Int_t hitCounter;
-    static AliEMCALHitv1 *newHit, *curHit;
-    static Bool_t deja;
-
-    deja = kFALSE;
+    static Int_t hitCounter=0;
+    static AliEMCALHitv1 *newHit=0, *curHit=0;
+    static Bool_t deja = kFALSE;
 
     newHit = new AliEMCALHitv1(shunt, primary, tracknumber, iparent, ienergy, id, hits, p);
     for ( hitCounter = fNhits-1; hitCounter >= 0 && !deja; hitCounter-- ) {
-       curHit = (AliEMCALHitv1*) (*fHits)[hitCounter];
+      curHit = (AliEMCALHitv1*) (*fHits)[hitCounter];
        // We add hits with the same tracknumber, while GEANT treats
        // primaries succesively
        if(curHit->GetPrimary() != primary) 
@@ -130,8 +128,8 @@ void AliEMCALv3::StepManager(void){
   static TLorentzVector pos; // Lorentz vector of the track current position.
   static TLorentzVector mom; // Lorentz vector of the track current momentum.
   static Float_t ienergy = 0;
-  static TString curVolName;
-  static int supModuleNumber, moduleNumber, yNumber, xNumber, absid;
+  static TString curVolName="";
+  static int supModuleNumber=-1, moduleNumber=-1, yNumber=-1, xNumber=-1, absid=-1;
   static int keyGeom=0;
   static char *vn = "SX"; // 15-mar-05
   static int nSMOP[7]={1,3,5,7,9,11}; // 30-mar-05
@@ -234,7 +232,7 @@ void AliEMCALv3::StepManager(void){
          else                                    BirkC1_mod=fBirkC1;
        }
 
-       Float_t dedxcm;
+       Float_t dedxcm=0;
        if (gMC->TrackStep()>0)  dedxcm=1000.*gMC->Edep()/gMC->TrackStep();
        else                     dedxcm=0;
        lightYield=lightYield/(1.+BirkC1_mod*dedxcm+fBirkC2*dedxcm*dedxcm);