#include <TFile.h>
#include <TClonesArray.h>
#include <TGraph.h>
-#include <TGeoMatrix.h>
#include <TMath.h>
#include <TGraphErrors.h>
#include "AliITSAlignMilleModule.h"
#include "AliITSAlignMille.h"
+#include "AliITSAlignMilleData.h"
#include "AliITSgeomTGeo.h"
#include "AliGeomManager.h"
#include "AliMillepede.h"
#include "AliTrackPointArray.h"
#include "AliAlignObjParams.h"
#include "AliLog.h"
-#include "TSystem.h"
+#include <TSystem.h>
#include "AliTrackFitterRieman.h"
/// \cond CLASSIMP
ClassImp(AliITSAlignMille)
/// \endcond
-Int_t AliITSAlignMille::fgNDetElem = ITSMILLE_NDETELEM;
-Int_t AliITSAlignMille::fgNParCh = ITSMILLE_NPARCH;
+Int_t AliITSAlignMille::fgNDetElem = ITSMILLENDETELEM;
+Int_t AliITSAlignMille::fgNParCh = ITSMILLENPARCH;
AliITSAlignMille::AliITSAlignMille(const Char_t *configFilename, Bool_t initmille)
: TObject(),
fStartFac(16.),
fResCutInitial(100.),
fResCut(100.),
- fNGlobal(ITSMILLE_NDETELEM*ITSMILLE_NPARCH),
+ fNGlobal(ITSMILLENDETELEM*ITSMILLENPARCH),
fNLocal(4),
- fNStdDev(ITSMILLE_NSTDEV),
+ fNStdDev(ITSMILLENSTDEV),
fIsMilleInit(kFALSE),
fParSigTranslations(0.0100),
fParSigRotations(0.1),
fMillepede = new AliMillepede();
fGlobalDerivatives = new Double_t[fNGlobal];
- for (Int_t i=0; i<ITSMILLE_NDETELEM*2; i++) {
+ for (Int_t i=0; i<ITSMILLENDETELEM*2; i++) {
fPreAlignQF[i]=-1;
fSensVolSigmaXfactor[i]=1.0;
fSensVolSigmaZfactor[i]=1.0;
}
if (strstr(st,"GEOMETRY_FILE")) {
- sscanf(st,"%s %s",tmp,st2);
+ memset(tmp,0,100*sizeof(char));
+ memset(st2,0,200*sizeof(char));
+ sscanf(st,"%99s %199s",tmp,st2);
if (gSystem->AccessPathName(st2)) {
AliInfo("*** WARNING! *** geometry file not found! ");
+ fclose(pfc);
return -1;
}
fGeometryFileName=st2;
}
if (strstr(st,"PREALIGNMENT_FILE")) {
- sscanf(st,"%s %s",tmp,st2);
+ memset(tmp,0,100*sizeof(char));
+ memset(st2,0,200*sizeof(char));
+ sscanf(st,"%99s %199s",tmp,st2);
if (gSystem->AccessPathName(st2)) {
AliInfo("*** WARNING! *** prealignment file not found! ");
+ fclose(pfc);
return -1;
}
fPreAlignmentFileName=st2;
itx=ApplyToGeometry();
if (itx) {
AliInfo(Form("*** WARNING! *** error %d reading prealignment file! ",itx));
+ fclose(pfc);
return -6;
}
}
if (strstr(st,"SUPERMODULE_FILE")) {
- sscanf(st,"%s %s",tmp,st2);
+ memset(tmp,0,100*sizeof(char));
+ memset(st2,0,200*sizeof(char));
+ sscanf(st,"%99s %199s",tmp,st2);
if (gSystem->AccessPathName(st2)) {
AliInfo("*** WARNING! *** supermodule file not found! ");
+ fclose(pfc);
return -1;
}
- if (LoadSuperModuleFile(st2)) return -1;
+ if (LoadSuperModuleFile(st2)) {fclose(pfc); return -1;}
}
if (strstr(st,"SET_B_FIELD")) {
- sscanf(st,"%s %f",tmp,&f1);
+ memset(tmp,0,100*sizeof(char));
+ sscanf(st,"%99s %f",tmp,&f1);
if (f1>0) {
fBField = f1;
fBOn = kTRUE;
}
if (strstr(st,"SET_PARSIG_TRA")) {
- sscanf(st,"%s %f",tmp,&f1);
+ memset(tmp,0,100*sizeof(char));
+ sscanf(st,"%99s %f",tmp,&f1);
fParSigTranslations=f1;
}
if (strstr(st,"SET_PARSIG_ROT")) {
- sscanf(st,"%s %f",tmp,&f1);
+ memset(tmp,0,100*sizeof(char));
+ sscanf(st,"%99s %f",tmp,&f1);
fParSigRotations=f1;
}
if (strstr(st,"SET_NSTDDEV")) {
- sscanf(st,"%s %d",tmp,&idx);
+ memset(tmp,0,100*sizeof(char));
+ sscanf(st,"%99s %d",tmp,&idx);
fNStdDev=idx;
}
if (strstr(st,"SET_RESCUT_INIT")) {
- sscanf(st,"%s %f",tmp,&f1);
+ memset(tmp,0,100*sizeof(char));
+ sscanf(st,"%99s %f",tmp,&f1);
fResCutInitial=f1;
}
if (strstr(st,"SET_RESCUT_OTHER")) {
- sscanf(st,"%s %f",tmp,&f1);
+ memset(tmp,0,100*sizeof(char));
+ sscanf(st,"%99s %f",tmp,&f1);
fResCut=f1;
}
if (strstr(st,"SET_LOCALSIGMAFACTOR")) {
- sscanf(st,"%s %f %f",tmp,&f1,&f2);
+ memset(tmp,0,100*sizeof(char));
+ sscanf(st,"%99s %f %f",tmp,&f1,&f2);
if (f1>0 && f2>0) {
fSigmaXfactor=f1;
fSigmaZfactor=f2;
}
if (strstr(st,"SET_STARTFAC")) {
- sscanf(st,"%s %f",tmp,&f1);
+ memset(tmp,0,100*sizeof(char));
+ sscanf(st,"%99s %f",tmp,&f1);
fStartFac=f1;
}
// ndet = detector number: 1-6 for LAYER and 1-3 for DETECTOR (SPD=1, SDD=2, SSD=3)
// updw = 1 for Y>0, -1 for Y<0, 0 if not specified
// nreqpts = minimum number of points of that type
- sscanf(st,"%s %s %d %d %d",tmp,st2,&itx,&ity,&itz);
+ memset(tmp,0,100*sizeof(char));
+ memset(st2,0,200*sizeof(char));
+ sscanf(st,"%99s %199s %d %d %d",tmp,st2,&itx,&ity,&itz);
itx--;
if (strstr(st2,"LAYER")) {
- if (itx<0 || itx>5) return -7;
+ if (itx<0 || itx>5) {fclose(pfc); return -7;}
if (ity>0) fNReqLayUp[itx]=itz;
else if (ity<0) fNReqLayDown[itx]=itz;
else fNReqLay[itx]=itz;
fRequirePoints=kTRUE;
}
else if (strstr(st2,"DETECTOR")) { // DETECTOR
- if (itx<0 || itx>2) return -7;
+ if (itx<0 || itx>2) {fclose(pfc); return -7;}
if (ity>0) fNReqDetUp[itx]=itz;
else if (ity<0) fNReqDetDown[itx]=itz;
else fNReqDet[itx]=itz;
if (strstr(st,"MODULE_INDEX")) { // works only for sensitive modules
f1=0; f2=0;
- sscanf(st,"%s %d %d %d %d %d %d %d %f %f",tmp,&idx,&itx,&ity,&itz,&iph,&ith,&ips,&f1,&f2);
- if (idx<0 || idx>2197) return 1; // bad index
+ memset(tmp,0,100*sizeof(char));
+ sscanf(st,"%99s %d %d %d %d %d %d %d %f %f",tmp,&idx,&itx,&ity,&itz,&iph,&ith,&ips,&f1,&f2);
+ if (idx<0 || idx>2197) {fclose(pfc); return 1;} // bad index
voluid=GetModuleVolumeID(idx);
- if (!voluid || voluid>14300) return 1; // bad index
+ if (!voluid || voluid>14300) {fclose(pfc); return 1;} // bad index
fModuleIndex[nmod]=idx;
fModuleVolumeID[nmod]=voluid;
fFreeParam[nmod][0]=itx;
if (strstr(st,"MODULE_VOLUID")) {
f1=0; f2=0;
- sscanf(st,"%s %d %d %d %d %d %d %d %f %f",tmp,&idx,&itx,&ity,&itz,&iph,&ith,&ips,&f1,&f2);
+ memset(tmp,0,100*sizeof(char));
+ sscanf(st,"%99s %d %d %d %d %d %d %d %f %f",tmp,&idx,&itx,&ity,&itz,&iph,&ith,&ips,&f1,&f2);
voluid=UShort_t(idx);
if (voluid>14335 && fUseSuperModules) { // custom supermodule
int ism=-1;
for (int j=0; j<fNSuperModules; j++) {
if (voluid==fSuperModule[j]->GetVolumeID()) ism=j;
}
- if (ism<0) return -1; // bad volid
+ if (ism<0) {fclose(pfc); return -1;} // bad volid
fModuleIndex[nmod]=fSuperModule[ism]->GetIndex();
fModuleVolumeID[nmod]=voluid;
fFreeParam[nmod][0]=itx;
}
else { // sensitive volume
idx=GetModuleIndex(voluid);
- if (idx<0 || idx>2197) return 1; // bad index
+ if (idx<0 || idx>2197) {fclose(pfc); return 1;} // bad index
fModuleIndex[nmod]=idx;
fModuleVolumeID[nmod]=voluid;
fFreeParam[nmod][0]=itx;
/// Fix non free parameters
for (Int_t i=0; i<fNModules; i++) {
- for (Int_t j=0; j<ITSMILLE_NPARCH; j++) {
- if (!fFreeParam[i][j]) FixParameter(i*ITSMILLE_NPARCH+j,0.0);
+ for (Int_t j=0; j<ITSMILLENPARCH; j++) {
+ if (!fFreeParam[i][j]) FixParameter(i*ITSMILLENPARCH+j,0.0);
else {
// pepopepo: da verificare il settaggio delle sigma, ma forse va bene...
Double_t parsig=0;
if (j<3) parsig=fParSigTranslations; // translations (0.0100 cm)
else parsig=fParSigRotations; // rotations (1/10 deg)
- FixParameter(i*ITSMILLE_NPARCH+j,parsig);
+ FixParameter(i*ITSMILLENPARCH+j,parsig);
}
}
}
}
}
+// newpep
Int_t AliITSAlignMille::ApplyToGeometry() {
/// apply starting realignment to ideal geometry
- if (!fGeoManager) return -1;
+ if(!AliGeomManager::GetGeometry()) return -1;
+
TFile *pref = new TFile(fPreAlignmentFileName.Data());
if (!pref->IsOpen()) return -2;
TClonesArray *prea=(TClonesArray*)pref->Get("ITSAlignObjs");
Int_t nprea=prea->GetEntriesFast();
AliInfo(Form("Array of input misalignments with %d entries",nprea));
+ AliGeomManager::ApplyAlignObjsToGeom(*prea); // apply all levels of objs
+
+ // set prealignment factor if defined...
for (int ix=0; ix<nprea; ix++) {
AliAlignObjParams *preo=(AliAlignObjParams*) prea->UncheckedAt(ix);
Int_t index=AliITSAlignMilleModule::GetIndexFromVolumeID(preo->GetVolUID());
fPreAlignQF[index] = (int) preo->GetUniqueID();
//printf("index=%d QF=%d\n",index,preo->GetUniqueID());
}
- if (!preo->ApplyToGeometry()) return -4;
+ //if (!preo->ApplyToGeometry()) return -4;
}
pref->Close();
delete pref;
fUsePreAlignment = kTRUE;
return 0;
}
+// endnewpep
-Int_t AliITSAlignMille::GetPreAlignmentQualityFactor(Int_t index) {
+Int_t AliITSAlignMille::GetPreAlignmentQualityFactor(Int_t index) const {
/// works for sensitive volumes
if (!fUsePreAlignment || index<0 || index>2197) return -1;
return fPreAlignQF[index];
}
-AliTrackPointArray *AliITSAlignMille::PrepareTrack(AliTrackPointArray *atp) {
+AliTrackPointArray *AliITSAlignMille::PrepareTrack(const AliTrackPointArray *atp) {
/// create a new AliTrackPointArray keeping only defined modules
/// move points according to a given prealignment, if any
/// sort alitrackpoints w.r.t. global Y direction, if selected
if (ndet[j]<fNReqDet[j]) isok=kFALSE;
}
if (!isok) {
- AliInfo("Track does not meet all location point requirements!");
+ AliDebug(2,Form("Track does not meet all location point requirements!"));
return NULL;
}
}
-AliTrackPointArray *AliITSAlignMille::SortTrack(AliTrackPointArray *atp) {
+AliTrackPointArray *AliITSAlignMille::SortTrack(const AliTrackPointArray *atp) {
/// sort alitrackpoints w.r.t. global Y direction
AliTrackPointArray *atps=NULL;
Int_t idx[20];
}
-AliITSAlignMilleModule *AliITSAlignMille::GetMilleModule(UShort_t voluid)
+AliITSAlignMilleModule *AliITSAlignMille::GetMilleModule(UShort_t voluid) const
{
// return pointer to a define supermodule
// return NULL if error
return fMilleModule[i];
}
-AliITSAlignMilleModule *AliITSAlignMille::GetCurrentModule()
+AliITSAlignMilleModule *AliITSAlignMille::GetCurrentModule() const
{
if (fNModules) return fMilleModule[fCurrentModuleInternalIndex];
return NULL;
}
Int_t nloceq=0;
- MilleData *md = new MilleData[npts];
+ AliITSAlignMilleData *md = new AliITSAlignMilleData[npts];
for (Int_t ipt=0; ipt<npts; ipt++) {
fTrack->GetPoint(fCluster,ipt);
return 0;
}
-Int_t AliITSAlignMille::CalcIntersectionPoint(Double_t *lpar, Double_t *gpar) {
+Int_t AliITSAlignMille::CalcIntersectionPoint(const Double_t *lpar, const Double_t *gpar) {
/// calculate intersection point of track with current module in local coordinates
/// according with a given set of parameters (local(4/5) and global(6))
/// and fill fPintLoc/Glo
/// return 0 if success
// copy initial parameters
- Double_t lpar[ITSMILLE_NLOCAL];
- Double_t gpar[ITSMILLE_NPARCH];
- for (Int_t i=0; i<ITSMILLE_NLOCAL; i++) lpar[i]=fLocalInitParam[i];
- for (Int_t i=0; i<ITSMILLE_NPARCH; i++) gpar[i]=fModuleInitParam[i];
+ Double_t lpar[ITSMILLENLOCAL];
+ Double_t gpar[ITSMILLENPARCH];
+ for (Int_t i=0; i<ITSMILLENLOCAL; i++) lpar[i]=fLocalInitParam[i];
+ for (Int_t i=0; i<ITSMILLENPARCH; i++) gpar[i]=fModuleInitParam[i];
// trial with fixed dpar...
Double_t dpar=0.0;
}
-Int_t AliITSAlignMille::AddLocalEquation(MilleData &m) {
+Int_t AliITSAlignMille::AddLocalEquation(AliITSAlignMilleData &m) {
/// Define local equation for current cluster in X and Z coor.
/// and store them to memory
/// return 0 if success
AliDebug(2,Form("Intesect. point: L( %f , %f , %f )",fPintLoc[0],fPintLoc[1],fPintLoc[2]));
// calculate local derivatives numerically
- Double_t dXdL[ITSMILLE_NLOCAL],dZdL[ITSMILLE_NLOCAL];
+ Double_t dXdL[ITSMILLENLOCAL],dZdL[ITSMILLENLOCAL];
for (Int_t i=0; i<fNLocal; i++) {
if (CalcDerivatives(i,kTRUE)) return -1;
dXdL[i]=fDerivativeXLoc;
dZdL[i]=fDerivativeZLoc;
}
- Double_t dXdG[ITSMILLE_NPARCH],dZdG[ITSMILLE_NPARCH];
- for (Int_t i=0; i<ITSMILLE_NPARCH; i++) {
+ Double_t dXdG[ITSMILLENPARCH],dZdG[ITSMILLENPARCH];
+ for (Int_t i=0; i<ITSMILLENPARCH; i++) {
if (CalcDerivatives(i,kFALSE)) return -1;
dXdG[i]=fDerivativeXLoc;
dZdG[i]=fDerivativeZLoc;
AliDebug(2,Form("\n***************\n"));
for (Int_t i=0; i<fNLocal; i++)
AliDebug(2,Form("Local parameter %d - dXdpar = %g - dZdpar = %g\n",i,dXdL[i],dZdL[i]));
- for (Int_t i=0; i<ITSMILLE_NPARCH; i++)
+ for (Int_t i=0; i<ITSMILLENPARCH; i++)
AliDebug(2,Form("Global parameter %d - dXdpar = %g - dZdpar = %g\n",i,dXdG[i],dZdG[i]));
AliDebug(2,Form("\n***************\n"));
Double_t nonzero=0.0;
for (Int_t i=0; i<fNLocal; i++) nonzero += TMath::Abs(dXdL[i]);
if (nonzero==0.0) {
- AliInfo("Aborting local equations for this point beacuse of zero local X derivatives!");
+ AliInfo("Discarding local equations for this point beacuse of zero local X derivatives!");
return -2;
}
nonzero=0.0;
- for (Int_t i=0; i<ITSMILLE_NPARCH; i++) nonzero += TMath::Abs(dXdG[i]);
+ for (Int_t i=0; i<ITSMILLENPARCH; i++) nonzero += TMath::Abs(dXdG[i]);
if (nonzero==0.0) {
- AliInfo("Aborting local equations for this point beacuse of zero global X derivatives!");
+ AliInfo("Discarding local equations for this point beacuse of zero global X derivatives!");
return -2;
}
nonzero=0.0;
for (Int_t i=0; i<fNLocal; i++) nonzero += TMath::Abs(dZdL[i]);
if (nonzero==0.0) {
- AliInfo("Aborting local equations for this point beacuse of zero local Z derivatives!");
+ AliInfo("Discarding local equations for this point beacuse of zero local Z derivatives!");
return -2;
}
nonzero=0.0;
- for (Int_t i=0; i<ITSMILLE_NPARCH; i++) nonzero += TMath::Abs(dZdG[i]);
+ for (Int_t i=0; i<ITSMILLENPARCH; i++) nonzero += TMath::Abs(dZdG[i]);
if (nonzero==0.0) {
- AliInfo("Aborting local equations for this point beacuse of zero global Z derivatives!");
+ AliInfo("Discarding local equations for this point beacuse of zero global Z derivatives!");
return -2;
}
AliDebug(2,Form("Adding local equation X with fMeas=%.6f and fSigma=%.6f",(fMeasLoc[0]-fPintLoc0[0]), fSigmaLoc[0]));
// set equation for Xloc coordinate
for (Int_t i=0; i<fNLocal; i++) {
- m.idxlocX[i]=i;
- m.derlocX[i]=dXdL[i];
+ m.GetIdxlocX()[i]=i;
+ m.GetDerlocX()[i]=dXdL[i];
}
- for (Int_t i=0; i<ITSMILLE_NPARCH; i++) {
- m.idxgloX[i]=fCurrentModuleInternalIndex*ITSMILLE_NPARCH+i;
- m.dergloX[i]=dXdG[i];
+ for (Int_t i=0; i<ITSMILLENPARCH; i++) {
+ m.GetIdxgloX()[i]=fCurrentModuleInternalIndex*ITSMILLENPARCH+i;
+ m.GetDergloX()[i]=dXdG[i];
}
- m.measX = fMeasLoc[0]-fPintLoc0[0];
- m.sigmaX = fSigmaLoc[0];
+ m.SetMeasX(fMeasLoc[0]-fPintLoc0[0]);
+ m.SetSigmaX(fSigmaLoc[0]);
AliDebug(2,Form("Adding local equation Z with fMeas=%.6f and fSigma=%.6f",(fMeasLoc[2]-fPintLoc0[2]), fSigmaLoc[2]));
// set equation for Zloc coordinate
for (Int_t i=0; i<fNLocal; i++) {
- m.idxlocZ[i]=i;
- m.derlocZ[i]=dZdL[i];
+ m.GetIdxlocZ()[i]=i;
+ m.GetDerlocZ()[i]=dZdL[i];
}
- for (Int_t i=0; i<ITSMILLE_NPARCH; i++) {
- m.idxgloZ[i]=fCurrentModuleInternalIndex*ITSMILLE_NPARCH+i;
- m.dergloZ[i]=dZdG[i];
+ for (Int_t i=0; i<ITSMILLENPARCH; i++) {
+ m.GetIdxgloZ()[i]=fCurrentModuleInternalIndex*ITSMILLENPARCH+i;
+ m.GetDergloZ()[i]=dZdG[i];
}
- m.measZ = fMeasLoc[2]-fPintLoc0[2];
- m.sigmaZ = fSigmaLoc[2];
+ m.SetMeasZ(fMeasLoc[2]-fPintLoc0[2]);
+ m.SetSigmaZ(fSigmaLoc[2]);
return 0;
}
-void AliITSAlignMille::SetLocalEquations(MilleData *m, Int_t neq) {
+void AliITSAlignMille::SetLocalEquations(const AliITSAlignMilleData *m, Int_t neq) {
/// Set local equations with data stored in m
/// return 0 if success
for (Int_t j=0; j<neq; j++) {
- AliDebug(2,Form("setting local equation X with fMeas=%.6f and fSigma=%.6f",m[j].measX, m[j].sigmaX));
+ AliDebug(2,Form("setting local equation X with fMeas=%.6f and fSigma=%.6f",m[j].GetMeasX(), m[j].GetSigmaX()));
// set equation for Xloc coordinate
for (Int_t i=0; i<fNLocal; i++)
- SetLocalDerivative( m[j].idxlocX[i], m[j].derlocX[i] );
+ SetLocalDerivative( m[j].GetIdxlocX()[i], m[j].GetDerlocX()[i] );
- for (Int_t i=0; i<ITSMILLE_NPARCH; i++)
- SetGlobalDerivative( m[j].idxgloX[i], m[j].dergloX[i] );
+ for (Int_t i=0; i<ITSMILLENPARCH; i++)
+ SetGlobalDerivative( m[j].GetIdxgloX()[i], m[j].GetDergloX()[i] );
- fMillepede->SetLocalEquation(fGlobalDerivatives, fLocalDerivatives, m[j].measX, m[j].sigmaX);
+ fMillepede->SetLocalEquation(fGlobalDerivatives, fLocalDerivatives, m[j].GetMeasX(), m[j].GetSigmaX());
- AliDebug(2,Form("setting local equation Z with fMeas=%.6f and fSigma=%.6f",m[j].measZ, m[j].sigmaZ));
+ AliDebug(2,Form("setting local equation Z with fMeas=%.6f and fSigma=%.6f",m[j].GetMeasZ(), m[j].GetSigmaZ()));
// set equation for Zloc coordinate
for (Int_t i=0; i<fNLocal; i++)
- SetLocalDerivative( m[j].idxlocZ[i], m[j].derlocZ[i] );
+ SetLocalDerivative( m[j].GetIdxlocZ()[i], m[j].GetDerlocZ()[i] );
- for (Int_t i=0; i<ITSMILLE_NPARCH; i++)
- SetGlobalDerivative( m[j].idxgloZ[i], m[j].dergloZ[i] );
+ for (Int_t i=0; i<ITSMILLENPARCH; i++)
+ SetGlobalDerivative( m[j].GetIdxgloZ()[i], m[j].GetDergloZ()[i] );
- fMillepede->SetLocalEquation(fGlobalDerivatives, fLocalDerivatives, m[j].measZ, m[j].sigmaZ);
+ fMillepede->SetLocalEquation(fGlobalDerivatives, fLocalDerivatives, m[j].GetMeasZ(), m[j].GetSigmaZ());
}
}
}
Int_t iRes = fMillepede->LocalFit(iTrack,lTrackParam,lSingleFit);
AliDebug(2,Form("iRes = %d",iRes));
- if (iRes && !lSingleFit) {
+ //if (iRes && !lSingleFit) {
+ if (!lSingleFit) { // Ruben Shahoyan's bug fix
fMillepede->SetNLocalEquations(fMillepede->GetNLocalEquations()+1);
}
}
Int_t nsma=sma->GetEntriesFast();
AliInfo(Form("Array of SuperModules with %d entries\n",nsma));
- Char_t st[250];
- char symname[150];
+ Char_t st[2048];
+ char symname[250];
UShort_t volid;
TGeoHMatrix m;
for (Int_t i=0; i<nsma; i++) {
AliAlignObjParams *a = (AliAlignObjParams*)sma->UncheckedAt(i);
volid=a->GetVolUID();
- strcpy(st,a->GetSymName());
+ strncpy(st,a->GetSymName(),TMath::Min(sizeof(st),strlen(a->GetSymName())+1));
a->GetMatrix(m);
-
- sscanf(st,"%s",symname);
+ memset(symname,0,250*sizeof(char));
+ sscanf(st,"%249s",symname);
// decode module list
char *stp=strstr(st,"ModuleList:");
if (!stp) return -3;
int idx[2200];
char spp[200]; int jp=0;
char cl[20];
- strcpy(st,stp);
+ strncpy(st,stp,TMath::Min(sizeof(st),strlen(stp)+1));
int l=strlen(st);
int j=0;
int n=0;
if (strlen(spp)) {
int k=strcspn(spp,"-");
if (k<int(strlen(spp))) { // c'e' il -
- strcpy(cl,&(spp[k+1]));
+ strncpy(cl,&(spp[k+1]), TMath::Min(sizeof(cl),strlen(&spp[k+1])+1));
spp[k]=0;
int ifrom=atoi(spp); int ito=atoi(cl);
for (int b=ifrom; b<=ito; b++) {