/************************************************************************** * 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. * **************************************************************************/ /////////////////////////////////////////////////////////////////////////////// // // // Redo primary vertex on the fly, using the diamond constraint // // // /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include #include #include "AliVtxTenderSupply.h" ClassImp(AliVtxTenderSupply) AliVtxTenderSupply::AliVtxTenderSupply() : AliTenderSupply(), fDiamond(0x0), fRefitAlgo(-1) { // // default ctor // } //_____________________________________________________ AliVtxTenderSupply::AliVtxTenderSupply(const char *name, const AliTender *tender) : AliTenderSupply(name,tender), fDiamond(0x0), fRefitAlgo(-1) { // // named ctor // } //_____________________________________________________ void AliVtxTenderSupply::ProcessEvent() { // // Recalculate the Vertex with constraint // AliESDEvent *event=fTender->GetEvent(); if (!event) return; // if (fRefitAlgo >=0 ) { // refit with user supplied algo and using the diamond stored in ESD AliESDUtils::RefitESDVertexTracks(event, fRefitAlgo); return; } // if (fTender->RunChanged()){ fDiamond=0x0; AliCDBEntry *meanVertex=fTender->GetCDBManager()->Get("GRP/Calib/MeanVertex",fTender->GetRun()); if (!meanVertex) { AliError("No new MeanVertex entry found"); return; } else { fDiamond=(AliESDVertex*)meanVertex->GetObject(); } //printf("\nRun %d, sigmaX %f, sigmaY %f\n",fTender->GetRun(),fDiamond->GetXRes(),fDiamond->GetYRes()); } if (!fDiamond) return; // Redo the primary with the constraint ONLY if the updated mean vertex was found in the OCDB if ( (fDiamond->GetXRes())<2){ AliVertexerTracks vertexer(event->GetMagneticField()); vertexer.SetITSMode(); vertexer.SetMinClusters(3); vertexer.SetVtxStart(fDiamond); AliESDVertex *pvertex = vertexer.FindPrimaryVertex(event); event->SetPrimaryVertexTracks(pvertex); // write the diamond parameters event->SetDiamond(fDiamond); delete pvertex; } }