Update (Andrea)
[u/mrichter/AliRoot.git] / PWG3 / vertexingHF / AliAnalysisTaskMEVertexingHF.cxx
index 34bea64..3ce82b7 100644 (file)
@@ -11,6 +11,9 @@
  * about the suitability of this software for any purpose. It is          *
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
+
+/* $Id$ */
+
 //*************************************************************************
 // Class AliAnalysisTaskMEVertexingHF
 // AliAnalysisTaskME for event mixing, building the background for 
@@ -50,6 +53,7 @@ fJPSItoEleTClArr(0),
 fCharm3ProngTClArr(0),
 fCharm4ProngTClArr(0),
 fDstarTClArr(0),
+fCascadesTClArr(0),
 fLikeSign2ProngTClArr(0),
 fLikeSign3ProngTClArr(0)
 {
@@ -128,6 +132,12 @@ void AliAnalysisTaskMEVertexingHF::UserCreateOutputObjects()
     AddAODBranch("TClonesArray", &fDstarTClArr);
   }
   
+  if(fvHF->GetCascades()){
+    fCascadesTClArr = new TClonesArray("AliAODRecoCascadeHF", 0);
+    fCascadesTClArr->SetName("CascadesHF");
+    AddAODBranch("TClonesArray", &fCascadesTClArr);
+  }
+
   if(fvHF->GetLikeSign()) {
     fLikeSign2ProngTClArr = new TClonesArray("AliAODRecoDecayHF2Prong", 0);
     fLikeSign2ProngTClArr->SetName("LikeSign2Prong");
@@ -192,7 +202,8 @@ void AliAnalysisTaskMEVertexingHF::UserExec(Option_t *)
     return;
   }
   Int_t contribCopy=nContributors[0];
-  AliVVertex* newVertex=new AliESDVertex(vtxPos,vtxSigma,chi2,contribCopy);
+  Double_t vtxCov[6]={vtxSigma[0]*vtxSigma[0],0,vtxSigma[1]*vtxSigma[1],0,0,vtxSigma[2]*vtxSigma[2]};
+  AliVVertex* newVertex=new AliESDVertex(vtxPos,vtxCov,chi2,contribCopy);
   newVertex->SetTitle(primTitleFirst.Data());
   fMixedEvent->SetPrimaryVertex(newVertex);
 
@@ -207,6 +218,7 @@ void AliAnalysisTaskMEVertexingHF::UserExec(Option_t *)
                       fCharm3ProngTClArr,
                       fCharm4ProngTClArr,
                       fDstarTClArr,
+                      fCascadesTClArr, 
                       fLikeSign2ProngTClArr,
                       fLikeSign3ProngTClArr);