From a00021a7087b05268036214b939ac98e58cd27ba Mon Sep 17 00:00:00 2001 From: cvetan Date: Fri, 5 Sep 2008 11:11:18 +0000 Subject: [PATCH] Introduction of AliGRPRecoParam object which is used in order to steer the global reco parameters (vertexer-tracks, most probably Pt in the tracker etc (Andrea). Adding AliGRPRecoParam object to the AliRecoParam container object and using it inside the reconstruction in order to steer the vertexers. Bug-fix in AliRecoParam::GetDetRecoParam. Small fix in AliReconstruction in order to avoid a problem with the reco-params in the case when the local-reco detector list is empty and one wants to redo only the tracking and/or fill-esd (Cvetan) --- STEER/AliGRPRecoParam.cxx | 193 ++++++++++++++++++++++++++++++++++++ STEER/AliGRPRecoParam.h | 73 ++++++++++++++ STEER/AliRecoParam.cxx | 2 +- STEER/AliRecoParam.h | 4 +- STEER/AliReconstruction.cxx | 50 +++++++++- STEER/AliVertexerTracks.cxx | 18 ++++ STEER/AliVertexerTracks.h | 41 ++++---- STEER/STEERLinkDef.h | 1 + STEER/libSTEER.pkg | 1 + 9 files changed, 356 insertions(+), 27 deletions(-) create mode 100644 STEER/AliGRPRecoParam.cxx create mode 100644 STEER/AliGRPRecoParam.h diff --git a/STEER/AliGRPRecoParam.cxx b/STEER/AliGRPRecoParam.cxx new file mode 100644 index 00000000000..b3214e52257 --- /dev/null +++ b/STEER/AliGRPRecoParam.cxx @@ -0,0 +1,193 @@ +/************************************************************************** + * 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 "AliGRPRecoParam.h" + +/////////////////////////////////////////////////////////////////////////////// +// // +// Class with GRP reconstruction parameters // +// Origin: andrea.dainese@lnl.infn.it // +// // +/////////////////////////////////////////////////////////////////////////////// + + + +ClassImp(AliGRPRecoParam) + +//_____________________________________________________________________________ +AliGRPRecoParam::AliGRPRecoParam() : AliDetectorRecoParam(), +fVertexerTracksNCuts(10), +fVertexerTracksITSdcacut(0.1), +fVertexerTracksITSdcacutIter0(0.1), +fVertexerTracksITSmaxd0z0(0.5), +fVertexerTracksITSminCls(5), +fVertexerTracksITSmintrks(1), +fVertexerTracksITSnsigma(3.), +fVertexerTracksITSnindetfitter(100.), +fVertexerTracksITSmaxtgl(1000.), +fVertexerTracksITSfidR(3.), +fVertexerTracksITSfidZ(30.), +fVertexerTracksTPCdcacut(0.1), +fVertexerTracksTPCdcacutIter0(1.0), +fVertexerTracksTPCmaxd0z0(5.), +fVertexerTracksTPCminCls(10), +fVertexerTracksTPCmintrks(1), +fVertexerTracksTPCnsigma(3.), +fVertexerTracksTPCnindetfitter(0.1), +fVertexerTracksTPCmaxtgl(1.5), +fVertexerTracksTPCfidR(3.), +fVertexerTracksTPCfidZ(30.) +{ + // + // constructor + // + SetName("GRP"); + SetTitle("GRP"); +} + +//_____________________________________________________________________________ +AliGRPRecoParam::~AliGRPRecoParam() +{ + // + // destructor + // +} + +AliGRPRecoParam::AliGRPRecoParam(const AliGRPRecoParam& par) : + AliDetectorRecoParam(par), + fVertexerTracksNCuts(par.fVertexerTracksNCuts), + fVertexerTracksITSdcacut(par.fVertexerTracksITSdcacut), + fVertexerTracksITSdcacutIter0(par.fVertexerTracksITSdcacutIter0), + fVertexerTracksITSmaxd0z0(par.fVertexerTracksITSmaxd0z0), + fVertexerTracksITSminCls(par.fVertexerTracksITSminCls), + fVertexerTracksITSmintrks(par.fVertexerTracksITSmintrks), + fVertexerTracksITSnsigma(par.fVertexerTracksITSnsigma), + fVertexerTracksITSnindetfitter(par.fVertexerTracksITSnindetfitter), + fVertexerTracksITSmaxtgl(par.fVertexerTracksITSmaxtgl), + fVertexerTracksITSfidR(par.fVertexerTracksITSfidR), + fVertexerTracksITSfidZ(par.fVertexerTracksITSfidZ), + fVertexerTracksTPCdcacut(par.fVertexerTracksTPCdcacut), + fVertexerTracksTPCdcacutIter0(par.fVertexerTracksTPCdcacutIter0), + fVertexerTracksTPCmaxd0z0(par.fVertexerTracksTPCmaxd0z0), + fVertexerTracksTPCminCls(par.fVertexerTracksTPCminCls), + fVertexerTracksTPCmintrks(par.fVertexerTracksTPCmintrks), + fVertexerTracksTPCnsigma(par.fVertexerTracksTPCnsigma), + fVertexerTracksTPCnindetfitter(par.fVertexerTracksTPCnindetfitter), + fVertexerTracksTPCmaxtgl(par.fVertexerTracksTPCmaxtgl), + fVertexerTracksTPCfidR(par.fVertexerTracksTPCfidR), + fVertexerTracksTPCfidZ(par.fVertexerTracksTPCfidZ) +{ + // copy constructor +} + +//_____________________________________________________________________________ +AliGRPRecoParam& AliGRPRecoParam::operator = (const AliGRPRecoParam& par) +{ + // assignment operator + + if(&par == this) return *this; + + this->~AliGRPRecoParam(); + new(this) AliGRPRecoParam(par); + return *this; +} + +//_____________________________________________________________________________ +AliGRPRecoParam *AliGRPRecoParam::GetHighFluxParam() +{ + // + // make default reconstruction parameters for hig flux env. + // + AliGRPRecoParam *param = new AliGRPRecoParam(); + + return param; +} +//_____________________________________________________________________________ +AliGRPRecoParam *AliGRPRecoParam::GetLowFluxParam() +{ + // + // make default reconstruction parameters for low flux 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 + // + if(mode==1) { + cuts[0] = fVertexerTracksTPCdcacut; + cuts[1] = fVertexerTracksTPCdcacutIter0; + cuts[2] = fVertexerTracksTPCmaxd0z0; + cuts[3] = fVertexerTracksTPCminCls; + cuts[4] = fVertexerTracksTPCmintrks; + cuts[5] = fVertexerTracksTPCnsigma; + cuts[6] = fVertexerTracksTPCnindetfitter; + cuts[7] = fVertexerTracksTPCmaxtgl; + cuts[8] = fVertexerTracksTPCfidR; + cuts[9] = fVertexerTracksTPCfidZ; + } else { + cuts[0] = fVertexerTracksITSdcacut; + cuts[1] = fVertexerTracksITSdcacutIter0; + cuts[2] = fVertexerTracksITSmaxd0z0; + cuts[3] = fVertexerTracksITSminCls; + cuts[4] = fVertexerTracksITSmintrks; + cuts[5] = fVertexerTracksITSnsigma; + cuts[6] = fVertexerTracksITSnindetfitter; + cuts[7] = fVertexerTracksITSmaxtgl; + cuts[8] = fVertexerTracksITSfidR; + cuts[9] = fVertexerTracksITSfidZ; + } + + return; +} +//_____________________________________________________________________________ +void AliGRPRecoParam::SetVertexerTracksCuts(Int_t mode,Int_t ncuts,Double_t cuts[10]) { + // + // set cuts for ITS (0) or TPC (1) mode + // + if(ncuts!=fVertexerTracksNCuts) { + printf("AliGRPRecoParam: Number of AliVertexerTracks cuts is %d\n",fVertexerTracksNCuts); + return; + } + + if(mode==1) { + fVertexerTracksTPCdcacut = cuts[0]; + fVertexerTracksTPCdcacutIter0 = cuts[1]; + fVertexerTracksTPCmaxd0z0 = cuts[2]; + fVertexerTracksTPCminCls = cuts[3]; + fVertexerTracksTPCmintrks = cuts[4]; + fVertexerTracksTPCnsigma = cuts[5]; + fVertexerTracksTPCnindetfitter = cuts[6]; + fVertexerTracksTPCmaxtgl = cuts[7]; + fVertexerTracksTPCfidR = cuts[8]; + fVertexerTracksTPCfidZ = cuts[9]; + } else { + fVertexerTracksITSdcacut = cuts[0]; + fVertexerTracksITSdcacutIter0 = cuts[1]; + fVertexerTracksITSmaxd0z0 = cuts[2]; + fVertexerTracksITSminCls = cuts[3]; + fVertexerTracksITSmintrks = cuts[4]; + fVertexerTracksITSnsigma = cuts[5]; + fVertexerTracksITSnindetfitter = cuts[6]; + fVertexerTracksITSmaxtgl = cuts[7]; + fVertexerTracksITSfidR = cuts[8]; + fVertexerTracksITSfidZ = cuts[9]; + } + + return; +} diff --git a/STEER/AliGRPRecoParam.h b/STEER/AliGRPRecoParam.h new file mode 100644 index 00000000000..b4684ea29b6 --- /dev/null +++ b/STEER/AliGRPRecoParam.h @@ -0,0 +1,73 @@ +#ifndef ALIGRPRECOPARAM_H +#define ALIGRPRECOPARAM_H +/* Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. * + * See cxx source for full Copyright notice */ + + +/////////////////////////////////////////////////////////////////////////////// +// // +// Class with global reconstruction parameters // +// (initially, parameters for AliVertexerTracks) // +// Origin: andrea.dainese@lnl.infn.it // +// // +/////////////////////////////////////////////////////////////////////////////// + + +#include "AliDetectorRecoParam.h" + +class AliGRPRecoParam : public AliDetectorRecoParam +{ + public: + AliGRPRecoParam(); + virtual ~AliGRPRecoParam(); + + static AliGRPRecoParam *GetLowFluxParam();// make reco parameters for low flux env. + static AliGRPRecoParam *GetHighFluxParam();// make reco parameters for high flux env. + + 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; } + Int_t GetVertexerTracksNCuts() const { return fVertexerTracksNCuts; } + void GetVertexerTracksCuts(Int_t mode,Double_t *cuts) const; + void GetVertexerTracksCutsITS(Double_t *cuts) const + { GetVertexerTracksCuts(0,cuts); return; } + void GetVertexerTracksCutsTPC(Double_t *cuts) const + { GetVertexerTracksCuts(1,cuts); return; } + + AliGRPRecoParam(const AliGRPRecoParam&); + AliGRPRecoParam& operator=(const AliGRPRecoParam&); + + protected: + // + + Int_t fVertexerTracksNCuts; // number of cuts for AliVertexerTracks + // cuts for AliVertexerTracks: ITS mode + Double_t fVertexerTracksITSdcacut; // general dca + Double_t fVertexerTracksITSdcacutIter0; // dca in iteration 0 + Double_t fVertexerTracksITSmaxd0z0; // max d0z0 + Double_t fVertexerTracksITSminCls; // min clusters + Double_t fVertexerTracksITSmintrks; // min tracks + Double_t fVertexerTracksITSnsigma; // n sigma for d0 cut + Double_t fVertexerTracksITSnindetfitter; // min det to try inversion + Double_t fVertexerTracksITSmaxtgl; // max tgl + Double_t fVertexerTracksITSfidR; // fiducial radius + Double_t fVertexerTracksITSfidZ; // fiducial z + + // cuts for AliVertexerTracks: TPC-only mode + Double_t fVertexerTracksTPCdcacut; // general dca + Double_t fVertexerTracksTPCdcacutIter0; // dca in iteration 0 + Double_t fVertexerTracksTPCmaxd0z0; // max d0z0 + Double_t fVertexerTracksTPCminCls; // min clusters + Double_t fVertexerTracksTPCmintrks; // min tracks + Double_t fVertexerTracksTPCnsigma; // n sigma for d0 cut + Double_t fVertexerTracksTPCnindetfitter; // min det to try inversion + Double_t fVertexerTracksTPCmaxtgl; // max tgl + Double_t fVertexerTracksTPCfidR; // fiducial radius + Double_t fVertexerTracksTPCfidZ; // fiducial z + + ClassDef(AliGRPRecoParam,1) // global reco parameters +}; + +#endif diff --git a/STEER/AliRecoParam.cxx b/STEER/AliRecoParam.cxx index 02ed23397f1..898912cab78 100644 --- a/STEER/AliRecoParam.cxx +++ b/STEER/AliRecoParam.cxx @@ -121,7 +121,7 @@ const AliDetectorRecoParam *AliRecoParam::GetDetRecoParam(Int_t iDet) const { // Return AliDetectorRecoParam object for a given detector // according to the event specie provided as an argument - if ( iDet > kNDetectors) return NULL; + if ( iDet >= kNDetectors) return NULL; if (!fDetRecoParams[iDet]) return NULL; if (fDetRecoParams[iDet]->GetEntries() == 0) return NULL; diff --git a/STEER/AliRecoParam.h b/STEER/AliRecoParam.h index 801463573ce..a147dfa7ae7 100644 --- a/STEER/AliRecoParam.h +++ b/STEER/AliRecoParam.h @@ -28,7 +28,7 @@ class AliRecoParam : public TObject // enum { kNSpecies = 5, // number of event species - kNDetectors = 15 // number of detectors + kNDetectors = 16 // number of detectors (last one is GRP!) }; enum EventSpecie_t {kDefault = 1, kLowMult = 2, @@ -53,7 +53,7 @@ private: TObjArray *fDetRecoParams[kNDetectors]; // array with reconstruction-parameter objects for all detectors EventSpecie_t fEventSpecie; // current event specie - ClassDef(AliRecoParam, 4) + ClassDef(AliRecoParam, 5) }; diff --git a/STEER/AliReconstruction.cxx b/STEER/AliReconstruction.cxx index 89962a933f5..d850b264b0f 100644 --- a/STEER/AliReconstruction.cxx +++ b/STEER/AliReconstruction.cxx @@ -186,6 +186,7 @@ #include "AliMagWrapCheb.h" #include "AliDetectorRecoParam.h" +#include "AliGRPRecoParam.h" #include "AliRunInfo.h" #include "AliEventInfo.h" @@ -772,6 +773,14 @@ void AliReconstruction::SetRecoParam(const char* detector, AliDetectorRecoParam { // Set custom reconstruction parameters for a given detector // Single set of parameters for all the events + + // First check if the reco-params are global + if(!strcmp(detector, "GRP")) { + par->SetAsDefault(); + fRecoParam.AddDetRecoParam(fgkNDetectors,par); + return; + } + for (Int_t iDet = 0; iDet < fgkNDetectors; iDet++) { if(!strcmp(detector, fgkDetectorName[iDet])) { par->SetAsDefault(); @@ -1397,6 +1406,19 @@ Bool_t AliReconstruction::ProcessEvent(Int_t iEvent) GetEventInfo(); fRecoParam.SetEventSpecie(fRunInfo,fEventInfo); + // Set the reco-params + { + TString detStr = fLoadCDB; + for (Int_t iDet = 0; iDet < fgkNDetectors; iDet++) { + if (!IsSelected(fgkDetectorName[iDet], detStr)) continue; + AliReconstructor *reconstructor = GetReconstructor(iDet); + if (reconstructor && fRecoParam.GetDetRecoParamArray(iDet)) { + const AliDetectorRecoParam *par = fRecoParam.GetDetRecoParam(iDet); + reconstructor->SetRecoParam(par); + } + } + } + fRunLoader->GetEvent(iEvent); // QA on single raw @@ -1543,9 +1565,21 @@ Bool_t AliReconstruction::ProcessEvent(Int_t iEvent) runVertexFinderTracks=kFALSE; } } - if (runVertexFinderTracks) { + + if (runVertexFinderTracks) { + // Get the global reco-params. They are atposition 16 inside the array of detectors in fRecoParam + const AliGRPRecoParam *grpRecoParam = dynamic_cast(fRecoParam.GetDetRecoParam(fgkNDetectors)); + // TPC + ITS primary vertex ftVertexer->SetITSMode(); + // get cuts for vertexer from AliGRPRecoParam + if (grpRecoParam) { + Int_t nCutsVertexer = grpRecoParam->GetVertexerTracksNCuts(); + Double_t *cutsVertexer = new Double_t[nCutsVertexer]; + grpRecoParam->GetVertexerTracksCutsITS(cutsVertexer); + ftVertexer->SetCuts(cutsVertexer); + delete [] cutsVertexer; cutsVertexer = NULL; + } if(fDiamondProfile && fMeanVertexConstraint) { ftVertexer->SetVtxStart(fDiamondProfile); } else { @@ -1564,6 +1598,14 @@ Bool_t AliReconstruction::ProcessEvent(Int_t iEvent) // TPC-only primary vertex ftVertexer->SetTPCMode(); + // get cuts for vertexer from AliGRPRecoParam + if (grpRecoParam) { + Int_t nCutsVertexer = grpRecoParam->GetVertexerTracksNCuts(); + Double_t *cutsVertexer = new Double_t[nCutsVertexer]; + grpRecoParam->GetVertexerTracksCutsTPC(cutsVertexer); + ftVertexer->SetCuts(cutsVertexer); + delete [] cutsVertexer; cutsVertexer = NULL; + } if(fDiamondProfileTPC && fMeanVertexConstraint) { ftVertexer->SetVtxStart(fDiamondProfileTPC); } else { @@ -1644,7 +1686,7 @@ Bool_t AliReconstruction::ProcessEvent(Int_t iEvent) fEventInfo.Reset(); for (Int_t iDet = 0; iDet < fgkNDetectors; iDet++) { if (fReconstructor[iDet]) - fReconstructor[iDet]->SetRecoParam(NULL); + fReconstructor[iDet]->SetRecoParam(NULL); } fQASteer->Increment() ; @@ -1821,8 +1863,8 @@ Bool_t AliReconstruction::RunLocalEventReconstruction(const TString& detectors) loader->WriteRecPoints("OVERWRITE"); loader->UnloadRecPoints(); AliSysInfo::AddStamp(Form("LRec%s_%d",fgkDetectorName[iDet],eventNr), iDet,1,eventNr); - } - if ((detStr.CompareTo("ALL") != 0) && !detStr.IsNull()) { + } + if ((detStr.CompareTo("ALL") != 0) && !detStr.IsNull()) { AliError(Form("the following detectors were not found: %s", detStr.Data())); if (fStopOnError) return kFALSE; diff --git a/STEER/AliVertexerTracks.cxx b/STEER/AliVertexerTracks.cxx index 92c0359ce06..de798a17268 100644 --- a/STEER/AliVertexerTracks.cxx +++ b/STEER/AliVertexerTracks.cxx @@ -791,6 +791,24 @@ AliESDVertex* AliVertexerTracks::RemoveTracksFromVertex(AliESDVertex *inVtx, return outVtx; } //--------------------------------------------------------------------------- +void AliVertexerTracks::SetCuts(Double_t *cuts) +{ +// +// Cut values +// + SetDCAcut(cuts[0]); + SetDCAcutIter0(cuts[1]); + SetMaxd0z0(cuts[2]); + SetMinClusters((Int_t)(cuts[3])); + SetMinTracks((Int_t)(cuts[4])); + SetNSigmad0(cuts[5]); + SetMinDetFitter(cuts[6]); + SetMaxTgl(cuts[7]); + SetFiducialRZ(cuts[8],cuts[9]); + + return; +} +//--------------------------------------------------------------------------- void AliVertexerTracks::SetITSMode(Double_t dcacut, Double_t dcacutIter0, Double_t maxd0z0, diff --git a/STEER/AliVertexerTracks.h b/STEER/AliVertexerTracks.h index 121be35ea6c..2ae268c5ced 100644 --- a/STEER/AliVertexerTracks.h +++ b/STEER/AliVertexerTracks.h @@ -48,26 +48,27 @@ class AliVertexerTracks : public TObject { AliESDVertex* RemoveTracksFromVertex(AliESDVertex *inVtx, TObjArray *trkArray,UShort_t *id, Float_t *diamondxy); - void SetITSMode(Double_t dcacut=0.1, - Double_t dcacutIter0=0.1, - Double_t maxd0z0=0.5, - Int_t minCls=5, - Int_t mintrks=1, - Double_t nsigma=3., - Double_t mindetfitter=100., - Double_t maxtgl=1000., - Double_t fidR=3., - Double_t fidZ=30.); - void SetTPCMode(Double_t dcacut=0.1, - Double_t dcacutIter0=1.0, - Double_t maxd0z0=5.0, - Int_t minCls=10, - Int_t mintrks=1, - Double_t nsigma=3., - Double_t mindetfitter=0.1, - Double_t maxtgl=1.5, - Double_t fidR=3., - Double_t fidZ=30.); + void SetITSMode(Double_t dcacut=0.1, + Double_t dcacutIter0=0.1, + Double_t maxd0z0=0.5, + Int_t minCls=5, + Int_t mintrks=1, + Double_t nsigma=3., + Double_t mindetfitter=100., + Double_t maxtgl=1000., + Double_t fidR=3., + Double_t fidZ=30.); + void SetTPCMode(Double_t dcacut=0.1, + Double_t dcacutIter0=1.0, + Double_t maxd0z0=5.0, + Int_t minCls=10, + Int_t mintrks=1, + Double_t nsigma=3., + Double_t mindetfitter=0.1, + Double_t maxtgl=1.5, + Double_t fidR=3., + Double_t fidZ=30.); + void SetCuts(Double_t *cuts); void SetConstraintOff() { fConstraint=kFALSE; return; } void SetConstraintOn() { fConstraint=kTRUE; return; } void SetDebug(Int_t optdebug=0) { fDebug=optdebug; return; } diff --git a/STEER/STEERLinkDef.h b/STEER/STEERLinkDef.h index 6a579f6f31d..6e0fc9af4a9 100644 --- a/STEER/STEERLinkDef.h +++ b/STEER/STEERLinkDef.h @@ -147,6 +147,7 @@ #pragma link C++ class AliTriggerRunScalers+; #pragma link C++ class AliGRPPreprocessor+; +#pragma link C++ class AliGRPRecoParam+; #pragma link C++ class AliRunInfo+; #pragma link C++ class AliEventInfo+; diff --git a/STEER/libSTEER.pkg b/STEER/libSTEER.pkg index 3d9b6841b8b..f9965e2ad6b 100644 --- a/STEER/libSTEER.pkg +++ b/STEER/libSTEER.pkg @@ -65,6 +65,7 @@ AliRecoParam.cxx \ AliDetectorRecoParam.cxx \ AliPlaneEff.cxx \ AliTriggerRunScalers.cxx AliGRPPreprocessor.cxx \ +AliGRPRecoParam.cxx \ AliRunInfo.cxx AliEventInfo.cxx \ AliRelAlignerKalman.cxx -- 2.43.0