]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PHOS/AliPHOSTrigger.cxx
fixing small memory leak
[u/mrichter/AliRoot.git] / PHOS / AliPHOSTrigger.cxx
index 2bcbe394c5bcc5b25a1ea48e3cda35c31b9ce9ff..f63ede68440c3912186eaadb2bb3dad495f8fdf8 100644 (file)
@@ -159,7 +159,7 @@ void AliPHOSTrigger::CreateInputs()
 
    TString name = GetName();
    
-   fInputs.AddLast( new AliTriggerInput( "PHOS_L0",       name, 0 ) );
+   fInputs.AddLast( new AliTriggerInput( "0PH0",       name, 0 ) );
    fInputs.AddLast( new AliTriggerInput( "PHOS_JetHPt_L1",name, 1 ) );
    fInputs.AddLast( new AliTriggerInput( "PHOS_JetMPt_L1",name, 1 ) );
    fInputs.AddLast( new AliTriggerInput( "PHOS_JetLPt_L1",name, 1 ) );
@@ -246,8 +246,8 @@ void AliPHOSTrigger::FillTRU(const TClonesArray * digits, const AliPHOSGeometry
       Int_t itru  = (row-1) + (col-1)*fNTRUPhi + (relid[0]-1)*fNTRU ;
 
       //Fill TRU matrix with crystal values
-      TMatrixD * amptrus   = dynamic_cast<TMatrixD *>(fAmptrus  ->At(itru)) ;
-      TMatrixD * timeRtrus = dynamic_cast<TMatrixD *>(fTimeRtrus->At(itru)) ;
+      TMatrixD * amptrus   = static_cast<TMatrixD *>(fAmptrus  ->At(itru)) ;
+      TMatrixD * timeRtrus = static_cast<TMatrixD *>(fTimeRtrus->At(itru)) ;
 
       //Calculate row and column of the crystal inside the TRU with number itru
       Int_t irow = (relid[2]-1) - (row-1) *  fNCrystalsPhi;    
@@ -257,7 +257,7 @@ void AliPHOSTrigger::FillTRU(const TClonesArray * digits, const AliPHOSGeometry
       (*timeRtrus)(irow,icol) = timeR ;
 
       //####################MODULE MATRIX ##################
-      TMatrixD * ampmods   = dynamic_cast<TMatrixD *>(fAmpmods->At(relid[0]-1)) ;
+      TMatrixD * ampmods   = static_cast<TMatrixD *>(fAmpmods->At(relid[0]-1)) ;
       (*ampmods)(relid[2]-1,relid[3]-1)   = amp ;
     }
   }
@@ -305,13 +305,13 @@ Bool_t AliPHOSTrigger::IsPatchIsolated(Int_t iPatchType, const Int_t imod, const
   Int_t rowborder = 0;
 
   if(fIsolateInModule){
-    ampmatrix = dynamic_cast<TMatrixD *>(fAmpmods->At(imod)) ;
+    ampmatrix = static_cast<TMatrixD *>(fAmpmods->At(imod)) ;
     rowborder = fNCrystalsPhi*fNTRUPhi;
     colborder = fNCrystalsZ*fNTRUZ;
     AliDebug(2,"Isolate trigger in Module");
   }
   else{
-    ampmatrix = dynamic_cast<TMatrixD *>(fAmptrus->At(itru)) ;
+    ampmatrix = static_cast<TMatrixD *>(fAmptrus->At(itru)) ;
     rowborder = fNCrystalsPhi;
     colborder = fNCrystalsZ;
     AliDebug(2,"Isolate trigger in TRU");
@@ -340,7 +340,7 @@ Bool_t AliPHOSTrigger::IsPatchIsolated(Int_t iPatchType, const Int_t imod, const
 
   AliDebug(2,Form("Type %d, Maximum amplitude %f, patch+isol square %f",iPatchType, maxamp, amp));
 
-  if(TMath::Nint(amp*1E5) < TMath::Nint(maxamp*1E5)){
+  if(amp < maxamp){
     AliError(Form("Bad sum: Type %d, Maximum amplitude %f, patch+isol square %f",iPatchType, maxamp, amp));
     return kFALSE;
   }
@@ -392,8 +392,8 @@ void AliPHOSTrigger::MakeSlidingCell(const Int_t imod, TMatrixD &ampmax2, TMatri
     
   //Loop over all TRUS in a module
   for(Int_t itru = 0 + imod  * fNTRU ; itru < (imod+1)*fNTRU ; itru++){
-    TMatrixD * amptru   = dynamic_cast<TMatrixD *>(fAmptrus  ->At(itru)) ;
-    TMatrixD * timeRtru = dynamic_cast<TMatrixD *>(fTimeRtrus->At(itru)) ;
+    TMatrixD * amptru   = static_cast<TMatrixD *>(fAmptrus  ->At(itru)) ;
+    TMatrixD * timeRtru = static_cast<TMatrixD *>(fTimeRtrus->At(itru)) ;
     Int_t mtru = itru-imod*fNTRU ; //Number of TRU in Module
     
     //Sliding 2x2, add 2x2 amplitudes (NOT OVERLAP)
@@ -501,7 +501,7 @@ void AliPHOSTrigger::Print(const Option_t * opt) const
          fL0Threshold) ;  
   
   printf( "             Threshold for LO %10.2f\n", fL0Threshold) ;  
-  in = (AliTriggerInput*)fInputs.FindObject( "PHOS_L0" );
+  in = (AliTriggerInput*)fInputs.FindObject( "0PH0" );
   if(in->GetValue())
     printf( "             *** PHOS LO is set ***\n") ; 
   
@@ -593,7 +593,7 @@ void AliPHOSTrigger::SetTriggers(const Int_t iMod, const TMatrixD & ampmax2, con
     //Set L0
     for(Int_t i = 0 ; i < nTimeBins ; i++){
       if(fADCValuesHigh2x2[i] >= fL0Threshold || fADCValuesLow2x2[i] >= fL0Threshold) {
-       SetInput("PHOS_L0") ;
+       SetInput("0PH0") ;
        break;
       }
     }
@@ -665,8 +665,8 @@ void AliPHOSTrigger::DoIt()
 {
   // does the trigger job
 
-  AliRunLoader* rl = AliRunLoader::GetRunLoader() ;
-  AliPHOSLoader * phosLoader = dynamic_cast<AliPHOSLoader*>(rl->GetLoader("PHOSLoader"));
+  AliRunLoader* rl = AliRunLoader::Instance() ;
+  AliPHOSLoader * phosLoader = static_cast<AliPHOSLoader*>(rl->GetLoader("PHOSLoader"));
   
   // Get PHOS Geometry object
   AliPHOSGeometry *geom;