CMakeLists.txt 9.07 KB
Newer Older
1
2
# =====   Generate the needed shell scripts   ================================
GENERATE_ROOT_TEST_SCRIPT(${CBMROOT_SOURCE_DIR}/macro/run/run_tra_file.C)
3
4
GENERATE_ROOT_TEST_SCRIPT(${CBMROOT_SOURCE_DIR}/macro/run/run_transport_json_config.C)
GENERATE_ROOT_TEST_SCRIPT(${CBMROOT_SOURCE_DIR}/macro/run/run_digi_json_config.C)
5
GENERATE_ROOT_TEST_SCRIPT(${CBMROOT_SOURCE_DIR}/macro/run/run_tra_beam.C)
6
GENERATE_ROOT_TEST_SCRIPT(${CBMROOT_SOURCE_DIR}/macro/run/run_digi.C)
7
8
9
10
11
12
GENERATE_ROOT_TEST_SCRIPT(${CBMROOT_SOURCE_DIR}/macro/run/run_reco.C)
# ============================================================================


# =====   Copy the .rootrc file into the directory from which root is executed
# --- Otherwise the rootalias file is not loaded
13
file(COPY ${CBMROOT_SOURCE_DIR}/macro/include/.rootrc
14
15
16
17
18
	DESTINATION ${CBMROOT_BINARY_DIR}/macro/run)
# ============================================================================


# =====   Define variables for tests   =======================================
19
if($ENV{ctest_model} MATCHES Weekly)
20
  Set(nEvents 100)
21
22
  Set(uploadHistJPG 1)
  Set(pullDevAllowed .2)
23
24
else()
  Set(nEvents 3)
25
26
  Set(uploadHistJPG 0)
  Set(pullDevAllowed .5)
27
endIf()
28

29
30
31
math(EXPR timeOutTime "${nEvents} * 200")
math(EXPR nBeam "${nEvents} * 3")
# ============================================================================
32

33
34
35

# =====   Define the different setups to be tested with   ====================
if(($ENV{ctest_model} MATCHES Nightly) OR ($ENV{ctest_model} MATCHES Weekly))
36
  List(APPEND cbm_setup sis100_hadron sis100_electron sis100_muon_lmvm
37
38
  	sis100_muon_jpsi sis300_electron)
else()
39
  List(APPEND cbm_setup sis100_electron sis100_muon_jpsi)
40
41
42
43
44
endif()
# ============================================================================


# =====   Cleanup the data directory   =======================================
45
add_test(run_cleanup ${CMAKE_COMMAND}
46
	-P ${CMAKE_SOURCE_DIR}/cmake/scripts/cleanmacrodir.cmake)
47
set_tests_properties(run_cleanup PROPERTIES
48
49
50
51
52
53
54
55
56
57
	TIMEOUT ${timeOutTime}
	FIXTURES_SETUP cleanup
)
# ============================================================================


# =====   Define tests for each setup   ======================================
foreach(setup IN LISTS cbm_setup)

  # --- Short name for setup
58
  if(setup MATCHES sis100_hadron)
59
  	set(sname s100h)
60
  elseif(setup MATCHES sis100_electron)
61
  	set(sname s100e)
62
  elseif(setup MATCHES sis100_muon_lmvm)
63
  	set(sname s100m2)
64
  elseif(setup MATCHES sis100_muon_jpsi)
65
  	set(sname s100m3)
66
  elseif(setup MATCHES sis300_electron)
67
68
69
70
71
72
73
74
75
  	set(sname s300e)
  else()
  	set(sname test)
  endif()

  # --- Test run_tra_coll
  # --- Transport run with collision events, using run_tra_file.C
  set(testname run_${sname}_tra_coll)
  set(input ${CBMROOT_SOURCE_DIR}/input/urqmd.auau.10gev.centr.root)
76
  add_test(${testname} ${MACRO_DIR}/run_tra_file.sh
77
  	\"${input}\" ${nEvents} \"data/${sname}_coll\" \"${setup}\")
78
  set_tests_properties(${testname} PROPERTIES
79
80
81
82
83
84
  	TIMEOUT ${timeOutTime}
  	PASS_REGULAR_EXPRESSION "Macro finished successfully"
  	FIXTURES_REQUIRED cleanup
  	FIXTURES_SETUP "fixt_digi_ts_${setup};fixt_digi_ev_${setup}"
  	RESOURCE_LOCK collParDb_${setup}
  )
85

86
87
88
89
  # --- Test run_tra_sign
  # --- Transport run with signal events, using run_tra_file.C
  set(testname run_${sname}_tra_sign)
  set(input ${CBMROOT_SOURCE_DIR}/input/pluto.auau.8gev.omega.mpmm.0001.root)
90
  add_test(${testname} ${MACRO_DIR}/run_tra_file.sh
91
  	\"${input}\" ${nEvents} \"data/${sname}_sign\" \"${setup}\")
92
  set_tests_properties(${testname} PROPERTIES
93
94
95
96
97
98
  	TIMEOUT ${timeOutTime}
  	PASS_REGULAR_EXPRESSION "Macro finished successfully"
  	FIXTURES_REQUIRED cleanup
  	FIXTURES_SETUP fixt_digi_ts_${setup}
  	RESOURCE_LOCK signParDb_${setup}
  )
99

100
101
102
  # --- Test run_tra_beam
  # --- Transport run with beam events, using run_tra_beam.C
  set(testname run_${sname}_tra_beam)
103
  add_test(${testname} ${MACRO_DIR}/run_tra_beam.sh
104
  	${nBeam} \"Au\" 10 -1 \"data/${sname}_beam\" \"${setup}\")
105
  set_tests_properties(${testname} PROPERTIES
106
107
108
109
110
111
  	TIMEOUT ${timeOutTime}
  	PASS_REGULAR_EXPRESSION "Macro finished successfully"
  	FIXTURES_REQUIRED cleanup
  	FIXTURES_SETUP fixt_digi_ts_${setup}
  	RESOURCE_LOCK beamParDb_${setup}
  )
112

113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
  # --- Test run_transport_json_config
  # --- Transport run using run_transport_json_config.C
  set(testname run_transport_json_config)
  add_test(${testname} ${MACRO_DIR}/run_transport_json_config.sh)
  set_tests_properties(${testname} PROPERTIES
  	TIMEOUT ${timeOutTime}
  	PASS_REGULAR_EXPRESSION "Macro finished successfully"
  	FIXTURES_REQUIRED cleanup
  	FIXTURES_SETUP fixt_digi_json_config
  	RESOURCE_LOCK json_config_ParDb
  )

  # --- Test run_digi_json_config
  # --- Digitization run with using run_digi_json_config.C
  set(testname run_digi_json_config)
  add_test(${testname} ${MACRO_DIR}/run_digi_json_config.sh)
  set_tests_properties(${testname} PROPERTIES
  	TIMEOUT ${timeOutTime}
  	PASS_REGULAR_EXPRESSION "Macro finished successfully"
  	FIXTURES_REQUIRED fixt_digi_json_config
  	FIXTURES_SETUP fixt_reco_json_config
  	RESOURCE_LOCK json_config_ParDb
  )

137
138
139
  # --- Test run_digi_ev
  # --- Detector response simulation, event-by-event, using run_digi.C
  set(testname run_${sname}_digi_ev)
140
  add_test(${testname} ${MACRO_DIR}/run_digi.sh
141
  	\"data/${sname}_coll\" -1 \"data/${sname}_ev\" -1.)
142
  set_tests_properties(${testname} PROPERTIES
143
144
  	TIMEOUT ${timeOutTime}
  	PASS_REGULAR_EXPRESSION "Macro finished successfully"
145
	FIXTURES_REQUIRED fixt_digi_ev_${setup}
146
147
148
  	FIXTURES_SETUP fixt_reco_ev_${setup}
 	RESOURCE_LOCK collParDb_${setup}
  )
149

150
151
152
153
154
155
  # --- Test run_digi_ts
  # --- Detector response simulation, time-based, using run_digi.C
  set(testname run_${sname}_digi_ts)
  set(eventrate 1.e7)
  set(beamrate 1.e9)
  set(tslength 1.e6)
156
157
  add_test(${testname} ${MACRO_DIR}/run_digi.sh
  	\"data/${sname}_coll\" -1 \"data/${sname}_ts\"\ ${eventrate} ${tslength}
158
  	\"data/${sname}_sign\" \"data/${sname}_beam\" ${beamrate})
159
  set_tests_properties(${testname} PROPERTIES
160
161
162
163
164
165
  	TIMEOUT ${timeOutTime}
  	PASS_REGULAR_EXPRESSION "Macro finished successfully"
 	FIXTURES_REQUIRED fixt_digi_ts_${setup}
  	FIXTURES_SETUP fixt_reco_ts_${setup}
 	RESOURCE_LOCK collParDb_${setup}
  )
166

167
  # --- Test run_reco_ev_ideal
168
  # --- Event-by-event reconstruction from event-based simulation
169
170
  # --- Ideal raw event builder
  set(testname run_${sname}_reco_ev_ideal)
171
  add_test(${testname} ${MACRODIR}/run_reco.sh
172
  	\"data/${sname}_ev\" -1 0 \"data/${sname}_eb_eb_ideal\" \"Ideal\" \"${setup}\" \"data/${sname}_coll\")
173
  set_tests_properties(${testname} PROPERTIES
174
175
  	TIMEOUT ${timeOutTime}
  	PASS_REGULAR_EXPRESSION "Macro finished successfully"
176
	FIXTURES_REQUIRED fixt_reco_ev_${setup}
177
178
 	RESOURCE_LOCK collParDb_${setup}
  )
179
180
181
182
183
184
185
186
187
188
189
190
191
192
  
  # --- Test run_reco_ev_real
  # --- Event-by-event reconstruction from event-based simulation
  # --- Real raw event builder
  set(testname run_${sname}_reco_ev_real)
  add_test(${testname} ${MACRODIR}/run_reco.sh
    \"data/${sname}_ev\" -1 0 \"data/${sname}_eb_eb_real\" \"Real\" \"${setup}\"
    \"data/${sname}_coll\")
  set_tests_properties(${testname} PROPERTIES
    TIMEOUT ${timeOutTime}
    PASS_REGULAR_EXPRESSION "Macro finished successfully"
    FIXTURES_REQUIRED fixt_reco_ev_${setup}
    RESOURCE_LOCK collParDb_${setup}
  )
193

194
  # --- Test run_reco_ts_eb_ideal
195
  # --- Event-by-event reconstruction from time-based simulation
196
197
  # --- Ideal raw event builder
  set(testname run_${sname}_reco_ts_eb_ideal)
198
  add_test(${testname} ${MACRODIR}/run_reco.sh
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
  	\"data/${sname}_ts\" -1 0 \"data/${sname}_ts_eb_ideal\" \"Ideal\" \"${setup}\"
  	\"data/${sname}_coll\")
  set_tests_properties(${testname} PROPERTIES
  	TIMEOUT ${timeOutTime}
  	PASS_REGULAR_EXPRESSION "Macro finished successfully"
	FIXTURES_REQUIRED fixt_reco_ts_${setup}
 	RESOURCE_LOCK collParDb_${setup}
  )
  
  # --- Test run_reco_ts_eb_real
  # --- Event-by-event reconstruction from time-based simulation
  # --- Real raw event builder
  set(testname run_${sname}_reco_ts_eb_real)
  add_test(${testname} ${MACRODIR}/run_reco.sh
  	\"data/${sname}_ts\" -1 0 \"data/${sname}_ts_eb_real\" \"Real\" \"${setup}\"
214
  	\"data/${sname}_coll\")
215
  set_tests_properties(${testname} PROPERTIES
216
217
  	TIMEOUT ${timeOutTime}
  	PASS_REGULAR_EXPRESSION "Macro finished successfully"
218
	FIXTURES_REQUIRED fixt_reco_ts_${setup}
219
220
 	RESOURCE_LOCK collParDb_${setup}
  )
221

222
223
224
225
  # --- Test run_reco_ts_tb
  # --- Time-based reconstruction from time-based simulation
  set(testname run_${sname}_reco_ts_tb)
  add_test(${testname} ${MACRODIR}/run_reco.sh
226
  	\"data/${sname}_ts\" -1 0 \"data/${sname}_ts_tb\" \"\" \"${setup}\"
227
  	\"data/${sname}_coll\")
228
  set_tests_properties(${testname} PROPERTIES
229
230
  	TIMEOUT ${timeOutTime}
  	PASS_REGULAR_EXPRESSION "Macro finished successfully"
231
	FIXTURES_REQUIRED fixt_reco_ts_${setup}
232
233
 	RESOURCE_LOCK collParDb_${setup}
  )
234

235
236
endforeach(setup IN LISTS cbm_setup)
# ============================================================================
237

238
239
Install(FILES .rootrc run_tra_file.C run_tra_beam.C run_transport_json_config.C run_digi_json_config.C config.json
              run_digi.C run_reco.C run_tests.sh
240
241
242
        DESTINATION share/cbmroot/macro/run
       )
Install(CODE "FILE(MAKE_DIRECTORY \${CMAKE_INSTALL_PREFIX}/share/cbmroot/macro/run/data)")