AliAnalysisTaskTriggerStudy:
authormfloris <mfloris@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 8 Nov 2010 10:16:02 +0000 (10:16 +0000)
committermfloris <mfloris@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 8 Nov 2010 10:16:02 +0000 (10:16 +0000)
- fixed bug in trigger overlap histo (last bin was missing)
- changed binning and added few more histos
All rest:
- minor changes needed to run on real data, usually if-ed

PWG0/multPbPb/AliAnalysisTaskMultPbTracks.cxx
PWG0/multPbPb/AliAnalysisTaskTriggerStudy.cxx
PWG0/multPbPb/AliAnalysisTaskTriggerStudy.h
PWG0/multPbPb/run.C
PWG0/multPbPb/run.sh

index ce2a2de..8076d0c 100644 (file)
@@ -18,7 +18,7 @@
 #include "AliMCParticle.h"
 #include "AliGenEventHeader.h"
 #include "AliESDCentrality.h"
-
+#include "AliMultiplicity.h"
 #include <iostream>
 #include "AliAnalysisMultPbCentralitySelector.h"
 
@@ -308,6 +308,8 @@ void AliAnalysisTaskMultPbTracks::UserExec(Option_t *)
   //  cout << acceptedTracks << endl;
   
   hNTracks[AliAnalysisMultPbTrackHistoManager::kHistoRec]  ->Fill(acceptedTracks);
+  // FIXME
+  //  hNTracks[AliAnalysisMultPbTrackHistoManager::kHistoRec]  ->Fill(fESD->GetMultiplicity()->GetNumberOfTracklets());
 
 
 }
index 1983082..5e7030e 100644 (file)
@@ -27,7 +27,8 @@ using namespace std;
 
 ClassImp(AliAnalysisTaskTriggerStudy)
 
-const char * AliAnalysisTaskTriggerStudy::kVDNames[] = {"C0SM1","C0SM2","C0VBA","C0VBC","C0OM2"};       
+//const char * AliAnalysisTaskTriggerStudy::kVDNames[] = {"C0SM1","C0SM2","C0VBA","C0VBC","C0OM2"};       
+const char * AliAnalysisTaskTriggerStudy::kVDNames[] = {"C0SM1","C0SM2","C0VBA","C0VBC"};//,"C0OM2"};       
 
 AliAnalysisTaskTriggerStudy::AliAnalysisTaskTriggerStudy()
 : AliAnalysisTaskSE("TaskTriggerStudy"),
@@ -145,10 +146,17 @@ void AliAnalysisTaskTriggerStudy::UserExec(Option_t *)
   vdArray[kVDC0MBS2] = c0sm2;
   vdArray[kVDC0VBA]  = c0v0A;
   vdArray[kVDC0VBC]  = c0v0C;
-  vdArray[kVDC0OM2]  = c0OM2;
+  //vdArray[kVDC0OM2]  = c0OM2;
 
   FillTriggerOverlaps("All", "All Events",vdArray);
   
+  // Fill some combination of trigger classes
+  Bool_t cmbs1aOnline = fESD->IsTriggerClassFired("CMBS1A-B-NOPF-ALL");
+  Bool_t cmbs1cOnline = fESD->IsTriggerClassFired("CMBS1C-B-NOPF-ALL");
+  Bool_t cmbacOnline  = fESD->IsTriggerClassFired("CMBAC-B-NOPF-ALL");
+  
+  if (cmbs1aOnline || cmbs1cOnline ||cmbacOnline) GetHistoTracklets("TwoOutOfThree" ,"Events 2-out-of-3 online" )->Fill(ntracklets);
+
 
   // loop over trigger classes in the event
   TObjArray * tokens = 0;
@@ -161,11 +169,20 @@ void AliAnalysisTaskTriggerStudy::UserExec(Option_t *)
   }
   else {  
     TString trgClasses = fESD->GetFiredTriggerClasses();
-    tokens = trgClasses.Tokenize(" ");
+    tokens = trgClasses.Tokenize("  ");
   }
-  TIter iter(tokens);
-    
-  while(TObjString * tok = (TObjString*) iter.Next()){
+  TIterator  * iter = (TIterator*) tokens->MakeIterator();
+  
+  TString classes = fESD->GetFiredTriggerClasses();
+
+  // if (classes.Contains("SMH")) {
+  //    tokens->Print();
+  //    cout << classes.Data() << endl;
+  // }
+  //  iter->Reset();
+  Int_t itoken = 0;
+  TObjString * tok=0;
+  while((tok = (TObjString*) iter->Next())){
     // clean up trigger name
     TString trg = tok->GetString();
     trg.Strip(TString::kTrailing, ' ');
@@ -174,6 +191,14 @@ void AliAnalysisTaskTriggerStudy::UserExec(Option_t *)
     fHistoSuffix = "_";
     fHistoSuffix += trg;
 
+    //    cout << itoken++ << " " << trg.Data() << endl;
+    // continue;
+    //    if (trg.Contains("SMH")) cout << itoken++ << " " << trg.Data() << endl;
+    
+    // Fill tracklets 
+    GetHistoTracklets("All" ,"Events no offline trigger" )->Fill(ntracklets);
+
+
     // Fill histograms mismatchs
     // TODO: check mismatch trigger class 
     if(nFastOrOffline != nFastOrOnline) {
@@ -209,8 +234,8 @@ void AliAnalysisTaskTriggerStudy::UserExec(Option_t *)
     // Fill trigger overlaps
     FillTriggerOverlaps("All", "All Events in trigger class",vdArray);
 
-    delete tokens;
   }
+  delete tokens;
     
     // if (fIsMC) {
     
@@ -274,7 +299,8 @@ TH1 *   AliAnalysisTaskTriggerStudy::GetHistoTracklets(const char * name, const
     AliInfo(Form("Booking histo %s",hname.Data()));
     Bool_t oldStatus = TH1::AddDirectoryStatus();
     TH1::AddDirectory(kFALSE);
-    h = new TH1F (hname.Data(), title, 50, 0.5, 200);
+    // h = new TH1F (hname.Data(), title, 1000, -0.5, 10000-0.5);
+    h = new TH1F (hname.Data(), title, 4000, -0.5, 4000-0.5);
     h->Sumw2();
     h->SetXTitle("ntracklets");
     fHistoList->GetList()->Add(h);
@@ -300,7 +326,8 @@ void AliAnalysisTaskTriggerStudy::FillTriggerOverlaps (const char * name, const
     for(Int_t ientry = 0; ientry < kNVDEntries; ientry++){
       nbins = nbins | (1<<ientry);
     }
-    
+    //    cout << "NBINS " << nbins << endl;
+    nbins = nbins+1;
     h = new TH1I (hname, title, nbins, -0.5, nbins-0.5);
     fHistoList->GetList()->Add(h);
     TH1::AddDirectory(oldStatus);
index 19d37f0..759606f 100644 (file)
@@ -22,7 +22,8 @@ class AliAnalysisTaskTriggerStudy : public AliAnalysisTaskSE {
   // offline trigger enum
   enum {kC0MBS1,kC0MBS2,kC0MBS3,kC0MBS4,kC0MBS5,kC0VBA,kC0VBC,kC0OM2,kCO0M3};
   // enum for triggers to be included in the venn-like histogram
-  enum {kVDC0MBS1,kVDC0MBS2,kVDC0VBA,kVDC0VBC,kVDC0OM2,kNVDEntries};
+  //  enum {kVDC0MBS1,kVDC0MBS2,kVDC0VBA,kVDC0VBC,kVDC0OM2,kNVDEntries};
+  enum {kVDC0MBS1,kVDC0MBS2,kVDC0VBA,kVDC0VBC,kNVDEntries};
     
 public:
 
index 21795a4..3660457 100644 (file)
@@ -53,7 +53,7 @@ void run(Char_t* data, Long64_t nev = -1, Long64_t offset = 0, Bool_t debug = kF
 
   // physics selection
   gROOT->ProcessLine(".L $ALICE_ROOT/ANALYSIS/macros/AddTaskPhysicsSelection.C");
-  physicsSelectionTask = AddTaskPhysicsSelection(isMC);
+  physicsSelectionTask = AddTaskPhysicsSelection(isMC,1);
   // FIXME!!
   if(!isMC) {
     AliPhysicsSelection * physSel = physicsSelectionTask->GetPhysicsSelection();
@@ -66,8 +66,10 @@ void run(Char_t* data, Long64_t nev = -1, Long64_t offset = 0, Bool_t debug = kF
 
   // Centrality
   AliCentralitySelectionTask *taskCentr = new AliCentralitySelectionTask("CentralitySelection");
-  const char * file1 = "$ALICE_ROOT/ANALYSIS/macros/test_AliCentralityBy1D.root";
-  const char * file2 = "$ALICE_ROOT/ANALYSIS/macros/test_AliCentralityByFunction.root";
+  // const char * file1 = "$ALICE_ROOT/ANALYSIS/macros/test_AliCentralityBy1D.root";
+  // const char * file2 = "$ALICE_ROOT/ANALYSIS/macros/test_AliCentralityByFunction.root";
+  const char * file1 = "$ALICE_ROOT/ANALYSIS/macros/AliCentralityBy1D_LHC10g2a_100.root";
+  const char * file2 = "$ALICE_ROOT/ANALYSIS/macros/AliCentralityByFunction_LHC10g2a_100.root";
   taskCentr->SetPercentileFile (file1);
   taskCentr->SetPercentileFile2(file2);
   mgr->AddTask(taskCentr);
@@ -80,7 +82,7 @@ void run(Char_t* data, Long64_t nev = -1, Long64_t offset = 0, Bool_t debug = kF
   centrSelector->SetCentralityEstimator(centrEstimator);
   // FIXME!!!
   // centrSelector->SetUseMultRange();
-  // centrSelector->SetIsMC(isMC,1000,2000);
+  centrSelector->SetIsMC(isMC,1500,2300);
   //  centrSelector->SetMultRange(10,20);
 
   // Parse option strings
@@ -136,9 +138,9 @@ void run(Char_t* data, Long64_t nev = -1, Long64_t offset = 0, Bool_t debug = kF
     cout << "Setting custom suffix: " << customSuffix << endl;    
     task->GetHistoManager()->SetSuffix(customSuffix);
   }
-  
+  //  task->SelectCollisionCandidates(AliVEvent::kUserDefined);
   if (!mgr->InitAnalysis()) return;
-       
+  
   mgr->PrintStatus();
   
   if (runMode == kMyRunModeLocal ) {
@@ -156,6 +158,8 @@ void run(Char_t* data, Long64_t nev = -1, Long64_t offset = 0, Bool_t debug = kF
   }
 
   pathsuffix = pathsuffix + "_" + centrEstimator + "_bin_"+long(centrBin);
+  pathsuffix += customSuffix;
+
   if (doSave) MoveOutput(data, pathsuffix.Data());
 
   
index 004fef6..3182814 100755 (executable)
@@ -6,7 +6,7 @@ run=no
 correct=no
 nev=-1
 offset=0
-debug=kFALSE
+debug=kTRUE
 runmode=1
 dataset=/alice/sim/LHC10f8a_130844
 ropt="-l"