There is an inconsistency in a way the parameters of GRPRecoParam are
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 9 Sep 2011 20:52:01 +0000 (20:52 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 9 Sep 2011 20:52:01 +0000 (20:52 +0000)
transfered to AliVertexerTracks: CDB objects provides the number of
parameters it contains, but
param->GetCuts(double* pars) and AliVertexerTracks::SetPars(pars)
don't use the info on the array lenght (they fill/extract number of
params corresponding to current source code version).
which leads to array overflow when old GRPRecoParam is used.

Ruben

HLT/global/AliHLTGlobalOfflineVertexerComponent.cxx
STEER/ESD/AliVertexerTracks.cxx
STEER/ESD/AliVertexerTracks.h
STEER/STEER/AliGRPRecoParam.cxx
STEER/STEER/AliGRPRecoParam.h
STEER/STEER/AliReconstruction.cxx

index ed33eb6..8756266 100644 (file)
@@ -145,8 +145,8 @@ int AliHLTGlobalOfflineVertexerComponent::DoInit( int argc, const char** argv )
       if (grpRecoParam) {
        Int_t nCutsVertexer = grpRecoParam->GetVertexerTracksNCuts();
        Double_t *cutsVertexer = new Double_t[nCutsVertexer];
-       grpRecoParam->GetVertexerTracksCutsITS(cutsVertexer);
-       fVertexer->SetCuts(cutsVertexer);
+       grpRecoParam->GetVertexerTracksCutsITS(cutsVertexer,nCutsVertexer);
+       fVertexer->SetCuts(cutsVertexer,nCutsVertexer);
        delete [] cutsVertexer; cutsVertexer = NULL;
       }
       // to run on HLT events we do not require ITS refit
index 6fdd369..6b745a6 100644 (file)
@@ -989,36 +989,38 @@ AliESDVertex* AliVertexerTracks::RemoveConstraintFromVertex(AliESDVertex *inVtx,
   return outVtx;
 }
 //---------------------------------------------------------------------------
-void AliVertexerTracks::SetCuts(Double_t *cuts) 
+void AliVertexerTracks::SetCuts(Double_t *cuts, Int_t ncuts) 
 {
 //
 //  Cut values
 //
-  SetDCAcut(cuts[0]);
-  SetDCAcutIter0(cuts[1]);
-  SetMaxd0z0(cuts[2]);
-  if(fMode==0 && cuts[3]<0) SetITSrefitNotRequired();
-  SetMinClusters((Int_t)(TMath::Abs(cuts[3])));
-  SetMinTracks((Int_t)(cuts[4]));
-  SetNSigmad0(cuts[5]);
-  SetMinDetFitter(cuts[6]);
-  SetMaxTgl(cuts[7]);
-  SetFiducialRZ(cuts[8],cuts[9]);
-  fAlgo=(Int_t)(cuts[10]);
-  fAlgoIter0=(Int_t)(cuts[11]);
+  if (ncuts>0) SetDCAcut(cuts[0]);
+  if (ncuts>1) SetDCAcutIter0(cuts[1]);
+  if (ncuts>2) SetMaxd0z0(cuts[2]);
+  if (ncuts>3) if(fMode==0 && cuts[3]<0) SetITSrefitNotRequired();
+  if (ncuts>4) SetMinClusters((Int_t)(TMath::Abs(cuts[3])));
+  if (ncuts>5) SetMinTracks((Int_t)(cuts[4]));
+  if (ncuts>6) SetNSigmad0(cuts[5]);
+  if (ncuts>7) SetMinDetFitter(cuts[6]);
+  if (ncuts>8) SetMaxTgl(cuts[7]);
+  if (ncuts>9) SetFiducialRZ(cuts[8],cuts[9]);
+  if (ncuts>10) fAlgo=(Int_t)(cuts[10]);
+  if (ncuts>11) fAlgoIter0=(Int_t)(cuts[11]);
   //
-  if (cuts[12]>1.)   SetMVTukey2(cuts[12]);
-  if (cuts[13]>1.)   SetMVSig2Ini(cuts[13]);
-  if (cuts[14]>0.1)  SetMVMaxSigma2(cuts[14]);
-  if (cuts[15]>1e-5) SetMVMinSig2Red(cuts[15]);
-  if (cuts[16]>1e-5) SetMVMinDst(cuts[16]);
-  if (cuts[17]>0.5)  SetMVScanStep(cuts[17]);
-  SetMVMaxWghNtr(cuts[18]);
-  SetMVFinalWBinary(cuts[19]>0);
-  if (cuts[20]>20.)  SetBCSpacing(int(cuts[20]));
+  if (ncuts>12) if (cuts[12]>1.)   SetMVTukey2(cuts[12]);
+  if (ncuts>13) if (cuts[13]>1.)   SetMVSig2Ini(cuts[13]);
+  if (ncuts>14) if (cuts[14]>0.1)  SetMVMaxSigma2(cuts[14]);
+  if (ncuts>15) if (cuts[15]>1e-5) SetMVMinSig2Red(cuts[15]);
+  if (ncuts>16) if (cuts[16]>1e-5) SetMVMinDst(cuts[16]);
+  if (ncuts>17) if (cuts[17]>0.5)  SetMVScanStep(cuts[17]);
+  if (ncuts>18) SetMVMaxWghNtr(cuts[18]);
+  if (ncuts>19) SetMVFinalWBinary(cuts[19]>0);
+  if (ncuts>20) if (cuts[20]>20.)  SetBCSpacing(int(cuts[20]));
   //
-  if (fAlgo==kMultiVertexer) SetSelectOnTOFBunchCrossing(kTRUE,kTRUE);
-  else                       SetSelectOnTOFBunchCrossing(kFALSE,kTRUE);
+  if (ncuts>21) {
+    if (fAlgo==kMultiVertexer) SetSelectOnTOFBunchCrossing(kTRUE,kTRUE);
+    else                       SetSelectOnTOFBunchCrossing(kFALSE,kTRUE);
+  }
   return;
 }
 //---------------------------------------------------------------------------
index 9c51df1..50e253a 100644 (file)
@@ -88,7 +88,7 @@ class AliVertexerTracks : public TObject {
                   Double_t fidZ=30.,
                   Int_t finderAlgo=1,
                   Int_t finderAlgoIter0=4); 
-  void  SetCuts(Double_t *cuts);
+  void  SetCuts(Double_t *cuts, int ncuts);
   void  SetConstraintOff() { fConstraint=kFALSE; SetVtxStart(); SetVtxStartSigma(); return; }
   void  SetConstraintOn() { fConstraint=kTRUE; return; }
   void  SetDCAcut(Double_t maxdca) { fDCAcut=maxdca; return; }
index a745f85..7024ed2 100644 (file)
@@ -253,56 +253,56 @@ AliGRPRecoParam *AliGRPRecoParam::GetCosmicTestParam()
   return param;
 }
 //_____________________________________________________________________________
-void AliGRPRecoParam::GetVertexerTracksCuts(Int_t mode,Double_t *cuts) const {
+void AliGRPRecoParam::GetVertexerTracksCuts(Int_t mode,Double_t *cuts, int n) 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;
-    cuts[10]= fVertexerTracksTPCalgo;
-    cuts[11]= fVertexerTracksTPCalgoIter0;
+    if (n>0)  cuts[0] = fVertexerTracksTPCdcacut;
+    if (n>1)  cuts[1] = fVertexerTracksTPCdcacutIter0;
+    if (n>2)  cuts[2] = fVertexerTracksTPCmaxd0z0;
+    if (n>3)  cuts[3] = fVertexerTracksTPCminCls;
+    if (n>4)  cuts[4] = fVertexerTracksTPCmintrks;
+    if (n>5)  cuts[5] = fVertexerTracksTPCnsigma;
+    if (n>6)  cuts[6] = fVertexerTracksTPCnindetfitter;
+    if (n>7)  cuts[7] = fVertexerTracksTPCmaxtgl; 
+    if (n>8)  cuts[8] = fVertexerTracksTPCfidR;
+    if (n>9)  cuts[9] = fVertexerTracksTPCfidZ;
+    if (n>10) cuts[10]= fVertexerTracksTPCalgo;
+    if (n>11) cuts[11]= fVertexerTracksTPCalgoIter0;
     //
-    cuts[12]= fVertexerTracksTPCMVTukey2;
-    cuts[13]= fVertexerTracksTPCMVSig2Ini;
-    cuts[14]= fVertexerTracksTPCMVMaxSigma2;
-    cuts[15]= fVertexerTracksTPCMVMinSig2Red;
-    cuts[16]= fVertexerTracksTPCMVMinDst;
-    cuts[17]= fVertexerTracksTPCMVScanStep;
-    cuts[18]= fVertexerTracksTPCMVMaxWghNtr;
-    cuts[19]= fVertexerTracksTPCMVFinalWBinary;
-    cuts[20]= fVertexerTracksTPCMVBCSpacing;
+    if (n>12)  cuts[12]= fVertexerTracksTPCMVTukey2;
+    if (n>13)  cuts[13]= fVertexerTracksTPCMVSig2Ini;
+    if (n>14)  cuts[14]= fVertexerTracksTPCMVMaxSigma2;
+    if (n>15)  cuts[15]= fVertexerTracksTPCMVMinSig2Red;
+    if (n>16)  cuts[16]= fVertexerTracksTPCMVMinDst;
+    if (n>17)  cuts[17]= fVertexerTracksTPCMVScanStep;
+    if (n>18)  cuts[18]= fVertexerTracksTPCMVMaxWghNtr;
+    if (n>19)  cuts[19]= fVertexerTracksTPCMVFinalWBinary;
+    if (n>20)  cuts[20]= fVertexerTracksTPCMVBCSpacing;
   } 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;
-    cuts[10]= fVertexerTracksITSalgo;
-    cuts[11]= fVertexerTracksITSalgoIter0;
+    if (n>0 ) cuts[0] = fVertexerTracksITSdcacut;
+    if (n>1 ) cuts[1] = fVertexerTracksITSdcacutIter0;
+    if (n>2 ) cuts[2] = fVertexerTracksITSmaxd0z0;
+    if (n>3 ) cuts[3] = fVertexerTracksITSminCls;
+    if (n>4 ) cuts[4] = fVertexerTracksITSmintrks;
+    if (n>5 ) cuts[5] = fVertexerTracksITSnsigma;
+    if (n>6 ) cuts[6] = fVertexerTracksITSnindetfitter;
+    if (n>7 ) cuts[7] = fVertexerTracksITSmaxtgl; 
+    if (n>8 ) cuts[8] = fVertexerTracksITSfidR;
+    if (n>9 ) cuts[9] = fVertexerTracksITSfidZ;
+    if (n>10) cuts[10]= fVertexerTracksITSalgo;
+    if (n>11) cuts[11]= fVertexerTracksITSalgoIter0;
     //
-    cuts[12]= fVertexerTracksITSMVTukey2;
-    cuts[13]= fVertexerTracksITSMVSig2Ini;
-    cuts[14]= fVertexerTracksITSMVMaxSigma2;
-    cuts[15]= fVertexerTracksITSMVMinSig2Red;
-    cuts[16]= fVertexerTracksITSMVMinDst;
-    cuts[17]= fVertexerTracksITSMVScanStep;
-    cuts[18]= fVertexerTracksITSMVMaxWghNtr;
-    cuts[19]= fVertexerTracksITSMVFinalWBinary;
-    cuts[20]= fVertexerTracksITSMVBCSpacing;
+    if (n>12) cuts[12]= fVertexerTracksITSMVTukey2;
+    if (n>13) cuts[13]= fVertexerTracksITSMVSig2Ini;
+    if (n>14) cuts[14]= fVertexerTracksITSMVMaxSigma2;
+    if (n>15) cuts[15]= fVertexerTracksITSMVMinSig2Red;
+    if (n>16) cuts[16]= fVertexerTracksITSMVMinDst;
+    if (n>17) cuts[17]= fVertexerTracksITSMVScanStep;
+    if (n>18) cuts[18]= fVertexerTracksITSMVMaxWghNtr;
+    if (n>19) cuts[19]= fVertexerTracksITSMVFinalWBinary;
+    if (n>20) cuts[20]= fVertexerTracksITSMVBCSpacing;
   }
 
   return;
@@ -318,53 +318,53 @@ void AliGRPRecoParam::SetVertexerTracksCuts(Int_t mode,Int_t ncuts,Double_t cuts
   }
 
   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];
-    fVertexerTracksTPCalgo = cuts[10];
-    fVertexerTracksTPCalgoIter0 = cuts[11];
+    if (ncuts>0) fVertexerTracksTPCdcacut = cuts[0];
+    if (ncuts>1) fVertexerTracksTPCdcacutIter0 = cuts[1];
+    if (ncuts>2) fVertexerTracksTPCmaxd0z0 = cuts[2];
+    if (ncuts>3) fVertexerTracksTPCminCls = cuts[3];
+    if (ncuts>4) fVertexerTracksTPCmintrks = cuts[4];
+    if (ncuts>5) fVertexerTracksTPCnsigma = cuts[5];
+    if (ncuts>6) fVertexerTracksTPCnindetfitter = cuts[6];
+    if (ncuts>7) fVertexerTracksTPCmaxtgl = cuts[7]; 
+    if (ncuts>8) fVertexerTracksTPCfidR = cuts[8];
+    if (ncuts>9) fVertexerTracksTPCfidZ = cuts[9];
+    if (ncuts>10) fVertexerTracksTPCalgo = cuts[10];
+    if (ncuts>11) fVertexerTracksTPCalgoIter0 = cuts[11];
     //
-    fVertexerTracksTPCMVTukey2       = cuts[12];
-    fVertexerTracksTPCMVSig2Ini      = cuts[13];
-    fVertexerTracksTPCMVMaxSigma2    = cuts[14];
-    fVertexerTracksTPCMVMinSig2Red   = cuts[15];
-    fVertexerTracksTPCMVMinDst       = cuts[16];
-    fVertexerTracksTPCMVScanStep     = cuts[17];
-    fVertexerTracksTPCMVMaxWghNtr    = cuts[18];
-    fVertexerTracksTPCMVFinalWBinary = cuts[19];
-    fVertexerTracksTPCMVBCSpacing    = cuts[20];
+    if (ncuts>12) fVertexerTracksTPCMVTukey2       = cuts[12];
+    if (ncuts>13) fVertexerTracksTPCMVSig2Ini      = cuts[13];
+    if (ncuts>14) fVertexerTracksTPCMVMaxSigma2    = cuts[14];
+    if (ncuts>15) fVertexerTracksTPCMVMinSig2Red   = cuts[15];
+    if (ncuts>16) fVertexerTracksTPCMVMinDst       = cuts[16];
+    if (ncuts>17) fVertexerTracksTPCMVScanStep     = cuts[17];
+    if (ncuts>18) fVertexerTracksTPCMVMaxWghNtr    = cuts[18];
+    if (ncuts>19) fVertexerTracksTPCMVFinalWBinary = cuts[19];
+    if (ncuts>20) fVertexerTracksTPCMVBCSpacing    = cuts[20];
   } 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];
-    fVertexerTracksITSalgo = cuts[10];
-    fVertexerTracksITSalgoIter0 = cuts[11];
+    if (ncuts>0) fVertexerTracksITSdcacut = cuts[0];
+    if (ncuts>1) fVertexerTracksITSdcacutIter0 = cuts[1];
+    if (ncuts>2) fVertexerTracksITSmaxd0z0 = cuts[2];
+    if (ncuts>3) fVertexerTracksITSminCls = cuts[3];
+    if (ncuts>4) fVertexerTracksITSmintrks = cuts[4];
+    if (ncuts>5) fVertexerTracksITSnsigma = cuts[5];
+    if (ncuts>6) fVertexerTracksITSnindetfitter = cuts[6];
+    if (ncuts>7) fVertexerTracksITSmaxtgl = cuts[7]; 
+    if (ncuts>8) fVertexerTracksITSfidR = cuts[8];
+    if (ncuts>9) fVertexerTracksITSfidZ = cuts[9];
+    if (ncuts>10) fVertexerTracksITSalgo = cuts[10];
+    if (ncuts>11) fVertexerTracksITSalgoIter0 = cuts[11];
     //
-    fVertexerTracksITSMVTukey2       = cuts[12];
-    fVertexerTracksITSMVSig2Ini      = cuts[13];
-    fVertexerTracksITSMVMaxSigma2    = cuts[14];
-    fVertexerTracksITSMVMinSig2Red   = cuts[15];
-    fVertexerTracksITSMVMinDst       = cuts[16];
-    fVertexerTracksITSMVScanStep     = cuts[17];
-    fVertexerTracksITSMVMaxWghNtr    = cuts[18];
-    fVertexerTracksITSMVFinalWBinary = cuts[19];
-    fVertexerTracksITSMVBCSpacing    = cuts[20];
+    if (ncuts>12) fVertexerTracksITSMVTukey2       = cuts[12];
+    if (ncuts>13) fVertexerTracksITSMVSig2Ini      = cuts[13];
+    if (ncuts>14) fVertexerTracksITSMVMaxSigma2    = cuts[14];
+    if (ncuts>15) fVertexerTracksITSMVMinSig2Red   = cuts[15];
+    if (ncuts>16) fVertexerTracksITSMVMinDst       = cuts[16];
+    if (ncuts>17) fVertexerTracksITSMVScanStep     = cuts[17];
+    if (ncuts>18) fVertexerTracksITSMVMaxWghNtr    = cuts[18];
+    if (ncuts>19) fVertexerTracksITSMVFinalWBinary = cuts[19];
+    if (ncuts>20) fVertexerTracksITSMVBCSpacing    = cuts[20];
   }
-
+  //
   return;
 }
 //_____________________________________________________________________________
index f16192f..5def03b 100644 (file)
@@ -42,11 +42,11 @@ class AliGRPRecoParam : public AliDetectorRecoParam
   Int_t GetVertexerTracksNCuts() const { return fVertexerTracksNCuts; }
   Int_t GetVertexerV0NCuts() const { return fVertexerV0NCuts; }
   Int_t GetVertexerCascadeNCuts() const { return fVertexerCascadeNCuts; }
-  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; }
+  void  GetVertexerTracksCuts(Int_t mode,Double_t *cuts,Int_t n) const;
+  void  GetVertexerTracksCutsITS(Double_t *cuts,Int_t n) const
+  { GetVertexerTracksCuts(0,cuts,n); return; }
+  void  GetVertexerTracksCutsTPC(Double_t *cuts,Int_t n) const
+  { GetVertexerTracksCuts(1,cuts,n); return; }
   void  GetVertexerV0Cuts(Double_t *cuts) const;
   void  GetVertexerCascadeCuts(Double_t *cuts) const;
 
index e4b5de5..66b2bd7 100644 (file)
@@ -2017,8 +2017,8 @@ Bool_t AliReconstruction::ProcessEvent(Int_t iEvent)
        if (grpRecoParam) {
         Int_t nCutsVertexer = grpRecoParam->GetVertexerTracksNCuts();
         Double_t *cutsVertexer = new Double_t[nCutsVertexer];
-        grpRecoParam->GetVertexerTracksCutsITS(cutsVertexer);
-        ftVertexer->SetCuts(cutsVertexer);
+        grpRecoParam->GetVertexerTracksCutsITS(cutsVertexer,nCutsVertexer);
+        ftVertexer->SetCuts(cutsVertexer,nCutsVertexer);
         delete [] cutsVertexer; cutsVertexer = NULL; 
         if(grpRecoParam->GetVertexerTracksConstraintITS()) { 
           if(fDiamondProfile && fDiamondProfile->GetXRes()<kRadius){
@@ -2057,8 +2057,8 @@ Bool_t AliReconstruction::ProcessEvent(Int_t iEvent)
        if (grpRecoParam) {
         Int_t nCutsVertexer = grpRecoParam->GetVertexerTracksNCuts();
         Double_t *cutsVertexer = new Double_t[nCutsVertexer];
-        grpRecoParam->GetVertexerTracksCutsTPC(cutsVertexer);
-        ftVertexer->SetCuts(cutsVertexer);
+        grpRecoParam->GetVertexerTracksCutsTPC(cutsVertexer,nCutsVertexer);
+        ftVertexer->SetCuts(cutsVertexer,nCutsVertexer);
         delete [] cutsVertexer; cutsVertexer = NULL; 
         if(fDiamondProfileTPC && grpRecoParam->GetVertexerTracksConstraintTPC()) { 
           if(fDiamondProfileTPC->GetXRes()<kRadius) ftVertexer->SetVtxStart(fDiamondProfileTPC); // apply constraint only if sigmax is smaller than the beam pipe radius