]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
- adding classes to take care of the loading of the correct physics
authorodjuvsla <odjuvsla@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 7 Dec 2010 11:55:20 +0000 (11:55 +0000)
committerodjuvsla <odjuvsla@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 7 Dec 2010 11:55:20 +0000 (11:55 +0000)
selections
- the physics selection is loaded from a root file containing the
 relevant physics selections

PWG4/totEt/AliAnalysisEtSelectionContainer.cxx [new file with mode: 0644]
PWG4/totEt/AliAnalysisEtSelectionContainer.h [new file with mode: 0644]
PWG4/totEt/AliAnalysisEtSelectionHandler.cxx [new file with mode: 0644]
PWG4/totEt/AliAnalysisEtSelectionHandler.h [new file with mode: 0644]

diff --git a/PWG4/totEt/AliAnalysisEtSelectionContainer.cxx b/PWG4/totEt/AliAnalysisEtSelectionContainer.cxx
new file mode 100644 (file)
index 0000000..0cc1bc1
--- /dev/null
@@ -0,0 +1,40 @@
+#include "AliAnalysisEtSelectionContainer.h"
+#include "TNamed.h"
+
+ClassImp(AliAnalysisEtSelectionContainer)
+
+AliAnalysisEtSelectionContainer::AliAnalysisEtSelectionContainer() : TNamed("name", "name")
+,fPhysicsSelectionMap()
+{
+
+}
+
+
+AliAnalysisEtSelectionContainer::AliAnalysisEtSelectionContainer(const char *name): TNamed(name, name)
+,fPhysicsSelectionMap()
+{
+
+}
+
+AliAnalysisEtSelectionContainer::AliAnalysisEtSelectionContainer(const AliAnalysisEtSelectionContainer& other): 
+  TNamed(other)
+  ,fPhysicsSelectionMap(other.GetPhysicsSelectionMap())
+{
+  // Copy constructor
+}
+
+AliAnalysisEtSelectionContainer& AliAnalysisEtSelectionContainer::operator=(const AliAnalysisEtSelectionContainer& other)
+{
+  // Assignment operator
+  if(this != &other)
+  {
+    fName = other.GetName();
+    fPhysicsSelectionMap = other.GetPhysicsSelectionMap();
+  }
+  return *this;    
+}
+
+AliAnalysisEtSelectionContainer::~AliAnalysisEtSelectionContainer()
+{
+  //Destructor
+}
diff --git a/PWG4/totEt/AliAnalysisEtSelectionContainer.h b/PWG4/totEt/AliAnalysisEtSelectionContainer.h
new file mode 100644 (file)
index 0000000..4a2e2b4
--- /dev/null
@@ -0,0 +1,52 @@
+#ifndef ALIANALYSISETSELECTIONCONTAINER_H
+#define ALIANALYSISETSELECTIONCONTAINER_H
+
+#include "TNamed.h"
+#include <map>
+
+
+class AliPhysicsSelection;
+
+class AliAnalysisEtSelectionContainer : public TNamed
+{
+public:
+  
+  /** Constructor */
+  AliAnalysisEtSelectionContainer();
+
+  /** Constructor */
+  AliAnalysisEtSelectionContainer(const char *name);
+  
+  /** Destructor */
+  virtual ~AliAnalysisEtSelectionContainer();
+  
+  /** Return the physics selection for the current run */
+  AliPhysicsSelection* GetPhysicsSelection(Int_t runNumber) { return fPhysicsSelectionMap[runNumber]; }
+  
+  /** Return the physics selection for the current run */
+  AliPhysicsSelection* GetDefaultPhysicsSelection() { return fPhysicsSelectionMap[0]; }
+  
+  /** Get the map */
+  std::map<int, AliPhysicsSelection*> GetPhysicsSelectionMap() const { return fPhysicsSelectionMap; }
+  
+  /** Add the default selection to the map */
+  void AddDefaultSelection(AliPhysicsSelection *selection) { fPhysicsSelectionMap.insert(std::pair<int, AliPhysicsSelection*>(0, selection)); }
+  
+  /** Add a physics selection to the map */
+  void AddPhysicsSelection(AliPhysicsSelection *selection, Int_t runNumber) { fPhysicsSelectionMap.insert(std::pair<int, AliPhysicsSelection*>(runNumber, selection)); }
+  
+  /** Copy constructor */
+  AliAnalysisEtSelectionContainer(const AliAnalysisEtSelectionContainer& other);
+  
+  /** Assignment operator */
+  AliAnalysisEtSelectionContainer& operator=(const AliAnalysisEtSelectionContainer& other);
+  
+private:
+  
+  std::map<int, AliPhysicsSelection*> fPhysicsSelectionMap; // The physics selection map
+
+  ClassDef(AliAnalysisEtSelectionContainer, 1);
+  
+};
+
+#endif // ALIANALYSISETSELECTIONCONTAINER_H
diff --git a/PWG4/totEt/AliAnalysisEtSelectionHandler.cxx b/PWG4/totEt/AliAnalysisEtSelectionHandler.cxx
new file mode 100644 (file)
index 0000000..de98aba
--- /dev/null
@@ -0,0 +1,44 @@
+#include "AliAnalysisEtSelectionHandler.h"
+#include "AliAnalysisEtSelectionContainer.h"
+#include "AliPhysicsSelection.h"
+#include "TFile.h"
+#include <iostream>
+
+ClassImp(AliAnalysisEtSelectionHandler);
+
+
+AliAnalysisEtSelectionHandler::AliAnalysisEtSelectionHandler() :
+fSelections(0)
+{
+
+}
+
+AliAnalysisEtSelectionHandler::AliAnalysisEtSelectionHandler(const char* name) : 
+fSelections(0)
+{
+  // Constructor
+  TFile *mapFile = TFile::Open(name);
+  
+  //mapFile->Open(name);
+  std::cout  << name << " " << mapFile << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl;
+  mapFile->ls();
+  fSelections = dynamic_cast<AliAnalysisEtSelectionContainer*>(mapFile->Get("physicsSelections"));
+  
+}
+
+AliAnalysisEtSelectionHandler::~AliAnalysisEtSelectionHandler()
+{
+  // Destructor
+}
+
+AliAnalysisEtSelectionHandler::AliAnalysisEtSelectionHandler(const AliAnalysisEtSelectionHandler& other): TObject(other)
+,fSelections(other.GetSelectionContainer())
+{
+  // Copy constructor
+}
+
+AliAnalysisEtSelectionHandler& AliAnalysisEtSelectionHandler::operator=(const AliAnalysisEtSelectionHandler& /*other*/)
+{
+  // Assignment operator, not properly implemented
+  return *this;
+}
diff --git a/PWG4/totEt/AliAnalysisEtSelectionHandler.h b/PWG4/totEt/AliAnalysisEtSelectionHandler.h
new file mode 100644 (file)
index 0000000..1098762
--- /dev/null
@@ -0,0 +1,41 @@
+#ifndef ALIANALYSISETSELECTIONHANDLER_H
+#define ALIANALYSISETSELECTIONHANDLER_H
+
+#include "TObject.h"
+#include "AliAnalysisEtSelectionContainer.h"
+
+class AliPhysicsSelection;
+
+class AliAnalysisEtSelectionHandler : public TObject
+{
+
+public:
+    AliAnalysisEtSelectionHandler();    
+  
+    AliAnalysisEtSelectionHandler(const char *name);
+    
+    virtual ~AliAnalysisEtSelectionHandler();
+    
+    AliPhysicsSelection* GetPhysicsSelection(Int_t runNumber) { return fSelections->GetPhysicsSelection(runNumber); }
+    
+    AliPhysicsSelection* GetDefaultPhysicsSelection() { return fSelections->GetDefaultPhysicsSelection(); }
+    
+    AliAnalysisEtSelectionContainer* GetSelectionContainer() const { return fSelections; }
+
+    AliAnalysisEtSelectionHandler(const AliAnalysisEtSelectionHandler& other);
+    
+    AliAnalysisEtSelectionHandler& operator=(const AliAnalysisEtSelectionHandler& other);
+    
+    private:
+  
+    AliAnalysisEtSelectionContainer *fSelections; //! The selection container
+  
+
+    
+    
+    ClassDef(AliAnalysisEtSelectionHandler, 1);
+    
+    
+};
+
+#endif // ALIANALYSISETSELECTIONHANDLER_H