File tree Expand file tree Collapse file tree 5 files changed +48
-47
lines changed
Expand file tree Collapse file tree 5 files changed +48
-47
lines changed Original file line number Diff line number Diff line change @@ -103,9 +103,11 @@ jobs:
103103 source ${{ env.REST_PATH }}/thisREST.sh
104104 cd ${{ env.DETECTOR_LIB_PATH }}/pipeline/readout
105105 restManager --c generateReadout.rml --o readout.root
106- restRoot -b -q PrintReadout.C'("readout.root")' > print.txt
107- diff print.txt validation.txt > output.txt
108- python3 checkLines.py
106+ echo "Generating print.txt"
107+ restRoot -b -q PrintReadout.C'("readout.root")'
108+ ls
109+ echo "Validating"
110+ python3 compareFiles.py
109111 # We need to introduce basic validation here
110112 # - diff validation.txt print.txt
111113 # - name: Basic Readout
Original file line number Diff line number Diff line change @@ -15,7 +15,6 @@ void PrintReadout(TString fName) {
1515 exit (1 );
1616 }
1717
18- /*
1918 fstream file ;
2019 file .open ("print.txt" , ios ::out );
2120 string line ;
@@ -24,33 +23,13 @@ void PrintReadout(TString fName) {
2423 streambuf * stream_buffer_file = file .rdbuf ();
2524
2625 cout .rdbuf (stream_buffer_file );
27- */
28-
29- cout << "Filename : " << fileName << endl ;
3026
3127 TRestRun run (fname );
3228 TRestDetectorReadout * r = (TRestDetectorReadout * )run .GetMetadata ("Prototype_2020_06" );
3329 r -> PrintMetadata (3 );
34- /*
35- TFile* f = new TFile(fileName);
36-
37- TIter nextkey(f->GetListOfKeys());
38- TKey* key;
39- int n = 0;
40- while ((key = (TKey*)nextkey())) {
41- if (((string)(key->GetClassName())).find("TRestDetectorReadout") != -1) {
42- TObject* obj = f->Get(key->GetName());
43- TRestDetectorReadout& readout = *(TRestDetectorReadout*)obj;
44- readout[0].Print(1);
45- }
46- n++;
47- }
48-
49- f->Close();
5030
5131 cout .rdbuf (stream_buffer_cout ); // back to the old buffer
5232 file .close ();
53- */
5433
5534 return 0 ;
5635}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ import sys
2+
3+ with open ("print.txt" ) as file_1 :
4+ file_1_text = file_1 .readlines ()
5+
6+ with open ("validation.txt" ) as file_2 :
7+ file_2_text = file_2 .readlines ()
8+
9+ stop_removing = 0
10+ while not stop_removing :
11+ if len (file_1_text ) == 0 :
12+ break
13+ if file_1_text [0 ].rstrip ().find ("Number of readout planes" ) >= 0 :
14+ stop_removing = 1
15+ file_1_text .pop (0 )
16+
17+ stop_removing = 0
18+ while not stop_removing :
19+ if len (file_2_text ) == 0 :
20+ break
21+ if file_2_text [0 ].rstrip ().find ("Number of readout planes" ) >= 0 :
22+ stop_removing = 1
23+ file_2_text .pop (0 )
24+
25+ result = 0
26+ maxN = 2700
27+ n = 0
28+ for line in file_1_text :
29+ if line .rstrip () != file_2_text [n ].rstrip ():
30+ print ("XX:" + line .rstrip ())
31+ print ("YY:" + file_2_text [n ].rstrip ())
32+ result = 1
33+ n = n + 1
34+ if n > maxN :
35+ print ("Readout validation result " + str (result ))
36+ sys .exit (result )
37+
38+
39+ print ("Readout validation result " + str (result ))
40+ sys .exit (result )
Original file line number Diff line number Diff line change 1- = Loading libraries ...
2- - /home/jgalan/rest-framework/install/lib/libRestDetector.so
3- Heed:
4- Database path: /programas/garfield/6.26.06/share/Heed/database
5- - /home/jgalan/rest-framework/install/lib/libRestFramework.so
6- - /home/jgalan/rest-framework/install/lib/libRestRaw.so
7- - /home/jgalan/rest-framework/install/lib/libRestGeant4.so
8- - /home/jgalan/rest-framework/install/lib/libRestConnectors.so
9- - /home/jgalan/rest-framework/install/lib/libRestAxion.so
10-
11-
12- Processing PrintReadout.C("output.root")...
13- Filename : output.root
1+ <<<<<<< HEAD
2+ Processing PrintReadout.C("readout.root")...
143+++++++++++++++++++++++++++++++++++++++++++++
154TRestDetectorReadout content
165Config file : generateReadout.rml
@@ -20,7 +9,7 @@ Title : PANDA readout 7module
209REST Version : 2.3.15
2110REST Official release: No
2211Clean state: No
23- REST Commit : 2aae3c43
12+ REST Commit : 2bac46ca
2413REST Library version : 1.9
2514---------------------------------------
2615Number of readout planes : 1
You can’t perform that action at this time.
0 commit comments