Added physics selection with custom triggers to the mult task
authormfloris <mfloris@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 7 Nov 2010 09:33:43 +0000 (09:33 +0000)
committermfloris <mfloris@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 7 Nov 2010 09:33:43 +0000 (09:33 +0000)
PWG0/multPbPb/AliAnalysisMultPbTrackHistoManager.cxx
PWG0/multPbPb/AliAnalysisMultPbTrackHistoManager.h
PWG0/multPbPb/AliAnalysisTaskMultPbTracks.cxx
PWG0/multPbPb/AliAnalysisTaskMultPbTracks.h
PWG0/multPbPb/CreateAlienHandler.C
PWG0/multPbPb/run.C

index ca2aa7a..a3961aa 100644 (file)
@@ -10,7 +10,7 @@
 using namespace std;
 ClassImp(AliAnalysisMultPbTrackHistoManager)
 
-const char * AliAnalysisMultPbTrackHistoManager::kStatStepNames[]     = { "All Events", "After centrality selection", "With Vertex" };
+const char * AliAnalysisMultPbTrackHistoManager::kStatStepNames[]     = { "All Events", "After physics Selection", "After centrality selection", "With Vertex" };
 const char * AliAnalysisMultPbTrackHistoManager::kHistoPtEtaVzNames[] = { "hGenPtEtaVz", "hRecPtEtaVz", "hRecPtEtaVzPrim", 
                                                                          "hRecPtEtaVzSecWeak", "hRecPtEtaVzSecMaterial", "hRecPtEtaVzFake"};
 const char * AliAnalysisMultPbTrackHistoManager::kHistoDCANames[]     = { "hGenDCA", "hRecDCA", "hRecDCAPrim", "hRecDCASecWeak","hRecDCASecMaterial", "hRecDCAFake"};
index f34fddc..37efdef 100644 (file)
@@ -23,7 +23,7 @@ class AliAnalysisMultPbTrackHistoManager : public AliHistoListWrapper {
 public:
 
   typedef enum {kHistoGen, kHistoRec, kHistoRecPrim, kHistoRecSecWeak, kHistoRecSecMat, kHistoRecFake, kNHistos} Histo_t;
-  typedef enum {kStatAll, kStatCentr, kStatVtx, kNStatBins} Stat_t;
+  typedef enum {kStatAll, kStatPhysSel, kStatCentr, kStatVtx, kNStatBins} Stat_t;
 
   AliAnalysisMultPbTrackHistoManager();
   AliAnalysisMultPbTrackHistoManager(const char * name,const char * title);
index 975cf97..ce2a2de 100644 (file)
@@ -135,6 +135,12 @@ void AliAnalysisTaskMultPbTracks::UserExec(Option_t *)
   // FIXME: use physics selection here to keep track of events lost?
   fHistoManager->GetHistoStats()->Fill(AliAnalysisMultPbTrackHistoManager::kStatAll);
 
+  Bool_t isSelected = (((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & fOfflineTrigger);
+
+  if(!isSelected) return;
+  fHistoManager->GetHistoStats()->Fill(AliAnalysisMultPbTrackHistoManager::kStatPhysSel);
+
+
   // Centrality selection
   Bool_t isCentralitySelected = fCentrSelector->IsCentralityBinSelected(fESD,fTrackCuts);  
   if(!isCentralitySelected) return;
index 24a6bb2..024d9f6 100644 (file)
@@ -37,6 +37,7 @@ public:
   void SetIsMC(Bool_t flag=kTRUE) { fIsMC = flag;}
   AliAnalysisMultPbTrackHistoManager * GetHistoManager() { return fHistoManager;}
   Bool_t IsPhysicalPrimaryAndTransportBit(Int_t ipart) ;
+  void SetOfflineTrigger(UInt_t mask) { fOfflineTrigger = mask; }
 
   virtual void   UserCreateOutputObjects();
   virtual void   UserExec(Option_t *option);
@@ -55,12 +56,12 @@ private:
   // TString fCentralityEstimator; // Name of the centrality estimator, for AliESDCentrality
   AliESDtrackCuts * fTrackCuts; // track cuts
   AliESDtrackCuts * fTrackCutsNoDCA; // copy of the previous one, but with no DCA cuts
-  
+  UInt_t fOfflineTrigger ; // offline trigger mask
   Bool_t fIsMC; // true if processing montecarlo
 
   AliAnalysisTaskMultPbTracks& operator=(const AliAnalysisTaskMultPbTracks& task);
   
-  ClassDef(AliAnalysisTaskMultPbTracks, 2)
+  ClassDef(AliAnalysisTaskMultPbTracks, 3)
 
 
 };
index 906ed85..f2e048d 100644 (file)
@@ -48,9 +48,14 @@ AliAnalysisGrid* CreateAlienHandler(TString dataset, TList * listToLoad, const c
    TString sources = "";
    while (name = (TObjString *)iter->Next()) {
      gSystem->ExpandPathName(name->String());
-     name->String().ReplaceAll("+","");     
-     sources = sources + gSystem->BaseName(name->String().Data()) + " ";
+     name->String().ReplaceAll("+","");
+     sources = sources + name->String() + " ";
    }
+   // while (name = (TObjString *)iter->Next()) {
+   //   gSystem->ExpandPathName(name->String());
+   //   name->String().ReplaceAll("+","");     
+   //   sources = sources + gSystem->BaseName(name->String().Data()) + " ";
+   // }
    plugin->SetAnalysisSource(sources.Data());
 // Declare all libraries (other than the default ones for the framework. These will be
 // loaded by the generated analysis macro. Add all extra files (task .cxx/.h) here.
@@ -74,12 +79,12 @@ AliAnalysisGrid* CreateAlienHandler(TString dataset, TList * listToLoad, const c
 
 // Declare the output file names separated by blancs.
 // (can be like: file.root or file.root@ALICE::Niham::File)
-   plugin->SetDefaultOutputs(kFALSE);
+//   plugin->SetDefaultOutputs(kFALSE);
    //   plugin->SetOutputFiles(Form("EventStat_temp.root %s",outfilename));
-   plugin->SetOutputFiles("EventStat_temp.root multPbPbtracks.root");
+   //   plugin->SetOutputFiles("EventStat_temp.root multPbPbtracks.root");
 // Optionally define the files to be archived.
 //   plugin->SetOutputArchive("log_archive.zip:stdout,stderr@ALICE::NIHAM::File root_archive.zip:*.root@ALICE::NIHAM::File");
-   plugin->SetOutputArchive("log_archive.zip:stdout,stderr");
+//   plugin->SetOutputArchive("log_archive.zip:stdout,stderr");
 // Optionally set a name for the generated analysis macro (default MyAnalysis.C)
    plugin->SetAnalysisMacro("AnalysisMultPb.C");
 // Optionally set maximum number of input files/subjob (default 100, put 0 to ignore)
index d5df2ae..21795a4 100644 (file)
@@ -55,13 +55,15 @@ void run(Char_t* data, Long64_t nev = -1, Long64_t offset = 0, Bool_t debug = kF
   gROOT->ProcessLine(".L $ALICE_ROOT/ANALYSIS/macros/AddTaskPhysicsSelection.C");
   physicsSelectionTask = AddTaskPhysicsSelection(isMC);
   // FIXME!!
-  AliPhysicsSelection * physSel = physicsSelectionTask->GetPhysicsSelection();
-  physSel->AddCollisionTriggerClass("+CTRUE-B-NOPF-ALL");
-  physSel->AddCollisionTriggerClass("+C0SM1-A-NOPF-ALL");
-  physSel->AddCollisionTriggerClass("+C0SM1-B-NOPF-ALL");
-  physSel->AddCollisionTriggerClass("+C0SM1-C-NOPF-ALL");
-  physSel->AddCollisionTriggerClass("+C0SM1-E-NOPF-ALL");
-  physSel->SetSkipTriggerClassSelection(kTRUE);
+  if(!isMC) {
+    AliPhysicsSelection * physSel = physicsSelectionTask->GetPhysicsSelection();
+    //    physSel->AddCollisionTriggerClass("+CTRUE-B-NOPF-ALL");
+    physSel->AddCollisionTriggerClass("+C0SM1-B-NOPF-ALL");
+    physSel->AddBGTriggerClass       ("+C0SM1-A-NOPF-ALL");
+    physSel->AddBGTriggerClass       ("+C0SM1-C-NOPF-ALL");
+    physSel->AddBGTriggerClass       ("+C0SM1-E-NOPF-ALL");
+  }
+
   // Centrality
   AliCentralitySelectionTask *taskCentr = new AliCentralitySelectionTask("CentralitySelection");
   const char * file1 = "$ALICE_ROOT/ANALYSIS/macros/test_AliCentralityBy1D.root";
@@ -73,12 +75,12 @@ void run(Char_t* data, Long64_t nev = -1, Long64_t offset = 0, Bool_t debug = kF
 
   // Create my own centrality selector
   AliAnalysisMultPbCentralitySelector * centrSelector = new AliAnalysisMultPbCentralitySelector();
-  centrSelector->SetCentrTaskFiles(file1,file2);
+  centrSelector->SetCentrTaskFiles(file1,file2); // for bookkeping only
   centrSelector->SetCentralityBin(centrBin);
   centrSelector->SetCentralityEstimator(centrEstimator);
   // FIXME!!!
-  centrSelector->SetUseMultRange();
-  centrSelector->SetIsMC(isMC,1000,2000);
+  // centrSelector->SetUseMultRange();
+  // centrSelector->SetIsMC(isMC,1000,2000);
   //  centrSelector->SetMultRange(10,20);
 
   // Parse option strings
@@ -124,6 +126,11 @@ void run(Char_t* data, Long64_t nev = -1, Long64_t offset = 0, Bool_t debug = kF
   gROOT->ProcessLine(".L $ALICE_ROOT/PWG0/multPbPb/AddTaskMultPbPbTracks.C");
   AliAnalysisTaskMultPbTracks * task = AddTaskMultPbPbTracks("multPbPbtracks.root", cuts, centrSelector); // kTRUE enables DCA cut
   task->SetIsMC(useMCKinematics);
+  if (isMC) {
+    task->SetOfflineTrigger(AliVEvent::kMB);
+  } else {
+    task->SetOfflineTrigger(AliVEvent::kUserDefined);
+  }
   if(useMCKinematics) task->GetHistoManager()->SetSuffix("MC");
   if(customSuffix!=""){
     cout << "Setting custom suffix: " << customSuffix << endl;