Merge lp:~christopher-hunt08/maus/maus_scifi_updates into lp:maus/merge
- maus_scifi_updates
- Merge into merge
Proposed by
Christopher Hunt
Status: | Merged |
---|---|
Merged at revision: | 1114 |
Proposed branch: | lp:~christopher-hunt08/maus/maus_scifi_updates |
Merge into: | lp:maus/merge |
Diff against target: |
359 lines (+111/-43) 6 files modified
bin/user/scifi/tracker_resolution_plots.py (+10/-10) bin/utilities/data_tracker_verify.py (+70/-9) src/common_cpp/Recon/SciFi/SciFiGeometryHelper.cc (+5/-1) src/common_py/analysis/inspectors.py (+3/-1) src/common_py/analysis/tools.py (+17/-19) src/map/MapCppTrackerVirtualsDigitization/MapCppTrackerVirtualsDigitization.cc (+6/-3) |
To merge this branch: | bzr merge lp:~christopher-hunt08/maus/maus_scifi_updates |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
MAUS Maintainers | Pending | ||
Review via email: mp+297830@code.launchpad.net |
Commit message
Description of the change
Straight track alignment fix.
To post a comment you must log in.
- 1069. By Christopher Hunt
-
Fixed Style tests
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'bin/user/scifi/tracker_resolution_plots.py' | |||
2 | --- bin/user/scifi/tracker_resolution_plots.py 2016-05-24 16:01:44 +0000 | |||
3 | +++ bin/user/scifi/tracker_resolution_plots.py 2016-06-20 10:16:19 +0000 | |||
4 | @@ -179,7 +179,7 @@ | |||
5 | 179 | 179 | ||
6 | 180 | 180 | ||
7 | 181 | tracker_dict['residual_xy'] = ROOT.TH2F( tracker+'_residual_xy', \ | 181 | tracker_dict['residual_xy'] = ROOT.TH2F( tracker+'_residual_xy', \ |
9 | 182 | 'Residual Position', 500, -50.0, 50.0, 500, -50.0, 50.0 ) | 182 | 'Residual Position', 800, -20.0, 20.0, 800, -20.0, 20.0 ) |
10 | 183 | 183 | ||
11 | 184 | tracker_dict['residual_mxmy'] = ROOT.TH2F( tracker+'_residual_mxmy', \ | 184 | tracker_dict['residual_mxmy'] = ROOT.TH2F( tracker+'_residual_mxmy', \ |
12 | 185 | 'Residual Gradient', 500, -0.5, 0.5, 500, -0.5, 0.5 ) | 185 | 'Residual Gradient', 500, -0.5, 0.5, 500, -0.5, 0.5 ) |
13 | @@ -252,13 +252,13 @@ | |||
14 | 252 | 252 | ||
15 | 253 | tracker_dict['x_residual_p'] = ROOT.TH2F( \ | 253 | tracker_dict['x_residual_p'] = ROOT.TH2F( \ |
16 | 254 | tracker+'_x_residual_p', "X Residuals in p", \ | 254 | tracker+'_x_residual_p', "X Residuals in p", \ |
18 | 255 | PZ_BIN, PZ_MIN, PZ_MAX, 500, -50.0, 50.0 ) | 255 | PZ_BIN, PZ_MIN, PZ_MAX, 500, -20.0, 20.0 ) |
19 | 256 | tracker_dict['y_residual_p'] = ROOT.TH2F( \ | 256 | tracker_dict['y_residual_p'] = ROOT.TH2F( \ |
20 | 257 | tracker+'_y_residual_p', "Y Residuals in p", \ | 257 | tracker+'_y_residual_p', "Y Residuals in p", \ |
22 | 258 | PZ_BIN, PZ_MIN, PZ_MAX, 500, -50.0, 50.0 ) | 258 | PZ_BIN, PZ_MIN, PZ_MAX, 500, -20.0, 20.0 ) |
23 | 259 | tracker_dict['r_residual_p'] = ROOT.TH2F( \ | 259 | tracker_dict['r_residual_p'] = ROOT.TH2F( \ |
24 | 260 | tracker+'_r_residual_p', "Radius Residuals in p", \ | 260 | tracker+'_r_residual_p', "Radius Residuals in p", \ |
26 | 261 | PZ_BIN, PZ_MIN, PZ_MAX, 500, -50.0, 50.0 ) | 261 | PZ_BIN, PZ_MIN, PZ_MAX, 500, 0.0, 50.0 ) |
27 | 262 | 262 | ||
28 | 263 | tracker_dict['px_residual_p'] = ROOT.TH2F( \ | 263 | tracker_dict['px_residual_p'] = ROOT.TH2F( \ |
29 | 264 | tracker+'_px_residual_p', "p_{x} Residuals in p", \ | 264 | tracker+'_px_residual_p', "p_{x} Residuals in p", \ |
30 | @@ -281,13 +281,13 @@ | |||
31 | 281 | 281 | ||
32 | 282 | tracker_dict['x_residual_pt'] = ROOT.TH2F( \ | 282 | tracker_dict['x_residual_pt'] = ROOT.TH2F( \ |
33 | 283 | tracker+'_x_residual_pt', "X Residuals in p_{t}", \ | 283 | tracker+'_x_residual_pt', "X Residuals in p_{t}", \ |
35 | 284 | PT_BIN, PT_MIN, PT_MAX, 500, -50.0, 50.0 ) | 284 | PT_BIN, PT_MIN, PT_MAX, 500, -20.0, 20.0 ) |
36 | 285 | tracker_dict['y_residual_pt'] = ROOT.TH2F( \ | 285 | tracker_dict['y_residual_pt'] = ROOT.TH2F( \ |
37 | 286 | tracker+'_y_residual_pt', "Y Residuals in p_{t}", \ | 286 | tracker+'_y_residual_pt', "Y Residuals in p_{t}", \ |
39 | 287 | PT_BIN, PT_MIN, PT_MAX, 500, -50.0, 50.0 ) | 287 | PT_BIN, PT_MIN, PT_MAX, 500, -20.0, 20.0 ) |
40 | 288 | tracker_dict['r_residual_pt'] = ROOT.TH2F( \ | 288 | tracker_dict['r_residual_pt'] = ROOT.TH2F( \ |
41 | 289 | tracker+'_r_residual_pt', "Radius Residuals in p_{t}", \ | 289 | tracker+'_r_residual_pt', "Radius Residuals in p_{t}", \ |
43 | 290 | PT_BIN, PT_MIN, PT_MAX, 500, -50.0, 50.0 ) | 290 | PT_BIN, PT_MIN, PT_MAX, 500, 0.0, 50.0 ) |
44 | 291 | 291 | ||
45 | 292 | tracker_dict['px_residual_pt'] = ROOT.TH2F( \ | 292 | tracker_dict['px_residual_pt'] = ROOT.TH2F( \ |
46 | 293 | tracker+'_px_residual_pt', "p_{x} Residuals in p_{t}", \ | 293 | tracker+'_px_residual_pt', "p_{x} Residuals in p_{t}", \ |
47 | @@ -310,13 +310,13 @@ | |||
48 | 310 | 310 | ||
49 | 311 | tracker_dict['x_residual_pz'] = ROOT.TH2F( \ | 311 | tracker_dict['x_residual_pz'] = ROOT.TH2F( \ |
50 | 312 | tracker+'_x_residual_pz', "X Residuals in p_{z}", \ | 312 | tracker+'_x_residual_pz', "X Residuals in p_{z}", \ |
52 | 313 | PZ_BIN, PZ_MIN, PZ_MAX, 500, -50.0, 50.0 ) | 313 | PZ_BIN, PZ_MIN, PZ_MAX, 500, -20.0, 20.0 ) |
53 | 314 | tracker_dict['y_residual_pz'] = ROOT.TH2F( \ | 314 | tracker_dict['y_residual_pz'] = ROOT.TH2F( \ |
54 | 315 | tracker+'_y_residual_pz', "Y Residuals in p_{z}", \ | 315 | tracker+'_y_residual_pz', "Y Residuals in p_{z}", \ |
56 | 316 | PZ_BIN, PZ_MIN, PZ_MAX, 500, -50.0, 50.0 ) | 316 | PZ_BIN, PZ_MIN, PZ_MAX, 500, -20.0, 20.0 ) |
57 | 317 | tracker_dict['r_residual_pz'] = ROOT.TH2F( \ | 317 | tracker_dict['r_residual_pz'] = ROOT.TH2F( \ |
58 | 318 | tracker+'_r_residual_pz', "Radius Residuals in p_{z}", \ | 318 | tracker+'_r_residual_pz', "Radius Residuals in p_{z}", \ |
60 | 319 | PZ_BIN, PZ_MIN, PZ_MAX, 500, -50.0, 50.0 ) | 319 | PZ_BIN, PZ_MIN, PZ_MAX, 500, 0.0, 50.0 ) |
61 | 320 | 320 | ||
62 | 321 | tracker_dict['mx_residual_pz'] = ROOT.TH2F( \ | 321 | tracker_dict['mx_residual_pz'] = ROOT.TH2F( \ |
63 | 322 | tracker+'_mx_residual_pz', "m_{x} Residuals in p_{z}", \ | 322 | tracker+'_mx_residual_pz', "m_{x} Residuals in p_{z}", \ |
64 | 323 | 323 | ||
65 | === modified file 'bin/utilities/data_tracker_verify.py' | |||
66 | --- bin/utilities/data_tracker_verify.py 2016-05-24 16:01:44 +0000 | |||
67 | +++ bin/utilities/data_tracker_verify.py 2016-06-20 10:16:19 +0000 | |||
68 | @@ -173,15 +173,26 @@ | |||
69 | 173 | reco_plots['channels_cluster'] = ROOT.TH1F( 'channels_cluster', \ | 173 | reco_plots['channels_cluster'] = ROOT.TH1F( 'channels_cluster', \ |
70 | 174 | "Channels per Cluster", 50, 0.0, 50.0 ) | 174 | "Channels per Cluster", 50, 0.0, 50.0 ) |
71 | 175 | reco_plots['spacepoints_station'] = ROOT.TH1F( "spacepoints_station", \ | 175 | reco_plots['spacepoints_station'] = ROOT.TH1F( "spacepoints_station", \ |
73 | 176 | "Spacepoints Found in Each Station", 11, -5.0, 6.0 ) | 176 | "Spacepoints Found in Each Station", 11, -5.5, 5.5 ) |
74 | 177 | reco_plots['2_hit_spacepoints_station'] = ROOT.TH1F( \ | 177 | reco_plots['2_hit_spacepoints_station'] = ROOT.TH1F( \ |
75 | 178 | "2_hit_spacepoints_station", \ | 178 | "2_hit_spacepoints_station", \ |
77 | 179 | "Spacepoints Found in Each Station", 11, -5.0, 6.0 ) | 179 | "Spacepoints Found in Each Station", 11, -5.5, 5.5 ) |
78 | 180 | reco_plots['3_hit_spacepoints_station'] = ROOT.TH1F( \ | 180 | reco_plots['3_hit_spacepoints_station'] = ROOT.TH1F( \ |
79 | 181 | "3_hit_spacepoints_station", \ | 181 | "3_hit_spacepoints_station", \ |
81 | 182 | "Spacepoints Found in Each Station", 11, -5.0, 6.0 ) | 182 | "Spacepoints Found in Each Station", 11, -5.5, 5.5 ) |
82 | 183 | reco_plots['clusters_plane'] = ROOT.TH1F( "clusters_plane", \ | 183 | reco_plots['clusters_plane'] = ROOT.TH1F( "clusters_plane", \ |
84 | 184 | "Clusters Found in Each Plane", 31, -15.0, 16.0 ) | 184 | "Clusters Found in Each Plane", 31, -15.5, 15.5 ) |
85 | 185 | reco_plots['spacepoints_station_used'] = ROOT.TH1F( \ | ||
86 | 186 | "spacepoints_station_used", \ | ||
87 | 187 | "Spacepoints Found in Each Station", 11, -5.5, 5.5 ) | ||
88 | 188 | reco_plots['2_hit_spacepoints_station_used'] = ROOT.TH1F( \ | ||
89 | 189 | "2_hit_spacepoints_station_used", \ | ||
90 | 190 | "Spacepoints Found in Each Station", 11, -5.5, 5.5 ) | ||
91 | 191 | reco_plots['3_hit_spacepoints_station_used'] = ROOT.TH1F( \ | ||
92 | 192 | "3_hit_spacepoints_station_used", \ | ||
93 | 193 | "Spacepoints Found in Each Station", 11, -5.5, 5.5 ) | ||
94 | 194 | reco_plots['clusters_plane_used'] = ROOT.TH1F( "clusters_plane_used", \ | ||
95 | 195 | "Clusters Found in Each Plane", 31, -15.5, 15.5 ) | ||
96 | 185 | reco_plots['spacepoints'] = ROOT.TH2F( 'spacepoints', \ | 196 | reco_plots['spacepoints'] = ROOT.TH2F( 'spacepoints', \ |
97 | 186 | "Spacepoint Positions", 200, -200.0, 200.0, 200, -200.0, 200.0 ) | 197 | "Spacepoint Positions", 200, -200.0, 200.0, 200, -200.0, 200.0 ) |
98 | 187 | reco_plots['saturations_event'] = ROOT.TH1F( 'saturations_event', \ | 198 | reco_plots['saturations_event'] = ROOT.TH1F( 'saturations_event', \ |
99 | @@ -268,6 +279,9 @@ | |||
100 | 268 | 200, -200.0, 200.0, 200, -200.0, 200.0 ) | 279 | 200, -200.0, 200.0, 200, -200.0, 200.0 ) |
101 | 269 | station_plots[dir_name]['kuno_plot'] = ROOT.TH1F( dir_name+'_kuno', \ | 280 | station_plots[dir_name]['kuno_plot'] = ROOT.TH1F( dir_name+'_kuno', \ |
102 | 270 | "Kuno Plot: "+dir_name, 1001, -0.25, 500.25 ) | 281 | "Kuno Plot: "+dir_name, 1001, -0.25, 500.25 ) |
103 | 282 | station_plots[dir_name]['kuno_plot_used'] = ROOT.TH1F( \ | ||
104 | 283 | dir_name+'_kuno_used', \ | ||
105 | 284 | "Kuno Plot: "+dir_name, 1001, -0.25, 500.25 ) | ||
106 | 271 | 285 | ||
107 | 272 | 286 | ||
108 | 273 | plane_plots = {} | 287 | plane_plots = {} |
109 | @@ -290,6 +304,8 @@ | |||
110 | 290 | 304 | ||
111 | 291 | plane_plots[dir_name]['channels_cluster'] = ROOT.TH1F( \ | 305 | plane_plots[dir_name]['channels_cluster'] = ROOT.TH1F( \ |
112 | 292 | dir_name+'_channels_cluster', "Channels per Cluster", 50, 0.0, 50.0 ) | 306 | dir_name+'_channels_cluster', "Channels per Cluster", 50, 0.0, 50.0 ) |
113 | 307 | plane_plots[dir_name]['channels_cluster_used'] = ROOT.TH1F( \ | ||
114 | 308 | dir_name+'_channels_cluster_used', "Channels per Cluster", 50, 0.0, 50.0 ) | ||
115 | 293 | plane_plots[dir_name]['npe_cluster'] = ROOT.TH1F( \ | 309 | plane_plots[dir_name]['npe_cluster'] = ROOT.TH1F( \ |
116 | 294 | dir_name+'_npe_cluster', "NPE per Cluster", 75, 0.0, 75.0 ) | 310 | dir_name+'_npe_cluster', "NPE per Cluster", 75, 0.0, 75.0 ) |
117 | 295 | 311 | ||
118 | @@ -386,6 +402,7 @@ | |||
119 | 386 | Examine a SciFi Event to see if it should be vetoed | 402 | Examine a SciFi Event to see if it should be vetoed |
120 | 387 | """ | 403 | """ |
121 | 388 | digits = event.digits() | 404 | digits = event.digits() |
122 | 405 | tracks = event.scifitracks() | ||
123 | 389 | saturation_counter = 0 | 406 | saturation_counter = 0 |
124 | 390 | 407 | ||
125 | 391 | for digit in digits : | 408 | for digit in digits : |
126 | @@ -394,8 +411,33 @@ | |||
127 | 394 | 411 | ||
128 | 395 | if saturation_counter > 1000 : | 412 | if saturation_counter > 1000 : |
129 | 396 | return True | 413 | return True |
132 | 397 | else : | 414 | |
133 | 398 | return False | 415 | upstream_tracks = 0 |
134 | 416 | downstream_tracks = 0 | ||
135 | 417 | for track in tracks : | ||
136 | 418 | if track.P_value() < P_VALUE_CUT : | ||
137 | 419 | return True | ||
138 | 420 | |||
139 | 421 | if track.tracker() == 0 : | ||
140 | 422 | upstream_tracks += 1 | ||
141 | 423 | else : | ||
142 | 424 | downstream_tracks += 1 | ||
143 | 425 | |||
144 | 426 | trackpoints = track.scifitrackpoints() | ||
145 | 427 | count_trackpoints = 0 | ||
146 | 428 | for tp in trackpoints : | ||
147 | 429 | if tp.has_data() : | ||
148 | 430 | count_trackpoints += 1 | ||
149 | 431 | elif tools.calculate_plane_id( tp.tracker(), tp.station(), tp.plane()) \ | ||
150 | 432 | in IGNORE_PLANES : | ||
151 | 433 | count_trackpoints += 1 | ||
152 | 434 | if count_trackpoints < MIN_NUM_TRACKPOINTS : | ||
153 | 435 | return True | ||
154 | 436 | |||
155 | 437 | if (upstream_tracks != 1) or (downstream_tracks != 1) : | ||
156 | 438 | return True | ||
157 | 439 | |||
158 | 440 | return False | ||
159 | 399 | 441 | ||
160 | 400 | 442 | ||
161 | 401 | def fill_plots_data(plot_dict, data_dict, event) : | 443 | def fill_plots_data(plot_dict, data_dict, event) : |
162 | @@ -468,11 +510,15 @@ | |||
163 | 468 | plot_dict['recon_plots']['saturations_event'].Fill( saturation_counter ) | 510 | plot_dict['recon_plots']['saturations_event'].Fill( saturation_counter ) |
164 | 469 | 511 | ||
165 | 470 | kuno_sums = {} | 512 | kuno_sums = {} |
166 | 513 | kuno_sums_used = {} | ||
167 | 471 | for tracker in [ 0, 1 ] : | 514 | for tracker in [ 0, 1 ] : |
168 | 472 | kuno_sums_stations = {} | 515 | kuno_sums_stations = {} |
169 | 516 | kuno_sums_stations_used = {} | ||
170 | 473 | for station in [ 1, 2, 3, 4, 5 ] : | 517 | for station in [ 1, 2, 3, 4, 5 ] : |
171 | 474 | kuno_sums_stations[ station ] = 0.0 | 518 | kuno_sums_stations[ station ] = 0.0 |
172 | 519 | kuno_sums_stations_used[ station ] = 0.0 | ||
173 | 475 | kuno_sums[tracker] = kuno_sums_stations | 520 | kuno_sums[tracker] = kuno_sums_stations |
174 | 521 | kuno_sums_used[tracker] = kuno_sums_stations_used | ||
175 | 476 | 522 | ||
176 | 477 | for cluster in clusters : | 523 | for cluster in clusters : |
177 | 478 | tracker = cluster.get_tracker() | 524 | tracker = cluster.get_tracker() |
178 | @@ -488,6 +534,10 @@ | |||
179 | 488 | ( -1.0 if tracker == 0 else 1.0 ) | 534 | ( -1.0 if tracker == 0 else 1.0 ) |
180 | 489 | clus_digits = cluster.get_digits_pointers() | 535 | clus_digits = cluster.get_digits_pointers() |
181 | 490 | reco_plots['clusters_plane'].Fill(plane_id) | 536 | reco_plots['clusters_plane'].Fill(plane_id) |
182 | 537 | if cluster.is_used() : | ||
183 | 538 | kuno_sums_used[tracker][station] += cluster.get_channel() | ||
184 | 539 | reco_plots['clusters_plane_used'].Fill(plane_id) | ||
185 | 540 | plane_plots[dir_name]['channels_cluster_used'].Fill( len(clus_digits) ) | ||
186 | 491 | reco_plots['channels_cluster'].Fill( len(clus_digits) ) | 541 | reco_plots['channels_cluster'].Fill( len(clus_digits) ) |
187 | 492 | plane_plots[dir_name]['channels_cluster'].Fill( len(clus_digits) ) | 542 | plane_plots[dir_name]['channels_cluster'].Fill( len(clus_digits) ) |
188 | 493 | 543 | ||
189 | @@ -513,6 +563,8 @@ | |||
190 | 513 | for station in [ 1, 2, 3, 4, 5 ] : | 563 | for station in [ 1, 2, 3, 4, 5 ] : |
191 | 514 | dir_name = str(tracker)+'.'+str(station) | 564 | dir_name = str(tracker)+'.'+str(station) |
192 | 515 | station_plots[dir_name]['kuno_plot'].Fill( kuno_sums[tracker][station] ) | 565 | station_plots[dir_name]['kuno_plot'].Fill( kuno_sums[tracker][station] ) |
193 | 566 | station_plots[dir_name]['kuno_plot_used'].Fill( \ | ||
194 | 567 | kuno_sums_used[tracker][station] ) | ||
195 | 516 | 568 | ||
196 | 517 | for spacepoint in spacepoints : | 569 | for spacepoint in spacepoints : |
197 | 518 | tracker = spacepoint.get_tracker() | 570 | tracker = spacepoint.get_tracker() |
198 | @@ -520,6 +572,8 @@ | |||
199 | 520 | 572 | ||
200 | 521 | station_id = station * ( -1.0 if tracker == 0 else 1.0 ) | 573 | station_id = station * ( -1.0 if tracker == 0 else 1.0 ) |
201 | 522 | reco_plots['spacepoints_station'].Fill(station_id) | 574 | reco_plots['spacepoints_station'].Fill(station_id) |
202 | 575 | if spacepoint.is_used() : | ||
203 | 576 | reco_plots['spacepoints_station_used'].Fill(station_id) | ||
204 | 523 | reco_plots['spacepoints'].Fill( spacepoint.get_position().x(), \ | 577 | reco_plots['spacepoints'].Fill( spacepoint.get_position().x(), \ |
205 | 524 | spacepoint.get_position().y() ) | 578 | spacepoint.get_position().y() ) |
206 | 525 | 579 | ||
207 | @@ -541,6 +595,13 @@ | |||
208 | 541 | raise ValueError( "Unknown Number of spacepoints: " + \ | 595 | raise ValueError( "Unknown Number of spacepoints: " + \ |
209 | 542 | str( sp_clusters ) ) | 596 | str( sp_clusters ) ) |
210 | 543 | 597 | ||
211 | 598 | if spacepoint.is_used() : | ||
212 | 599 | if len( sp_clusters ) == 2 : | ||
213 | 600 | reco_plots['2_hit_spacepoints_station_used'].Fill( station_id ) | ||
214 | 601 | elif len( sp_clusters ) == 3 : | ||
215 | 602 | reco_plots['3_hit_spacepoints_station_used'].Fill( station_id ) | ||
216 | 603 | |||
217 | 604 | |||
218 | 544 | npe = 0.0 | 605 | npe = 0.0 |
219 | 545 | for cluster in sp_clusters : | 606 | for cluster in sp_clusters : |
220 | 546 | clus_digits = cluster.get_digits_pointers() | 607 | clus_digits = cluster.get_digits_pointers() |
221 | @@ -967,11 +1028,11 @@ | |||
222 | 967 | ##### 3. Fill plots ########################################################### | 1028 | ##### 3. Fill plots ########################################################### |
223 | 968 | if namespace.cut_tof and cut_tof_event( plot_dict, tof_event ) : | 1029 | if namespace.cut_tof and cut_tof_event( plot_dict, tof_event ) : |
224 | 969 | continue | 1030 | continue |
226 | 970 | if namespace.cut_scifi and \ | 1031 | elif namespace.cut_scifi and \ |
227 | 971 | cut_scifi_event( plot_dict, scifi_event ) : | 1032 | cut_scifi_event( plot_dict, scifi_event ) : |
228 | 972 | continue | 1033 | continue |
231 | 973 | 1034 | else : | |
232 | 974 | fill_plots_data(plot_dict, data_dict, scifi_event) | 1035 | fill_plots_data(plot_dict, data_dict, scifi_event) |
233 | 975 | 1036 | ||
234 | 976 | except ValueError as ex : | 1037 | except ValueError as ex : |
235 | 977 | print "An Error Occured: " + str( ex ) | 1038 | print "An Error Occured: " + str( ex ) |
236 | 978 | 1039 | ||
237 | === modified file 'src/common_cpp/Recon/SciFi/SciFiGeometryHelper.cc' | |||
238 | --- src/common_cpp/Recon/SciFi/SciFiGeometryHelper.cc 2016-06-10 11:57:21 +0000 | |||
239 | +++ src/common_cpp/Recon/SciFi/SciFiGeometryHelper.cc 2016-06-20 10:16:19 +0000 | |||
240 | @@ -135,7 +135,11 @@ | |||
241 | 135 | 135 | ||
242 | 136 | SciFiTrackerGeometry trackerGeo = _geometry_map[tracker_n]; | 136 | SciFiTrackerGeometry trackerGeo = _geometry_map[tracker_n]; |
243 | 137 | trackerGeo.Position = referencePos; | 137 | trackerGeo.Position = referencePos; |
245 | 138 | trackerGeo.Rotation = trackerModule->globalRotation(); | 138 | if (UseActiveRotations == true) { |
246 | 139 | trackerGeo.Rotation = trackerModule->globalRotation(); | ||
247 | 140 | } else { | ||
248 | 141 | trackerGeo.Rotation = trackerModule->globalRotation().inverse(); | ||
249 | 142 | } | ||
250 | 139 | FieldValue(trackerModule, trackerGeo); | 143 | FieldValue(trackerModule, trackerGeo); |
251 | 140 | trackerGeo.Planes[plane_id] = this_plane; | 144 | trackerGeo.Planes[plane_id] = this_plane; |
252 | 141 | 145 | ||
253 | 142 | 146 | ||
254 | === modified file 'src/common_py/analysis/inspectors.py' | |||
255 | --- src/common_py/analysis/inspectors.py 2016-05-06 17:17:13 +0000 | |||
256 | +++ src/common_py/analysis/inspectors.py 2016-06-20 10:16:19 +0000 | |||
257 | @@ -106,7 +106,9 @@ | |||
258 | 106 | def add_hit(self, hit) : | 106 | def add_hit(self, hit) : |
259 | 107 | if self.momentum_bias is not None : | 107 | if self.momentum_bias is not None : |
260 | 108 | p = hit.get_p() | 108 | p = hit.get_p() |
262 | 109 | correction = 1.0 + (self.momentum_bias + self.momentum_correlation*p) / p | 109 | # correction = 1.0 + (self.momentum_bias + self.momentum_correlation*p) / p |
263 | 110 | correction = ((p - self.momentum_bias) / \ | ||
264 | 111 | (1.0 - self.momentum_correlation)) / p | ||
265 | 110 | hit.set_px(hit.get_px()*correction) | 112 | hit.set_px(hit.get_px()*correction) |
266 | 111 | hit.set_py(hit.get_py()*correction) | 113 | hit.set_py(hit.get_py()*correction) |
267 | 112 | hit.set_pz(hit.get_pz()*correction) | 114 | hit.set_pz(hit.get_pz()*correction) |
268 | 113 | 115 | ||
269 | === modified file 'src/common_py/analysis/tools.py' | |||
270 | --- src/common_py/analysis/tools.py 2016-05-11 13:10:28 +0000 | |||
271 | +++ src/common_py/analysis/tools.py 2016-06-20 10:16:19 +0000 | |||
272 | @@ -102,23 +102,22 @@ | |||
273 | 102 | projection = hist.ProjectionY( \ | 102 | projection = hist.ProjectionY( \ |
274 | 103 | name+'_pro_'+str(i), i, i ) | 103 | name+'_pro_'+str(i), i, i ) |
275 | 104 | if projection.GetEntries() == 0 : | 104 | if projection.GetEntries() == 0 : |
280 | 105 | x_pos.append( 0.0 ) | 105 | continue |
277 | 106 | y_pos.append( 0.0 ) | ||
278 | 107 | x_error.append( 0.0 ) | ||
279 | 108 | y_error.append( 0.0 ) | ||
281 | 109 | 106 | ||
282 | 110 | pro_mean, pro_mean_err, pro_std, pro_std_err = \ | 107 | pro_mean, pro_mean_err, pro_std, pro_std_err = \ |
283 | 111 | fit_gaussian( projection, fit_min, fit_max ) | 108 | fit_gaussian( projection, fit_min, fit_max ) |
284 | 112 | 109 | ||
285 | 113 | x_pos.append( hist.GetXaxis().GetBinCenter( i ) ) | 110 | x_pos.append( hist.GetXaxis().GetBinCenter( i ) ) |
286 | 114 | y_pos.append( pro_mean ) | 111 | y_pos.append( pro_mean ) |
288 | 115 | x_error.append( hist.GetXaxis().GetBinWidth( i ) ) | 112 | x_error.append( 0.5*hist.GetXaxis().GetBinWidth( i ) ) |
289 | 116 | y_error.append( pro_mean_err ) | 113 | y_error.append( pro_mean_err ) |
290 | 117 | 114 | ||
295 | 118 | profile = ROOT.TGraphErrors( len( x_pos ), x_pos, y_pos, x_error, y_error ) | 115 | if len( x_pos ) < 1 : |
296 | 119 | profile.SetName( name+'_profile' ) | 116 | return None |
297 | 120 | 117 | else : | |
298 | 121 | return profile | 118 | profile = ROOT.TGraphErrors( len( x_pos ), x_pos, y_pos, x_error, y_error ) |
299 | 119 | profile.SetName( name+'_profile' ) | ||
300 | 120 | return profile | ||
301 | 122 | 121 | ||
302 | 123 | 122 | ||
303 | 124 | def gaussian_profile_y(hist, fit_min=0, fit_max=0) : | 123 | def gaussian_profile_y(hist, fit_min=0, fit_max=0) : |
304 | @@ -137,10 +136,7 @@ | |||
305 | 137 | projection = hist.ProjectionX( \ | 136 | projection = hist.ProjectionX( \ |
306 | 138 | name+'_pro_'+str(i), i, i ) | 137 | name+'_pro_'+str(i), i, i ) |
307 | 139 | if projection.GetEntries() == 0 : | 138 | if projection.GetEntries() == 0 : |
312 | 140 | x_pos.append( 0.0 ) | 139 | continue |
309 | 141 | y_pos.append( 0.0 ) | ||
310 | 142 | x_error.append( 0.0 ) | ||
311 | 143 | y_error.append( 0.0 ) | ||
313 | 144 | 140 | ||
314 | 145 | pro_mean, pro_mean_err, pro_std, pro_std_err = \ | 141 | pro_mean, pro_mean_err, pro_std, pro_std_err = \ |
315 | 146 | fit_gaussian( projection, fit_min, fit_max ) | 142 | fit_gaussian( projection, fit_min, fit_max ) |
316 | @@ -148,12 +144,14 @@ | |||
317 | 148 | x_pos.append( pro_mean ) | 144 | x_pos.append( pro_mean ) |
318 | 149 | y_pos.append( hist.GetYaxis().GetBinCenter( i ) ) | 145 | y_pos.append( hist.GetYaxis().GetBinCenter( i ) ) |
319 | 150 | x_error.append( pro_mean_err ) | 146 | x_error.append( pro_mean_err ) |
326 | 151 | y_error.append( hist.GetYaxis().GetBinWidth( i ) ) | 147 | y_error.append( 0.5*hist.GetYaxis().GetBinWidth( i ) ) |
327 | 152 | 148 | ||
328 | 153 | profile = ROOT.TGraphErrors( len( x_pos ), x_pos, y_pos, x_error, y_error ) | 149 | if len( x_pos ) < 1 : |
329 | 154 | profile.SetName( name+'_profile' ) | 150 | return None |
330 | 155 | 151 | else : | |
331 | 156 | return profile | 152 | profile = ROOT.TGraphErrors( len( x_pos ), x_pos, y_pos, x_error, y_error ) |
332 | 153 | profile.SetName( name+'_profile' ) | ||
333 | 154 | return profile | ||
334 | 157 | 155 | ||
335 | 158 | 156 | ||
336 | 159 | def sort_arrays(array_lists, key_list=0, descending=True) : | 157 | def sort_arrays(array_lists, key_list=0, descending=True) : |
337 | 160 | 158 | ||
338 | === modified file 'src/map/MapCppTrackerVirtualsDigitization/MapCppTrackerVirtualsDigitization.cc' | |||
339 | --- src/map/MapCppTrackerVirtualsDigitization/MapCppTrackerVirtualsDigitization.cc 2016-03-08 12:45:28 +0000 | |||
340 | +++ src/map/MapCppTrackerVirtualsDigitization/MapCppTrackerVirtualsDigitization.cc 2016-06-20 10:16:19 +0000 | |||
341 | @@ -443,12 +443,15 @@ | |||
342 | 443 | 443 | ||
343 | 444 | ThreeVector vec = geometry.Direction.Orthogonal().Unit(); | 444 | ThreeVector vec = geometry.Direction.Orthogonal().Unit(); |
344 | 445 | double alpha = position.Dot(vec); | 445 | double alpha = position.Dot(vec); |
347 | 446 | int channelNumber = floor(0.5 + ((7.0 * geometry.CentralFibre) - | 446 | double channelNumber = 0.5 + ((7.0 * geometry.CentralFibre) - |
348 | 447 | (2.0 * alpha / geometry.Pitch)) / 7.0); | 447 | (2.0 * alpha / geometry.Pitch)) / 7.0; |
349 | 448 | |||
350 | 449 | channelNumber = floor(channelNumber*2.0) / 2.0; // Force half integer binning | ||
351 | 448 | 450 | ||
352 | 449 | double new_alpha; | 451 | double new_alpha; |
353 | 450 | if (_smear_value < 0.0) { | 452 | if (_smear_value < 0.0) { |
355 | 451 | new_alpha = 3.5 * geometry.Pitch * static_cast<double>(geometry.CentralFibre - channelNumber); | 453 | new_alpha = 3.5 * geometry.Pitch * |
356 | 454 | (static_cast<double>(geometry.CentralFibre) - channelNumber); | ||
357 | 452 | } else { | 455 | } else { |
358 | 453 | double smear_amount = CLHEP::RandGauss::shoot(0.0, _smear_value); | 456 | double smear_amount = CLHEP::RandGauss::shoot(0.0, _smear_value); |
359 | 454 | new_alpha = alpha + smear_amount; | 457 | new_alpha = alpha + smear_amount; |