]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
add event vertex position and error monitor
authorakisiel <akisiel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 25 Jun 2008 13:00:12 +0000 (13:00 +0000)
committerakisiel <akisiel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 25 Jun 2008 13:00:12 +0000 (13:00 +0000)
PWG2/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorEventVertex.cxx [new file with mode: 0644]
PWG2/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorEventVertex.h [new file with mode: 0644]
PWG2/PWG2femtoscopyLinkDef.h
PWG2/libPWG2femtoscopy.pkg

diff --git a/PWG2/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorEventVertex.cxx b/PWG2/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorEventVertex.cxx
new file mode 100644 (file)
index 0000000..df5b93e
--- /dev/null
@@ -0,0 +1,141 @@
+////////////////////////////////////////////////////////////////////////////////
+//                                                                            //
+// AliFemtoCutMonitorEventVertex - the cut monitor for events to study        //
+// the distribution and error of the primary vertex                           //
+//                                                                            //
+////////////////////////////////////////////////////////////////////////////////
+#include "AliFemtoCutMonitorEventVertex.h"
+#include "AliFemtoModelHiddenInfo.h"
+#include "AliFemtoEvent.h"
+#include <TH1D.h>
+#include <TH2D.h>
+#include <TList.h>
+#include <TMath.h>
+
+AliFemtoCutMonitorEventVertex::AliFemtoCutMonitorEventVertex():
+  AliFemtoCutMonitor(),
+  fEvVertRad(0),
+  fEvVertXY(0),
+  fEvVertSigXY(0),
+  fEvVertZ(0),
+  fEvVertSigZ(0)
+{
+  // Default constructor
+  fEvVertRad   = new TH1D("EvVertRad",   "Vertex position radial", 200, 0.0, 0.2);
+  fEvVertXY    = new TH2D("EvVertXY",    "Vertex position xy plane", 200, -0.2, 0.2, 200, -0.2, 0.2);
+  fEvVertSigXY = new TH1D("EvVertSigXY", "Vertex error in xy plane", 200, 0.0, 0.2);
+  fEvVertZ     = new TH1D("EvVertZ",     "Vertex position in z", 500, -50.0, 50.0);
+  fEvVertSigZ  = new TH1D("EvVertSigZ",  "Vertex error in z", 100, 0.0, 0.2);
+}
+
+AliFemtoCutMonitorEventVertex::AliFemtoCutMonitorEventVertex(const char *aName):
+  AliFemtoCutMonitor(),
+  fEvVertRad(0),
+  fEvVertXY(0),
+  fEvVertSigXY(0),
+  fEvVertZ(0),
+  fEvVertSigZ(0)
+{
+  // Normal constructor
+  char name[200];
+  snprintf(name, 200, "EvVertRad%s", aName);
+  fEvVertRad   = new TH1D(name,   "Vertex position radial", 200, 0.0, 0.2);
+  snprintf(name, 200, "EvVertXY%s", aName);
+  fEvVertXY    = new TH2D(name,    "Vertex position xy plane", 200, -0.2, 0.2, 200, -0.2, 0.2);
+  snprintf(name, 200, "EvVertSigXY%s", aName);
+  fEvVertSigXY = new TH1D(name, "Vertex error in xy plane", 200, 0.0, 0.2);
+  snprintf(name, 200, "EvVertZ%s", aName);
+  fEvVertZ     = new TH1D(name,     "Vertex position in z", 500, -50.0, 50.0);
+  snprintf(name, 200, "EvVertSigZ%s", aName);
+  fEvVertSigZ  = new TH1D(name,  "Vertex error in z", 100, 0.0, 0.2);
+}
+
+AliFemtoCutMonitorEventVertex::AliFemtoCutMonitorEventVertex(const AliFemtoCutMonitorEventVertex &aCut):
+  AliFemtoCutMonitor(),
+  fEvVertRad(0),
+  fEvVertXY(0),
+  fEvVertSigXY(0),
+  fEvVertZ(0),
+  fEvVertSigZ(0)
+{
+  // copy constructor
+  if (fEvVertRad) delete fEvVertRad;
+  fEvVertRad = new TH1D(*aCut.fEvVertRad);
+  if (fEvVertXY) delete fEvVertXY;
+  fEvVertXY = new TH2D(*aCut.fEvVertXY);
+  if (fEvVertSigXY) delete fEvVertSigXY;
+  fEvVertSigXY = new TH1D(*aCut.fEvVertSigXY);
+  if (fEvVertZ) delete fEvVertZ;
+  fEvVertZ = new TH1D(*aCut.fEvVertZ);
+  if (fEvVertSigZ) delete fEvVertSigZ;
+  fEvVertSigZ = new TH1D(*aCut.fEvVertSigZ);
+}
+
+AliFemtoCutMonitorEventVertex::~AliFemtoCutMonitorEventVertex()
+{
+  // Destructor
+  delete fEvVertRad;
+  delete fEvVertXY;
+  delete fEvVertSigXY;
+  delete fEvVertZ;
+  delete fEvVertSigZ;
+}
+
+AliFemtoCutMonitorEventVertex& AliFemtoCutMonitorEventVertex::operator=(const AliFemtoCutMonitorEventVertex& aCut)
+{
+  // assignment operator
+  if (this == &aCut) 
+    return *this;
+
+  if (fEvVertRad) delete fEvVertRad;
+  fEvVertRad = new TH1D(*aCut.fEvVertRad);
+  if (fEvVertXY) delete fEvVertXY;
+  fEvVertXY = new TH2D(*aCut.fEvVertXY);
+  if (fEvVertSigXY) delete fEvVertSigXY;
+  fEvVertSigXY = new TH1D(*aCut.fEvVertSigXY);
+  if (fEvVertZ) delete fEvVertZ;
+  fEvVertZ = new TH1D(*aCut.fEvVertZ);
+  if (fEvVertSigZ) delete fEvVertSigZ;
+  fEvVertSigZ = new TH1D(*aCut.fEvVertSigZ);
+  
+  return *this;
+}
+
+AliFemtoString AliFemtoCutMonitorEventVertex::Report(){ 
+  // Prepare report from the execution
+  string stemp = "*** AliFemtoCutMonitorEventVertex report"; 
+  AliFemtoString returnThis = stemp;
+  return returnThis; 
+}
+
+void AliFemtoCutMonitorEventVertex::Fill(const AliFemtoEvent* aEvent)
+{
+  // Fill in the monitor histograms with the values from the current track
+  fEvVertRad->Fill(TMath::Hypot(aEvent->PrimVertPos().x(), aEvent->PrimVertPos().y()));
+  fEvVertXY->Fill(aEvent->PrimVertPos().x(), aEvent->PrimVertPos().y());
+  fEvVertSigXY->Fill(TMath::Sqrt(aEvent->PrimVertCov()[0]+aEvent->PrimVertCov()[2]));
+  fEvVertZ->Fill(aEvent->PrimVertPos().z());
+  fEvVertSigZ->Fill(TMath::Sqrt(aEvent->PrimVertCov()[5]));
+}
+
+void AliFemtoCutMonitorEventVertex::Write()
+{
+  // Write out the relevant histograms
+  fEvVertRad->Write();
+  fEvVertXY->Write();
+  fEvVertSigXY->Write();
+  fEvVertZ->Write();
+  fEvVertSigZ->Write();
+}
+
+TList *AliFemtoCutMonitorEventVertex::GetOutputList()
+{
+  TList *tOutputList = new TList();
+  tOutputList->Add(fEvVertRad);
+  tOutputList->Add(fEvVertXY);
+  tOutputList->Add(fEvVertSigXY);
+  tOutputList->Add(fEvVertZ);
+  tOutputList->Add(fEvVertSigZ);
+
+  return tOutputList;
+}
diff --git a/PWG2/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorEventVertex.h b/PWG2/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorEventVertex.h
new file mode 100644 (file)
index 0000000..7d0640a
--- /dev/null
@@ -0,0 +1,54 @@
+////////////////////////////////////////////////////////////////////////////////
+///                                                                          ///
+/// AliFemtoCutMonitorEventVertex - the cut monitor for events to study      ///
+/// the distribution and error of the primary vertex                         ///
+///                                                                          ///
+////////////////////////////////////////////////////////////////////////////////
+#ifndef AliFemtoCutMonitorEventVertex_hh
+#define AliFemtoCutMonitorEventVertex_hh
+
+class AliFemtoEvent;
+class AliFemtoTrack;
+class AliFemtoV0;
+class AliFemtoKink;
+class AliFemtoPair; 
+class TH1D;
+class TH2D;
+class TList;
+#include "AliFemtoString.h"
+#include "AliFemtoParticleCollection.h"
+#include "AliFemtoCutMonitor.h"
+
+class AliFemtoCutMonitorEventVertex : public AliFemtoCutMonitor{
+  
+public:
+  AliFemtoCutMonitorEventVertex();
+  AliFemtoCutMonitorEventVertex(const char *aName);
+  AliFemtoCutMonitorEventVertex(const AliFemtoCutMonitorEventVertex &aCut);
+  virtual ~AliFemtoCutMonitorEventVertex();
+
+  AliFemtoCutMonitorEventVertex& operator=(const AliFemtoCutMonitorEventVertex& aCut);
+
+  virtual AliFemtoString Report();
+  virtual void Fill(const AliFemtoEvent* aEvent);
+  virtual void Fill(const AliFemtoTrack* aTrack) {AliFemtoCutMonitor::Fill(aTrack);}
+  virtual void Fill(const AliFemtoV0* aV0) {AliFemtoCutMonitor::Fill(aV0);}
+  virtual void Fill(const AliFemtoKink* aKink) {AliFemtoCutMonitor::Fill(aKink);}
+  virtual void Fill(const AliFemtoPair* aPair) {AliFemtoCutMonitor::Fill(aPair);}
+  virtual void Fill(const AliFemtoParticleCollection* aCollection) {AliFemtoCutMonitor::Fill(aCollection);}
+  virtual void Fill(const AliFemtoEvent* aEvent,const AliFemtoParticleCollection* aCollection)
+  {AliFemtoCutMonitor::Fill(aEvent, aCollection);}
+
+  void Write();
+
+  virtual TList *GetOutputList();
+
+private:
+  TH1D *fEvVertRad;     // Vertex position in radial direction
+  TH2D *fEvVertXY;      // Vertex position in XY plane
+  TH1D *fEvVertSigXY;   // Sigma in XY plane
+  TH1D *fEvVertZ;       // Vertex position in Z direction
+  TH1D *fEvVertSigZ;    // Sigma in Z direction
+};
+
+#endif
index 36d3c5660d3653a12b60a9c41c90f47543910af1..c90e36a17d47b423663df076570990c4f6ad30c8 100644 (file)
@@ -48,6 +48,7 @@
 #pragma link C++ class AliFemtoCutMonitorParticleYPt+;
 #pragma link C++ class AliFemtoCutMonitorParticleVertPos+;
 #pragma link C++ class AliFemtoCutMonitorEventMult+;
+#pragma link C++ class AliFemtoCutMonitorEventVertex+;
 #pragma link C++ class AliFemtoEventReaderAOD+;
 #pragma link C++ class AliFemtoEventReaderAODChain+;
 #pragma link C++ class AliFemtoAODTrackCut+;
index 1880d8736d07e9061516320193585434f8f19f19..fc3ec984591dfb7ecbff0def80ec252df1ae8a2b 100644 (file)
@@ -39,6 +39,7 @@ SRCS= FEMTOSCOPY/AliFemto/AliFemtoSimpleAnalysis.cxx \
       FEMTOSCOPY/AliFemto/AliFemtoCutMonitorParticleYPt.cxx \
       FEMTOSCOPY/AliFemto/AliFemtoCutMonitorParticleVertPos.cxx \
       FEMTOSCOPY/AliFemto/AliFemtoCutMonitorEventMult.cxx \
+      FEMTOSCOPY/AliFemto/AliFemtoCutMonitorEventVertex.cxx \
       FEMTOSCOPY/AliFemto/AliFemtoKTPairCut.cxx \
       FEMTOSCOPY/AliFemto/AliFemtoCorrFctnNonIdDR.cxx \
       FEMTOSCOPY/AliFemto/AliFemtoCorrFctn3DSpherical.cxx \