Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
nptool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
np
nptool
Commits
9f8c5196
Commit
9f8c5196
authored
5 months ago
by
Theodore Efremov
Browse files
Options
Downloads
Patches
Plain Diff
Changed my snakefile and added a macro to merge root file
parent
bcfee946
No related branches found
No related tags found
1 merge request
!27
Draft: [Epic] Preparation of the environement for the new GaseousDetectorScorers...
Pipeline
#359185
passed
5 months ago
Stage: build-NPLib
Stage: build-NPSimulation
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Projects/AlPhaPha/2024/Snakefile
+1
-1
1 addition, 1 deletion
Projects/AlPhaPha/2024/Snakefile
Projects/AlPhaPha/DataMacro/Merger.C
+6
-8
6 additions, 8 deletions
Projects/AlPhaPha/DataMacro/Merger.C
with
7 additions
and
9 deletions
Projects/AlPhaPha/2024/Snakefile
+
1
−
1
View file @
9f8c5196
...
@@ -26,7 +26,7 @@ rule all:
...
@@ -26,7 +26,7 @@ rule all:
input:
input:
expand("{file}",file=analysedfile)
expand("{file}",file=analysedfile)
# Règle pour convertir les fichiers
.fast dans le dossier .cat en .root
# Règle pour convertir les fichiers
raw en analysé
rule npanalysis:
rule npanalysis:
input:
input:
f"{input_directory}/{{name}}.root"
f"{input_directory}/{{name}}.root"
...
...
This diff is collapsed.
Click to expand it.
Projects/AlPhaPha/DataMacro/Merger.C
+
6
−
8
View file @
9f8c5196
void
Merger
(
int
N
,
const
char
*
outputDir
,
const
char
*
outputFileName
,
const
char
*
inputBaseName
)
{
void
Merger
(
int
N
,
const
char
*
outputDir
,
const
char
*
outputFileName
,
const
char
*
inputBaseName
)
{
TString
outputPath
=
Form
(
"%s/%s"
,
outputDir
,
outputFileName
);
TString
outputPath
=
Form
(
"%s/%s
.root
"
,
outputDir
,
outputFileName
);
TFile
*
outputFile
=
new
TFile
(
outputPath
,
"RECREATE"
)
;
TFile
Merger
merger
;
TList
*
fileList
=
new
TList
();
merger
.
OutputFile
(
outputPath
,
"RECREATE"
);
// Correct usage: specify the output file path directly
for
(
int
i
=
0
;
i
<
N
;
i
++
)
{
for
(
int
i
=
0
;
i
<
N
;
i
++
)
{
TString
fileName
=
Form
(
"%s%d.root"
,
inputBaseName
,
i
);
// Base name + index + .root
TString
fileName
=
Form
(
"%s%d.root"
,
inputBaseName
,
i
);
// Base name + index + .root
...
@@ -10,18 +10,16 @@ void Merger(int N, const char* outputDir, const char* outputFileName, const char
...
@@ -10,18 +10,16 @@ void Merger(int N, const char* outputDir, const char* outputFileName, const char
std
::
cerr
<<
"Error opening file: "
<<
fileName
<<
std
::
endl
;
std
::
cerr
<<
"Error opening file: "
<<
fileName
<<
std
::
endl
;
continue
;
continue
;
}
}
fileList
->
Add
(
inputFile
);
merger
.
AddFile
(
fileName
);
// Add file to the merger
// Display progress
// Display progress
int
progress
=
((
i
+
1
)
*
100
)
/
N
;
int
progress
=
((
i
+
1
)
*
100
)
/
N
;
std
::
cout
<<
"
\r
Merging files: "
<<
progress
<<
"% complete."
<<
std
::
flush
;
std
::
cout
<<
"
\r
Merging files: "
<<
progress
<<
"% complete."
<<
std
::
flush
;
}
}
TFileMerger
merger
;
// Perform the merge operation
merger
.
OutputFile
(
outputFile
,
"RECREATE"
);
merger
.
Merge
();
merger
.
Merge
(
fileList
);
std
::
cout
<<
std
::
endl
<<
"Merging completed! Output saved at: "
<<
outputPath
<<
std
::
endl
;
std
::
cout
<<
std
::
endl
<<
"Merging completed! Output saved at: "
<<
outputPath
<<
std
::
endl
;
outputFile
->
Close
();
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment