additional reset for average trials
authorkleinb <kleinb@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 15 Oct 2009 06:01:09 +0000 (06:01 +0000)
committerkleinb <kleinb@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 15 Oct 2009 06:01:09 +0000 (06:01 +0000)
PWG4/JetTasks/AliAnalysisTaskJFSystematics.cxx
PWG4/JetTasks/AliAnalysisTaskUE.cxx

index f408d63..4735b2f 100644 (file)
@@ -173,6 +173,9 @@ Bool_t AliAnalysisTaskJFSystematics::Notify()
   // Implemented Notify() to read the cross sections
   // and number of trials from pyxsec.root
   // 
+
+  fAvgTrials = 1; // reset for each file
+
   TTree *tree = AliAnalysisManager::GetAnalysisManager()->GetTree();
   Float_t xsection = 0;
   Float_t ftrials  = 1;
@@ -458,9 +461,9 @@ void AliAnalysisTaskJFSystematics::UserExec(Option_t */*option*/)
     }
   }// if we had the MCEvent
 
-  if(nTrials==1&&fAvgTrials>1) fh1Trials->Fill("#sum{ntrials}",fAvgTrials); 
-  else fh1Trials->Fill("#sum{ntrials}",nTrials); 
-
+  
+  fh1Trials->Fill("#sum{ntrials}",fAvgTrials); 
+  
   fh1PtHard->Fill(ptHard,eventW);
   fh1PtHardNoW->Fill(ptHard,1);
   fh1PtHardTrials->Fill(ptHard,nTrials);
index 22aa16b..73770fb 100644 (file)
@@ -151,6 +151,7 @@ Bool_t AliAnalysisTaskUE::Notify()
   // Copy from AliAnalysisTaskJFSystematics
   // 
 
+  fAvgTrials = 1;
   TTree *tree = AliAnalysisManager::GetAnalysisManager()->GetTree();
   Float_t xsection = 0;
   Float_t ftrials  = 1;
@@ -254,9 +255,8 @@ void  AliAnalysisTaskUE::Exec(Option_t */*option*/)
     }
   }
 
-  if(nTrials==1&&fAvgTrials>1) fh1Trials->Fill("#sum{ntrials}",fAvgTrials); 
-  else fh1Trials->Fill("#sum{ntrials}",nTrials); 
-  
+  fh1Trials->Fill("#sum{ntrials}",fAvgTrials); 
+    
 
   AnalyseUE();