A "mean vertexer" to measure the average vertex position during a run.
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 9 Nov 2007 16:12:43 +0000 (16:12 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 9 Nov 2007 16:12:43 +0000 (16:12 +0000)
In priciple, the produced object should be saved as a AliESDVertex object.
However, we wouldlike to save additional information and namely:
1) the errors coming from the weighted average (in addition to the covariance
matrix which give the spread of the vertices contributing to the average)
2) the number of tracklets used
3) the mean multiplicity of the events used for the average
4) the RMS of this multiplicity

Massimo

STEER/AliMeanVertex.cxx [new file with mode: 0644]
STEER/AliMeanVertex.h [new file with mode: 0644]
STEER/ESDLinkDef.h
STEER/libESD.pkg

diff --git a/STEER/AliMeanVertex.cxx b/STEER/AliMeanVertex.cxx
new file mode 100644 (file)
index 0000000..7968147
--- /dev/null
@@ -0,0 +1,67 @@
+/**************************************************************************
+ * Copyright(c) 2007-2009, 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.                  *
+ **************************************************************************/
+
+#include "AliMeanVertex.h"
+
+/* $Id$ */
+
+/*****************************************************************************
+ *                                                                           *
+ * This class contains the coordinates of the mean primary vertex position   *
+ * computed by AliITSMeanVertex                                              *
+ *                                                                           *
+*****************************************************************************/
+
+ClassImp(AliMeanVertex)
+
+//--------------------------------------------------------------------------
+AliMeanVertex::AliMeanVertex() :
+  AliESDVertex(),
+  fTotTracklets(0.),
+  fAverTracklets(0.),
+  fSigmaOnAverTrack(0.) {
+  //
+  // Default Constructor, set everything to 0
+  //
+  for(Int_t i=0;i<3;i++){
+    fErrW[i]=0.;
+  }
+}
+
+//--------------------------------------------------------------------------
+AliMeanVertex::AliMeanVertex(Double_t pos[3],Double_t err[3],Double_t cov[6],Int_t nevents, Float_t notracklets, Float_t avertracklets, Float_t signotrackl) :
+  AliESDVertex(pos,cov,0.,nevents,"MeanVertex"),
+  fTotTracklets(notracklets),
+  fAverTracklets(avertracklets),
+  fSigmaOnAverTrack(signotrackl) {
+  //
+  // Standard Constructor
+  //
+  for(Int_t i=0;i<3;i++){
+    fErrW[i]=err[i];
+  }
+}
+
+//--------------------------------------------------------------------------
+void AliMeanVertex::GetErrorsOnPosition(Double_t err[3]) const {
+  //
+  // Return errors on vertex average position (weighted mean on several events)
+  //
+  err[0] = fErrW[0];
+  err[1] = fErrW[1];
+  err[2] = fErrW[2];
+
+  return;
+}
diff --git a/STEER/AliMeanVertex.h b/STEER/AliMeanVertex.h
new file mode 100644 (file)
index 0000000..8f99d63
--- /dev/null
@@ -0,0 +1,36 @@
+#ifndef ALIMEANVERTEX_H
+#define ALIMEANVERTEX_H
+/* Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/* $Id$ */
+/*****************************************************************************
+ *                                                                           *
+ * This class contains the coordinates of the mean primary vertex position   *
+ * computed by AliITSMeanVertex                                              *
+ *                                                                           *
+*****************************************************************************/
+#include "AliESDVertex.h"
+
+class AliMeanVertex : public AliESDVertex {
+ public:
+  AliMeanVertex();
+  AliMeanVertex(Double_t pos[3],Double_t err[3],Double_t cov[6],Int_t nevents, Float_t notracklets, Float_t avertracklets, Float_t signotrackl);
+  virtual ~AliMeanVertex() {}
+
+  Int_t GetNumberOfContributingEvents() const { return GetNContributors(); }
+  void GetErrorsOnPosition(Double_t err[3]) const;
+  Float_t GetTotalNumbOfTracklets() const { return fTotTracklets; }
+  Float_t GetAverageNumbOfTracklets() const { return fAverTracklets; }
+  Float_t GetSigmaOnAvNumbOfTracks() const { return fSigmaOnAverTrack; }
+
+ protected:
+  Double32_t fErrW[3];       // errors on vertex coordinates (weighted average)
+  Float_t      fTotTracklets;   // total number of tracklets used for M.V.
+  Float_t    fAverTracklets;  // average number of tracklets per event
+  Float_t fSigmaOnAverTrack;  // sigma on fAverTracklets
+
+  ClassDef(AliMeanVertex,1)  // Class for mean Vertex   
+}; 
+
+#endif
index b890963..a70ca99 100644 (file)
@@ -64,6 +64,8 @@
 
 #pragma link C++ class  AliRawDataErrorLog+;
 
+#pragma link C++ class  AliMeanVertex+;
+
 #endif
 
 
index 9fa3716..98def75 100644 (file)
@@ -20,7 +20,8 @@ SRCS = AliESDEvent.cxx AliESDInputHandler.cxx AliESDfriend.cxx AliESD.cxx \
        AliESDZDC.cxx \
        AliESDTZERO.cxx \
        AliESDCaloTrigger.cxx \
-       AliRawDataErrorLog.cxx
+       AliRawDataErrorLog.cxx \
+       AliMeanVertex.cxx
 
 HDRS:= $(SRCS:.cxx=.h)