diff --git a/Aux/EventBuilder.cpp b/Aux/EventBuilder.cpp index e2396dc..af4e280 100644 --- a/Aux/EventBuilder.cpp +++ b/Aux/EventBuilder.cpp @@ -47,9 +47,10 @@ int main(int argc, char **argv) { /// Form outFileName; TString outFileName = inFileName[0]; - int pos = outFileName.Index("_"); - pos = outFileName.Index("_", pos+1); - outFileName.Remove(pos); + int pos = outFileName.Last('/'); + pos = outFileName.Index("_", pos+1); // find next "_" + pos = outFileName.Index("_", pos+1); // find next "_" + outFileName.Remove(pos); // remove the rest outFileName += "_" + std::to_string(timeWindow); outFileName += ".root"; printf("-------> Out file name : %s \n", outFileName.Data()); diff --git a/Aux/EventBuilderNoTrace.cpp b/Aux/EventBuilderNoTrace.cpp index e26864e..6595214 100644 --- a/Aux/EventBuilderNoTrace.cpp +++ b/Aux/EventBuilderNoTrace.cpp @@ -44,9 +44,10 @@ int main(int argc, char **argv) { /// Form outFileName; TString outFileName = inFileName[0]; - int pos = outFileName.Index("_"); - pos = outFileName.Index("_", pos+1); - outFileName.Remove(pos); + int pos = outFileName.Last('/'); + pos = outFileName.Index("_", pos+1); // find next "_" + pos = outFileName.Index("_", pos+1); // find next "_" + outFileName.Remove(pos); // remove the rest outFileName += "_" + std::to_string(timeWindow) + "_noTrace"; outFileName += ".root"; printf("-------> Out file name : %s \n", outFileName.Data());