From f2a195c1f63f67c6f894a5d2b4e97638fc5092a5 Mon Sep 17 00:00:00 2001 From: hristov Date: Thu, 16 Oct 2008 14:55:37 +0000 Subject: [PATCH] Re-organization of vertex constraints in the primary vertex determination: - 3 diamonds in OCDB: GPR/MeanVertexSPD for SPD, GRP/MeanVertex for ITS tracks, GPR/MeanVertexTPC for TPC tracks. The diamond estimated by the SPD DA is stored in MeanVertexSPD. This mean vertex can be used to constrain the SPD vertexer. - 3 separate flags to have the freedom to use the constraint for given vertex and not for another. These flags are moved from AliReconstruction to AliITSRecoParam (for SPD) and AliGRPRecoParam (for tracks), where the other cuts for the vertexers are. Andrea --- GRP/UpdateCDBVertexDiamond.C | 13 ++++++++++ STEER/AliGRPRecoParam.cxx | 14 +++++++++++ STEER/AliGRPRecoParam.h | 9 ++++++- STEER/AliReconstruction.cxx | 49 +++++++++++++++++++----------------- STEER/AliReconstruction.h | 6 ++--- 5 files changed, 64 insertions(+), 27 deletions(-) diff --git a/GRP/UpdateCDBVertexDiamond.C b/GRP/UpdateCDBVertexDiamond.C index 026b2d039f2..b03d3157f80 100644 --- a/GRP/UpdateCDBVertexDiamond.C +++ b/GRP/UpdateCDBVertexDiamond.C @@ -20,6 +20,7 @@ void UpdateCDBVertexDiamond(Double_t xmed = 0., Double_t ymed = 0., Double_t sig man->SetRun(0); AliCDBId id("GRP/Calib/MeanVertex",0,AliCDBRunRange::Infinity()); AliCDBId idTPC("GRP/Calib/MeanVertexTPC",0,AliCDBRunRange::Infinity()); + AliCDBId idSPD("GRP/Calib/MeanVertexSPD",0,AliCDBRunRange::Infinity()); AliCDBMetaData *metadata= new AliCDBMetaData(); // Get root and AliRoot versions @@ -63,6 +64,18 @@ void UpdateCDBVertexDiamond(Double_t xmed = 0., Double_t ymed = 0., Double_t sig man->Put(vertexTPC,idTPC,metadata); + position[0]=xmed; + position[1]=ymed; + position[2]=0.; + sigma[0]=TMath::Sqrt(sigx*sigx+resolx*resolx); + sigma[1]=TMath::Sqrt(sigy*sigy+resoly*resoly); + sigma[2]=sigz; + + AliESDVertex *vertexSPD = new AliESDVertex(position,sigma,"vtxmean"); + vertexSPD->PrintStatus(); + + man->Put(vertexSPD,idSPD,metadata); + } diff --git a/STEER/AliGRPRecoParam.cxx b/STEER/AliGRPRecoParam.cxx index fc4ef23acbd..6d933b6cd80 100644 --- a/STEER/AliGRPRecoParam.cxx +++ b/STEER/AliGRPRecoParam.cxx @@ -29,6 +29,8 @@ ClassImp(AliGRPRecoParam) //_____________________________________________________________________________ AliGRPRecoParam::AliGRPRecoParam() : AliDetectorRecoParam(), fMostProbablePt(0.350), +fVertexerTracksConstraintITS(kTRUE), +fVertexerTracksConstraintTPC(kTRUE), fVertexerTracksNCuts(10), fVertexerTracksITSdcacut(0.1), fVertexerTracksITSdcacutIter0(0.1), @@ -69,6 +71,8 @@ AliGRPRecoParam::~AliGRPRecoParam() AliGRPRecoParam::AliGRPRecoParam(const AliGRPRecoParam& par) : AliDetectorRecoParam(par), fMostProbablePt(par.fMostProbablePt), + fVertexerTracksConstraintITS(par.fVertexerTracksConstraintITS), + fVertexerTracksConstraintTPC(par.fVertexerTracksConstraintTPC), fVertexerTracksNCuts(par.fVertexerTracksNCuts), fVertexerTracksITSdcacut(par.fVertexerTracksITSdcacut), fVertexerTracksITSdcacutIter0(par.fVertexerTracksITSdcacutIter0), @@ -127,6 +131,16 @@ AliGRPRecoParam *AliGRPRecoParam::GetLowFluxParam() return param; } //_____________________________________________________________________________ +AliGRPRecoParam *AliGRPRecoParam::GetCosmicTestParam() +{ + // + // make default reconstruction parameters for cosmics env. + // + AliGRPRecoParam *param = new AliGRPRecoParam(); + + return param; +} +//_____________________________________________________________________________ void AliGRPRecoParam::GetVertexerTracksCuts(Int_t mode,Double_t *cuts) const { // // get cuts for ITS (0) or TPC (1) mode diff --git a/STEER/AliGRPRecoParam.h b/STEER/AliGRPRecoParam.h index fd798eea503..f2cccea4e4d 100644 --- a/STEER/AliGRPRecoParam.h +++ b/STEER/AliGRPRecoParam.h @@ -23,15 +23,20 @@ class AliGRPRecoParam : public AliDetectorRecoParam static AliGRPRecoParam *GetLowFluxParam();// make reco parameters for low flux env. static AliGRPRecoParam *GetHighFluxParam();// make reco parameters for high flux env. + static AliGRPRecoParam *GetCosmicTestParam();// make reco parameters for cosmics env. void SetMostProbablePt(Double_t pt=0.350) { fMostProbablePt=pt; return; } Double_t GetMostProbablePt() const { return fMostProbablePt; } + void SetVertexerTracksConstraintITS(Bool_t constr=kTRUE) { fVertexerTracksConstraintITS=constr; return; } + void SetVertexerTracksConstraintTPC(Bool_t constr=kTRUE) { fVertexerTracksConstraintTPC=constr; return; } void SetVertexerTracksCuts(Int_t mode,Int_t ncuts,Double_t cuts[10]); void SetVertexerTracksCutsITS(Int_t ncuts,Double_t cuts[10]) { SetVertexerTracksCuts(0,ncuts,cuts); return; } void SetVertexerTracksCutsTPC(Int_t ncuts,Double_t cuts[10]) { SetVertexerTracksCuts(1,ncuts,cuts); return; } + Bool_t GetVertexerTracksConstraintITS() const { return fVertexerTracksConstraintITS; } + Bool_t GetVertexerTracksConstraintTPC() const { return fVertexerTracksConstraintTPC; } Int_t GetVertexerTracksNCuts() const { return fVertexerTracksNCuts; } void GetVertexerTracksCuts(Int_t mode,Double_t *cuts) const; void GetVertexerTracksCutsITS(Double_t *cuts) const @@ -46,6 +51,8 @@ class AliGRPRecoParam : public AliDetectorRecoParam // Double_t fMostProbablePt; // to be used for B=0 tracking + Bool_t fVertexerTracksConstraintITS; // diamond constr for AliVertexerTracks + Bool_t fVertexerTracksConstraintTPC; // diamond constr for AliVertexerTracks Int_t fVertexerTracksNCuts; // number of cuts for AliVertexerTracks // cuts for AliVertexerTracks: ITS mode Double_t fVertexerTracksITSdcacut; // general dca @@ -71,7 +78,7 @@ class AliGRPRecoParam : public AliDetectorRecoParam Double_t fVertexerTracksTPCfidR; // fiducial radius Double_t fVertexerTracksTPCfidZ; // fiducial z - ClassDef(AliGRPRecoParam,2) // global reco parameters + ClassDef(AliGRPRecoParam,3) // global reco parameters }; #endif diff --git a/STEER/AliReconstruction.cxx b/STEER/AliReconstruction.cxx index 77479808be1..f3363a68bfb 100644 --- a/STEER/AliReconstruction.cxx +++ b/STEER/AliReconstruction.cxx @@ -247,10 +247,10 @@ AliReconstruction::AliReconstruction(const char* gAliceFilename) : fRecoParam(), fVertexer(NULL), + fDiamondProfileSPD(NULL), fDiamondProfile(NULL), fDiamondProfileTPC(NULL), - fMeanVertexConstraint(kTRUE), - + fGRPData(NULL), fAlignObjArray(NULL), @@ -342,10 +342,10 @@ AliReconstruction::AliReconstruction(const AliReconstruction& rec) : fRecoParam(rec.fRecoParam), fVertexer(NULL), + fDiamondProfileSPD(rec.fDiamondProfileSPD), fDiamondProfile(rec.fDiamondProfile), fDiamondProfileTPC(rec.fDiamondProfileTPC), - fMeanVertexConstraint(rec.fMeanVertexConstraint), - + fGRPData(NULL), fAlignObjArray(rec.fAlignObjArray), @@ -468,11 +468,12 @@ AliReconstruction& AliReconstruction::operator = (const AliReconstruction& rec) } fVertexer = NULL; + delete fDiamondProfileSPD; fDiamondProfileSPD = NULL; + if (rec.fDiamondProfileSPD) fDiamondProfileSPD = new AliESDVertex(*rec.fDiamondProfileSPD); delete fDiamondProfile; fDiamondProfile = NULL; if (rec.fDiamondProfile) fDiamondProfile = new AliESDVertex(*rec.fDiamondProfile); delete fDiamondProfileTPC; fDiamondProfileTPC = NULL; if (rec.fDiamondProfileTPC) fDiamondProfileTPC = new AliESDVertex(*rec.fDiamondProfileTPC); - fMeanVertexConstraint = rec.fMeanVertexConstraint; delete fGRPData; fGRPData = NULL; // if (rec.fGRPData) fGRPData = (TMap*)((rec.fGRPData)->Clone()); @@ -1045,21 +1046,26 @@ Bool_t AliReconstruction::InitGRP() { } - //*** Get the diamond profile from OCDB + //*** Get the diamond profiles from OCDB + entry = AliCDBManager::Instance()->Get("GRP/Calib/MeanVertexSPD"); + if (entry) { + fDiamondProfileSPD = dynamic_cast (entry->GetObject()); + } else { + AliError("No SPD diamond profile found in OCDB!"); + } + entry = AliCDBManager::Instance()->Get("GRP/Calib/MeanVertex"); if (entry) { - if (fMeanVertexConstraint) - fDiamondProfile = dynamic_cast (entry->GetObject()); + fDiamondProfile = dynamic_cast (entry->GetObject()); } else { AliError("No diamond profile found in OCDB!"); } entry = AliCDBManager::Instance()->Get("GRP/Calib/MeanVertexTPC"); if (entry) { - if (fMeanVertexConstraint) - fDiamondProfileTPC = dynamic_cast (entry->GetObject()); + fDiamondProfileTPC = dynamic_cast (entry->GetObject()); } else { - AliError("No diamond profile found in OCDB!"); + AliError("No TPC diamond profile found in OCDB!"); } return kTRUE; @@ -1305,7 +1311,6 @@ void AliReconstruction::SlaveBegin(TTree*) AliSysInfo::AddStamp("LoadLoader"); ftVertexer = new AliVertexerTracks(AliTracker::GetBz()); - if(fDiamondProfile && fMeanVertexConstraint) ftVertexer->SetVtxStart(fDiamondProfile); // get vertexer if (fRunVertexFinder && !CreateVertexer()) { @@ -1632,6 +1637,7 @@ Bool_t AliReconstruction::ProcessEvent(Int_t iEvent) // TPC + ITS primary vertex ftVertexer->SetITSMode(); + ftVertexer->SetConstraintOff(); // get cuts for vertexer from AliGRPRecoParam if (grpRecoParam) { Int_t nCutsVertexer = grpRecoParam->GetVertexerTracksNCuts(); @@ -1639,11 +1645,8 @@ Bool_t AliReconstruction::ProcessEvent(Int_t iEvent) grpRecoParam->GetVertexerTracksCutsITS(cutsVertexer); ftVertexer->SetCuts(cutsVertexer); delete [] cutsVertexer; cutsVertexer = NULL; - } - if(fDiamondProfile && fMeanVertexConstraint) { - ftVertexer->SetVtxStart(fDiamondProfile); - } else { - ftVertexer->SetConstraintOff(); + if(fDiamondProfile && grpRecoParam->GetVertexerTracksConstraintITS()) + ftVertexer->SetVtxStart(fDiamondProfile); } AliESDVertex *pvtx=ftVertexer->FindPrimaryVertex(fesd); if (pvtx) { @@ -1658,6 +1661,7 @@ Bool_t AliReconstruction::ProcessEvent(Int_t iEvent) // TPC-only primary vertex ftVertexer->SetTPCMode(); + ftVertexer->SetConstraintOff(); // get cuts for vertexer from AliGRPRecoParam if (grpRecoParam) { Int_t nCutsVertexer = grpRecoParam->GetVertexerTracksNCuts(); @@ -1665,11 +1669,8 @@ Bool_t AliReconstruction::ProcessEvent(Int_t iEvent) grpRecoParam->GetVertexerTracksCutsTPC(cutsVertexer); ftVertexer->SetCuts(cutsVertexer); delete [] cutsVertexer; cutsVertexer = NULL; - } - if(fDiamondProfileTPC && fMeanVertexConstraint) { - ftVertexer->SetVtxStart(fDiamondProfileTPC); - } else { - ftVertexer->SetConstraintOff(); + if(fDiamondProfileTPC && grpRecoParam->GetVertexerTracksConstraintTPC()) + ftVertexer->SetVtxStart(fDiamondProfileTPC); } pvtx=ftVertexer->FindPrimaryVertex(&trkArray,selectedIdx); if (pvtx) { @@ -1954,7 +1955,7 @@ Bool_t AliReconstruction::RunVertexFinder(AliESDEvent*& esd) fLoader[0]->LoadRecPoints(); TTree* cltree = fLoader[0]->TreeR(); if (cltree) { - if(fDiamondProfile) fVertexer->SetVtxStart(fDiamondProfile); + if(fDiamondProfileSPD) fVertexer->SetVtxStart(fDiamondProfileSPD); vertex = fVertexer->FindVertexForCurrentEvent(cltree); } else { @@ -2631,6 +2632,8 @@ void AliReconstruction::CleanUp() ftVertexer = NULL; if(!(AliCDBManager::Instance()->GetCacheFlag())) { + delete fDiamondProfileSPD; + fDiamondProfileSPD = NULL; delete fDiamondProfile; fDiamondProfile = NULL; delete fDiamondProfileTPC; diff --git a/STEER/AliReconstruction.h b/STEER/AliReconstruction.h index 8d235e18151..a0000dbbd36 100644 --- a/STEER/AliReconstruction.h +++ b/STEER/AliReconstruction.h @@ -96,9 +96,9 @@ public: void SetWriteAlignmentData(Bool_t flag=kTRUE){fWriteAlignmentData=flag;} void SetWriteESDfriend(Bool_t flag=kTRUE){fWriteESDfriend=flag;} void SetFillTriggerESD(Bool_t flag=kTRUE){fFillTriggerESD=flag;} + void SetDiamondProfileSPD(AliESDVertex *dp) {fDiamondProfileSPD=dp;} void SetDiamondProfile(AliESDVertex *dp) {fDiamondProfile=dp;} void SetDiamondProfileTPC(AliESDVertex *dp) {fDiamondProfileTPC=dp;} - void SetMeanVertexConstraint(Bool_t flag=kTRUE){fMeanVertexConstraint=flag;} void SetCleanESD(Bool_t flag=kTRUE){fCleanESD=flag;} void SetUseHLTData(const char* detectors){fUseHLTData=detectors;} @@ -253,9 +253,9 @@ private: AliLoader* fLoader[fgkNDetectors]; //! detector loaders AliVertexer* fVertexer; //! vertexer for ITS AliTracker* fTracker[fgkNDetectors]; //! trackers - AliESDVertex* fDiamondProfile; // (x,y) diamond profile for AliVertexerTracks + AliESDVertex* fDiamondProfileSPD; // (x,y) diamond profile from SPD for AliITSVertexer3D(Z) + AliESDVertex* fDiamondProfile; // (x,y) diamond profile for AliVertexerTracks (ITS+TPC) AliESDVertex* fDiamondProfileTPC; // (x,y) diamond profile from TPC for AliVertexerTracks - Bool_t fMeanVertexConstraint; // use fDiamondProfile in AliVertexerTracks AliGRPObject* fGRPData; // Data from the GRP/GRP/Data CDB folder -- 2.39.3