Skip to content

Commit 554ad2b

Browse files
authored
Merge branch 'master' into dependabot/github_actions/actions/upload-pages-artifact-3
2 parents b6cf0b9 + 2002d9c commit 554ad2b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+3773
-130
lines changed

.github/CODEOWNERS

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
.github/ @lobis
1+
.github/* @lobis
22
* @jgalan
3+
* @juanangp
4+
* @lobis
5+
* @nkx111
36
*.py @lobis
47
*.cmake @lobis
58
CMakelists.txt @lobis

.github/workflows/validation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ jobs:
248248
run: |
249249
source ${{ env.REST_PATH }}/thisREST.sh
250250
cd framework/pipeline/trex
251-
wget https://sultan.unizar.es/trexdm-readouts/readouts_v2.4.root
251+
wget https://rest-for-physics.github.io/trexdm-readouts/readouts_v2.4.root
252252
restManager --c 01_raw.rml --f R01928_tagTest_Vm_250_Vd_160_Pr_6_Gain_0x0_Shape_0xF_Clock_0x4-068.aqs
253253
restManager --c 02_signal.rml --f RawData_01928.root
254254
restManager --c 03_hits.rml --f Signals_01928.root

CMakeLists.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,27 @@ else ()
188188
set(REST_MPFR OFF)
189189
endif (${REST_MPFR} MATCHES "ON")
190190

191+
if (((${REST_ALL_LIBS} MATCHES "ON") AND (NOT DEFINED RESTLIB_AXION))
192+
OR (${RESTLIB_AXION} MATCHES "ON"))
193+
# GSL #### Find GSL
194+
find_package(GSL REQUIRED)
195+
196+
# Include GSL directories
197+
set(external_include_dirs ${external_include_dirs} ${GSL_INCLUDE_DIRS})
198+
199+
# Link GSL libraries
200+
set(external_libs ${external_libs};${GSL_LIBRARIES})
201+
202+
message(STATUS "Found GSL libraries : ${GSL_LIBRARIES}")
203+
message(STATUS "GSL headers : ${GSL_INCLUDE_DIRS}")
204+
205+
set(REST_GSL ON)
206+
else ()
207+
set(REST_GSL OFF)
208+
message(STATUS "GSL libraries not required")
209+
endif (((${REST_ALL_LIBS} MATCHES "ON") AND (NOT DEFINED RESTLIB_AXION))
210+
OR (${RESTLIB_AXION} MATCHES "ON"))
211+
191212
# CURL #####
192213
find_library(CURL_LIB curl)
193214
if (NOT ${CURL_LIB} STREQUAL "CURL_LIB-NOTFOUND")
273 KB
Loading
182 KB
Loading

macros/REST_AddComponentDataSet.C

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#include "TRestComponent.h"
2+
#include "TRestTask.h"
3+
4+
#ifndef RestTask_AddComponent
5+
#define RestTask_AddComponent
6+
7+
//*******************************************************************************************************
8+
//*** Description: This macro will load from an RML the component chosen in the arguments and it
9+
//*** will write it inside the file given as outputFile
10+
//***
11+
//*** --------------
12+
//*** Usage: restManager AddComponentDataSet components.rml sectionName [outputFile] [componentName] [update]
13+
//***
14+
//*** Arguments description:
15+
//***
16+
//*** - cfgFile: The RML configuration file where the component definition can be found.
17+
//*** - sectionName: The section name used to select a component inside the RML file.
18+
//*** - outputFile: The file where the component is written, by default is components.root.
19+
//*** - componentName: This argument allows to change the component name stored in the output file.
20+
//*** By default it will take the same value as section name.
21+
//*** - update: If disabled it will create a new file erasing any other previously added components.
22+
//*** It is enabled by default.
23+
//***
24+
//*******************************************************************************************************
25+
26+
Int_t REST_AddComponentDataSet(std::string cfgFile, std::string sectionName,
27+
std::string outputFile = "components.root", std::string componentName = "",
28+
Bool_t update = true) {
29+
TRestComponentDataSet comp(cfgFile.c_str(), sectionName.c_str());
30+
comp.Initialize();
31+
32+
TFile* f;
33+
if (update)
34+
f = TFile::Open(outputFile.c_str(), "UPDATE");
35+
else
36+
f = TFile::Open(outputFile.c_str(), "RECREATE");
37+
38+
if (componentName == "") componentName = sectionName;
39+
40+
comp.Write(componentName.c_str());
41+
42+
f->Close();
43+
44+
return 0;
45+
}
46+
#endif

macros/REST_AddComponentFormula.C

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#include "TRestComponent.h"
2+
#include "TRestTask.h"
3+
4+
#ifndef RestTask_AddComponentFormula
5+
#define RestTask_AddComponentFormula
6+
7+
//*******************************************************************************************************
8+
//*** Description: This macro will load from an RML the component chosen in the arguments and it
9+
//*** will write it inside the file given as outputFile
10+
//***
11+
//*** --------------
12+
//*** Usage: restManager AddComponentFormula components.rml sectionName [outputFile] [componentName] [update]
13+
//***
14+
//*** Arguments description:
15+
//***
16+
//*** - cfgFile: The RML configuration file where the component definition can be found.
17+
//*** - sectionName: The section name used to select a component inside the RML file.
18+
//*** - outputFile: The file where the component is written, by default is components.root.
19+
//*** - componentName: This argument allows to change the component name stored in the output file.
20+
//*** By default it will take the same value as section name.
21+
//*** - update: If disabled it will create a new file erasing any other previously added components.
22+
//*** It is enabled by default.
23+
//***
24+
//*******************************************************************************************************
25+
26+
Int_t REST_AddComponentFormula(std::string cfgFile, std::string sectionName,
27+
std::string outputFile = "components.root", std::string componentName = "",
28+
Bool_t update = true) {
29+
TRestComponentFormula comp(cfgFile.c_str(), sectionName.c_str());
30+
comp.Initialize();
31+
32+
TFile* f;
33+
if (update)
34+
f = TFile::Open(outputFile.c_str(), "UPDATE");
35+
else
36+
f = TFile::Open(outputFile.c_str(), "RECREATE");
37+
38+
if (componentName == "") componentName = sectionName;
39+
40+
comp.Write(componentName.c_str());
41+
42+
f->Close();
43+
44+
return 0;
45+
}
46+
#endif

macros/REST_CheckValidRuns.C

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,14 @@ namespace fs = std::filesystem;
3737
//*** CAUTION: Be aware that any non-REST file in the list will be removed if you use purge=1
3838
//***
3939
//*******************************************************************************************************
40-
Int_t REST_CheckValidRuns(TString namePattern, Bool_t purge = false) {
40+
Int_t REST_CheckValidRuns(std::string namePattern, Bool_t purge = false) {
4141
TGeoManager::SetVerboseLevel(0);
4242

4343
vector<std::string> filesNotWellClosed;
4444

4545
TRestStringOutput RESTLog;
4646

47-
string a = TRestTools::Execute((string)("ls -d -1 " + namePattern));
48-
vector<string> b = Split(a, "\n");
47+
std::vector<std::string> b = TRestTools::GetFilesMatchingPattern(namePattern, true);
4948

5049
Double_t totalTime = 0;
5150
int cont = 0;
@@ -76,11 +75,12 @@ Int_t REST_CheckValidRuns(TString namePattern, Bool_t purge = false) {
7675
}
7776

7877
RESTLog << "Run time (hours) : " << run->GetRunLength() / 3600. << RESTendl;
79-
if (run->GetRunLength() > 0) totalTime += run->GetRunLength() / 3600.;
78+
RESTLog << "Entries : " << run->GetEntries() << RESTendl;
8079

81-
if (run->GetEndTimestamp() == 0 || run->GetRunLength() < 0) {
80+
if (run->GetEndTimestamp() == 0 || run->GetRunLength() < 0 || run->GetEntries() == 0) {
8281
filesNotWellClosed.push_back(filename);
83-
}
82+
} else if (run->GetRunLength() > 0)
83+
totalTime += run->GetRunLength() / 3600.;
8484

8585
delete run;
8686

@@ -100,7 +100,6 @@ Int_t REST_CheckValidRuns(TString namePattern, Bool_t purge = false) {
100100
if (purge) {
101101
RESTLog << "---------------------------" << RESTendl;
102102
RESTLog << "The files have been removed" << RESTendl;
103-
RESTLog << "---------------------------" << RESTendl;
104103
}
105104
}
106105

macros/REST_OpenInputFile.C

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ void REST_OpenInputFile(const std::string& fileName) {
4646
printf("\n%s\n", " - dSet->PrintMetadata()");
4747
printf("%s\n", " - dSet->GetDataFrame().GetColumnNames()");
4848
printf("%s\n\n", " - dSet->GetTree()->GetEntries()");
49+
printf("%s\n", " - dSet->GetDataFrame().Display(\"\")->Print()");
4950
printf("%s\n\n", " - dSet->GetDataFrame().Display({\"colName1,colName2\"})->Print()");
5051
if (dSet) delete dSet;
5152
dSet = new TRestDataSet();

pipeline/panda-x/P3AutoChain.rml

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
2-
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
32
<!--In this example, when launching the analysis, we are doing following operations inside TRestManager:
43
1. Initialize TRestRun
54
1.1 set input and output file for TRestRun(here input and output is in "globals")
@@ -13,25 +12,17 @@
1312
2.4.1 add additional observables in the process
1413
3. Add a task to call TRestProcessRunner to run
1514
-->
16-
1715
<TRestManager name="CoBoDataAnalysis" title="Example" verboseLevel="info">
18-
19-
<TRestRun name="SJTU_Proto">
20-
<parameter name="runNumber" value="auto"/>//change this value to "auto" to enable database
21-
<parameter name="inputFileName" value="auto"/>
22-
</TRestRun>
23-
16+
<TRestRun name="SJTU_Proto"><parameter name="runNumber" value="auto"/>//change this value to "auto" to enable database
17+
<parameter name="inputFileName" value="auto"/></TRestRun>
2418
<TRestProcessRunner name="Processor" verboseLevel="info">
2519
<parameter name="eventsToProcess" value="0"/>
2620
<parameter name="threadNumber" value="2"/>
27-
2821
<parameter name="inputAnalysisStorage" value="on"/>
2922
<parameter name="inputEventStorage" value="off"/>
3023
<parameter name="outputEventStorage" value="on"/>
31-
3224
<addProcess type="TRestRawMultiCoBoAsAdToSignalProcess" name="virtualDAQ" value="ON"/>
33-
<addProcess type="TRestRawSignalAnalysisProcess" name="sAna" value="ON">
34-
<parameter name="pointsOverThreshold" value="3"/>
25+
<addProcess type="TRestRawSignalAnalysisProcess" name="sAna" value="ON"><parameter name="pointsOverThreshold" value="3"/>
3526
/// We define all observables except MinValue because it is not yet in validation chain
3627
<observable name="BaseLineMean" value="ON"/>
3728
<observable name="BaseLineSigmaMean" value="ON"/>
@@ -61,31 +52,20 @@
6152
<parameter name="zeroSuppression" value="true"/>
6253
<parameter name="nPointsOverThreshold" value="3"/>
6354
</addProcess>
64-
6555
<addProcess type="TRestRealTimeDrawingProcess" name="rD" value="ON" drawInterval="1000">
6656
<TRestAnalysisPlot name="TriggerRatePlot" previewPlot="false">
6757
<canvas size="(1000,800)" save="TriggerRate.png"/>
68-
<plot name="TriggerRate" title="Trigger Rate" xlabel="Seconds From Start" ylabel="Counts" value="ON"
69-
stats="ON">
58+
<plot name="TriggerRate" title="Trigger Rate" xlabel="Seconds From Start" ylabel="Counts" value="ON" stats="ON">
7059
<variable name="rateAna_SecondsFromStart" range="auto" nbins="100"/>
7160
</plot>
7261
</TRestAnalysisPlot>
7362
</addProcess>
74-
75-
7663
</TRestProcessRunner>
77-
7864
<addTask type="processEvents" value="ON"/>
79-
80-
8165
<globals>
8266
<searchPath value="$ENV{REST_INPUTDATA}/definitions/"/>
8367
<parameter name="mainDataPath" value=""/>
84-
8568
<parameter name="pointThreshold" value="3"/>
8669
</globals>
87-
8870
</TRestManager>
89-
90-
91-
<!--parameter here is accessible to all the classes-->
71+
<!--parameter here is accessible to all the classes-->

0 commit comments

Comments
 (0)