]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Added AliPHOSClusterSelection::GetCurrentEvent()
authorHenrik Qvigstad <henrik.qvigstad@fys.uio.no>
Thu, 23 Jan 2014 12:04:57 +0000 (13:04 +0100)
committerHenrik Qvigstad <henrik.qvigstad@fys.uio.no>
Thu, 23 Jan 2014 12:04:57 +0000 (13:04 +0100)
PWGGA/PHOSTasks/ClusterSelection/AliPHOSClusterSelection.cxx
PWGGA/PHOSTasks/ClusterSelection/AliPHOSClusterSelection.h

index e402a1da45cdc28998f8f30470c48a74980177c9..6c9443b45f7a15bc0351744cf22ea3b3807fcb2a 100644 (file)
@@ -1,3 +1,25 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/* $Id$ */
+
+#include "AliAnalysisManager.h"
+#include "AliInputEventHandler.h"
+#include "AliMultiInputEventHandler.h"
+#include "AliVEvent.h"
+
 #include "AliPHOSClusterSelection.h"
 
 AliPHOSClusterSelection::AliPHOSClusterSelection()
@@ -65,3 +87,23 @@ Float_t AliPHOSClusterSelection::SetMinChargedParticleTrackDistance(const TStrin
   delete objarray;
   return flt;
 }
+
+
+AliVEvent* AliPHOSClusterSelection::GetCurrentEvent() const
+{
+  // Hackish way of getting the current event.
+  // Its probably not appropriate to call this function outside of
+  // AliAnalysisTaskSE::UserExec
+  
+  AliAnalysisManager* analysisManager = dynamic_cast<AliAnalysisManager*>(AliAnalysisManager::GetAnalysisManager());
+  AliInputEventHandler* inputHandler = dynamic_cast<AliInputEventHandler*>(analysisManager->GetInputEventHandler());
+  AliMultiInputEventHandler *multiInputHandler = dynamic_cast<AliMultiInputEventHandler *>(fInputHandler);
+  if (multiInputHandler)
+    inputHandler = dynamic_cast<AliInputEventHandler *>(multiInputHandler->GetFirstInputEventHandler());
+  
+  AliVEvent* inputEvent = dynamic_cast<AliVEvent*>(inputHandler->GetEvent());
+  if( ! inputEvent ) 
+    AliError("Was not able to retrieve event!");
+  
+  return inputEvent;
+}
index 1d1ac716e7f09f74aa6a8d4648841b8ea66677d5..1d109a7933e67c0e24d39efc200c339ec67deb07 100644 (file)
@@ -13,6 +13,7 @@
 class AliVCluster;
 class AliESDCaloCluster;
 class AliAODCaloCluster;
+class AliVEvent;
 
 #include "TObject.h"
 
@@ -52,6 +53,8 @@ class AliPHOSClusterSelection : TObject {
   Float_t fMaxDispR2; // dispersion cut
   Float_t fMaxDispCoreR2; // dispersion cut of core cells
   Float_t fMaxTOF; // TOF cut
+
+  AliVEvent* GetCurrentEvent() const;
   
   ClassDef(AliPHOSClusterSelection, 1);
 };