]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
adding flag fFracIsThresh to use ptThresh cut or not instead of ptFrac
authorgconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 4 Jun 2012 09:16:49 +0000 (09:16 +0000)
committergconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 4 Jun 2012 09:16:49 +0000 (09:16 +0000)
PWG/CaloTrackCorrBase/AliIsolationCut.cxx
PWG/CaloTrackCorrBase/AliIsolationCut.h

index c68977451e7de3214f844a5304a8d4e84de50d0c..c0b07a1ba08cde50e1c02e4fc58886bce74fe2d8 100755 (executable)
@@ -55,7 +55,8 @@ fSumPtThreshold(0.),
 fPtFraction(0.), 
 fICMethod(0),
 fPartInCone(0),
-fDebug(-1)
+fDebug(-1),
+fFracIsThresh(1)
 {
   //default ctor
   
@@ -171,7 +172,9 @@ TString AliIsolationCut::GetICParametersList()
   parList+=onePar ;
   snprintf(onePar,buffersize,"fPartInCone=%d \n",fPartInCone) ;
   parList+=onePar ;
-  
+ snprintf(onePar,buffersize,"fFracIsThresh=%i \n",fFracIsThresh) ;
+  parList+=onePar ;
   return parList; 
 }
 
@@ -186,7 +189,7 @@ void AliIsolationCut::InitParameters()
   fPtFraction     = 0.1 ; 
   fPartInCone     = kOnlyCharged;
   fICMethod       = kSumPtFracIC; // 0 pt threshol method, 1 cone pt sum method
-  
+  fFracIsThresh   = 1; 
 }
 
 //________________________________________________________________________________
@@ -409,14 +412,19 @@ void  AliIsolationCut::MakeIsolationCut(const TObjArray * plCTS,
         coneptsum+=pt;
         if(pt > fPtThreshold )   n++;
         //if fPtFraction*ptC<fPtThreshold then consider the fPtThreshold directly
-        if(fPtFraction*ptC<fPtThreshold)
-        {
-          if(pt>fPtThreshold)    nfrac++ ;
-        }
-        else 
-        {
-          if(pt>fPtFraction*ptC) nfrac++; 
-        }
+        if(fFracIsThresh){
+         if( fPtFraction*ptC<fPtThreshold)
+           {
+             if(pt>fPtThreshold)    nfrac++ ;
+           }
+         else 
+           {
+            if(pt>fPtFraction*ptC) nfrac++; 
+           }
+       }
+       else {
+         if(pt>fPtFraction*ptC) nfrac++;   
+       }
         
       }//in cone
       
@@ -451,10 +459,16 @@ void  AliIsolationCut::MakeIsolationCut(const TObjArray * plCTS,
   else if( fICMethod == kSumPtFracIC)
   {
     //when the fPtFraction*ptC < fSumPtThreshold then consider the later case
-    if(fPtFraction*ptC < fSumPtThreshold  && coneptsum < fSumPtThreshold) isolated  =  kTRUE ;
-    if(fPtFraction*ptC > fSumPtThreshold  && coneptsum < fPtFraction*ptC) isolated  =  kTRUE ;
+    if(fFracIsThresh ){
+      if(fPtFraction*ptC < fSumPtThreshold  && coneptsum < fSumPtThreshold) isolated  =  kTRUE ;
+      if( fPtFraction*ptC > fSumPtThreshold  && coneptsum < fPtFraction*ptC) isolated  =  kTRUE ;
+    }
+    else 
+      {
+       if(coneptsum < fPtFraction*ptC) isolated  =  kTRUE ;
+      }
   }
 else if( fICMethod == kSumDensityIC)
+ else if( fICMethod == kSumDensityIC)
   {    
     // Get good cell density (number of active cells over all cells in cone)
     // and correct energy in cone
@@ -480,6 +494,7 @@ void AliIsolationCut::Print(const Option_t * opt) const
   printf("pT threshold       =     %2.1f\n", fPtThreshold) ;
   printf("pT fraction        =     %3.1f\n", fPtFraction ) ;
   printf("particle type in cone =  %d\n",    fPartInCone ) ;
+  printf("using fraction for high pt leading instead of frac ? %i\n",fFracIsThresh);
   printf("    \n") ;
   
 } 
index 0424808706b63319f7fb88b5283cebbc3aed8580..6a27fbbe47fc7d349aabf2a05ff18bb3e6bf1e26 100755 (executable)
@@ -62,6 +62,7 @@ class AliIsolationCut : public TObject {
   Float_t    GetPtFraction()          const { return fPtFraction     ; }
   Int_t      GetICMethod()            const { return fICMethod       ; }
   Int_t      GetParticleTypeInCone()  const { return fPartInCone     ; }
+  Bool_t     GetFracIsThresh()        const { return fFracIsThresh   ; }
        
   void       SetConeSize(Float_t r)         { fConeSize       = r    ; }
   void       SetPtThreshold(Float_t pt)     { fPtThreshold    = pt   ; }
@@ -70,6 +71,7 @@ class AliIsolationCut : public TObject {
   void       SetICMethod(Int_t i )          { fICMethod       = i    ; }
   void       SetParticleTypeInCone(Int_t i) { fPartInCone     = i    ; }
   void       SetDebug(Int_t d)              { fDebug          = d    ; }
+  void       SetFracIsThresh(Bool_t f )     { fFracIsThresh   = f    ; }
  private:
   
   Float_t    fConeSize ;       // Size of the isolation cone 
@@ -85,6 +87,7 @@ class AliIsolationCut : public TObject {
                                // kNeutralAndCharged, kOnlyNeutral, kOnlyCharged
 
   Int_t      fDebug;           // Debug level
+  Bool_t     fFracIsThresh;    // Use threshold instead of fraction when pt leading is small
   
   AliIsolationCut(              const AliIsolationCut & g) ; // cpy ctor
   AliIsolationCut & operator = (const AliIsolationCut & g) ; // cpy assignment