Possibility to select the trigger type (Davide)
authordainese <dainese@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 22 Jun 2011 20:42:52 +0000 (20:42 +0000)
committerdainese <dainese@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 22 Jun 2011 20:42:52 +0000 (20:42 +0000)
PWG1/global/AliAnalysisTaskVertexESD.cxx
PWG1/global/AliAnalysisTaskVertexESD.h
PWG1/macros/AddTaskVertexESD.C

index 69e9e66..5a18b94 100644 (file)
@@ -45,7 +45,7 @@
 #include "AliESDtrack.h"
 #include "AliExternalTrackParam.h"
 #include "AliESDVertex.h"
-#include "AliESDEvent.h"
+#include "AliVEvent.h"
 #include "AliESDInputHandler.h"
 #include "AliTrackReference.h"
 //#include "AliTriggerAnalysis.h"
@@ -106,7 +106,8 @@ AliAnalysisTaskSE(name),
   fhSPDVertexDiffZPileContr4(0),
   fhSPDVertexDiffZPileContr5(0),
   fhSPDContributorsPile(0),
-  fhSPDDispContributors(0)
+  fhSPDDispContributors(0),
+  fTriggerType(AliVEvent::kMB) 
 {
   // Constructor
 
@@ -328,13 +329,13 @@ void AliAnalysisTaskVertexESD::UserExec(Option_t *)
   //Bool_t eventTriggered = (triggerMask & spdFO || ((triggerMask & v0left) || (triggerMask & v0right))); 
   //MB2: GFO && V0R
   //triggerMask & spdFO && ((triggerMask&v0left) || (triggerMask&v0right))
-  //Bool_t eventTriggered = (triggerMask & spdFO); 
+  //Bool_t eventTriggered = (triggerMask & spdFO);
  
   //static AliTriggerAnalysis* triggerAnalysis = new AliTriggerAnalysis();
   Bool_t eventTriggered = 0;//triggerAnalysis->IsTriggerFired(esdE, AliTriggerAnalysis::kSPDGFO /*| AliTriggerAnalysis::kOfflineFlag*/); 
 
   // use response of AliPhysicsSelection
-  eventTriggered = ((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected();
+       eventTriggered = (((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & fTriggerType);
 
 
   Int_t nInFile = esdE->GetEventNumberInFile();
index e060cf5..358cdab 100644 (file)
@@ -21,6 +21,7 @@ class TH1F;
 class TH2F;
 class AliESDEvent;
 class AliESDVertex;
+class AliVEvent;
 
 #include "AliAnalysisTaskSE.h"
 
@@ -44,6 +45,7 @@ class AliAnalysisTaskVertexESD : public AliAnalysisTaskSE
   void           SetOnlyITSSATracks() {fOnlyITSSATracks=kTRUE;}
   void           SetFillNtuple(Bool_t fill=kTRUE) {fFillNtuple=fill;}  
   void           SetFillNtupleBeamSpot(Bool_t fillBeamSpot=kFALSE){fFillTreeBeamSpot = fillBeamSpot;}
+  void           SetTriggerType(AliVEvent::EOfflineTriggerTypes triggerType) {fTriggerType = triggerType;}
 
  protected:
   Bool_t       fCheckEventType; // read only events of type 7
@@ -92,6 +94,7 @@ class AliAnalysisTaskVertexESD : public AliAnalysisTaskSE
   TH1F        *fhSPDVertexDiffZPileContr5; //! output histo
   TH1F        *fhSPDContributorsPile; //! output histo
   TH2F        *fhSPDDispContributors; //! output histo
+  AliVEvent::EOfflineTriggerTypes    fTriggerType; //flag to set trigger type
 
  private:    
 
@@ -100,7 +103,7 @@ class AliAnalysisTaskVertexESD : public AliAnalysisTaskSE
   AliESDVertex* ReconstructPrimaryVertexTPC(Bool_t constr=kFALSE) const;
   AliESDVertex* ReconstructPrimaryVertexITSTPC(Bool_t constr=kFALSE,Int_t mode=0) const;
   
-  ClassDef(AliAnalysisTaskVertexESD,9); // primary vertex analysis
+  ClassDef(AliAnalysisTaskVertexESD,10); // primary vertex analysis
 };
 
 #endif
index 2fc7f20..e09909e 100644 (file)
@@ -1,4 +1,4 @@
-AliAnalysisTaskVertexESD *AddTaskVertexESD(Bool_t readMC=kFALSE) 
+AliAnalysisTaskVertexESD *AddTaskVertexESD(Bool_t readMC=kFALSE, AliVEvent::EOfflineTriggerTypes triggerType = AliVEvent::kMB) 
 {
   //
   // Task for validation of the primary vertices (SPD,TPC,ITS+TPC)
@@ -22,6 +22,8 @@ AliAnalysisTaskVertexESD *AddTaskVertexESD(Bool_t readMC=kFALSE)
   taskVtxESD->SetRerecoVertexITSTPCHalfEvent(kFALSE);
   taskVtxESD->SetFillNtupleBeamSpot(kTRUE);
   taskVtxESD->SetRerecoVertexITSTPC(kTRUE);
+  taskVtxESD->SetTriggerType(triggerType);
+       
   AliLog::SetClassDebugLevel("AliAnalysisTaskVertexESD",10);
   // Add to the manager
   mgr->AddTask(taskVtxESD);