Merge lp:~christopher-hunt08/maus/maus_scifi_updates into lp:maus/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
Reviewer Review Type Date Requested Status
MAUS Maintainers Pending
Review via email: mp+297830@code.launchpad.net

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
=== modified file 'bin/user/scifi/tracker_resolution_plots.py'
--- bin/user/scifi/tracker_resolution_plots.py 2016-05-24 16:01:44 +0000
+++ bin/user/scifi/tracker_resolution_plots.py 2016-06-20 10:16:19 +0000
@@ -179,7 +179,7 @@
179179
180180
181 tracker_dict['residual_xy'] = ROOT.TH2F( tracker+'_residual_xy', \181 tracker_dict['residual_xy'] = ROOT.TH2F( tracker+'_residual_xy', \
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 )
183183
184 tracker_dict['residual_mxmy'] = ROOT.TH2F( tracker+'_residual_mxmy', \184 tracker_dict['residual_mxmy'] = ROOT.TH2F( tracker+'_residual_mxmy', \
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 )
@@ -252,13 +252,13 @@
252252
253 tracker_dict['x_residual_p'] = ROOT.TH2F( \253 tracker_dict['x_residual_p'] = ROOT.TH2F( \
254 tracker+'_x_residual_p', "X Residuals in p", \254 tracker+'_x_residual_p', "X Residuals in p", \
255 PZ_BIN, PZ_MIN, PZ_MAX, 500, -50.0, 50.0 )255 PZ_BIN, PZ_MIN, PZ_MAX, 500, -20.0, 20.0 )
256 tracker_dict['y_residual_p'] = ROOT.TH2F( \256 tracker_dict['y_residual_p'] = ROOT.TH2F( \
257 tracker+'_y_residual_p', "Y Residuals in p", \257 tracker+'_y_residual_p', "Y Residuals in p", \
258 PZ_BIN, PZ_MIN, PZ_MAX, 500, -50.0, 50.0 )258 PZ_BIN, PZ_MIN, PZ_MAX, 500, -20.0, 20.0 )
259 tracker_dict['r_residual_p'] = ROOT.TH2F( \259 tracker_dict['r_residual_p'] = ROOT.TH2F( \
260 tracker+'_r_residual_p', "Radius Residuals in p", \260 tracker+'_r_residual_p', "Radius Residuals in p", \
261 PZ_BIN, PZ_MIN, PZ_MAX, 500, -50.0, 50.0 )261 PZ_BIN, PZ_MIN, PZ_MAX, 500, 0.0, 50.0 )
262262
263 tracker_dict['px_residual_p'] = ROOT.TH2F( \263 tracker_dict['px_residual_p'] = ROOT.TH2F( \
264 tracker+'_px_residual_p', "p_{x} Residuals in p", \264 tracker+'_px_residual_p', "p_{x} Residuals in p", \
@@ -281,13 +281,13 @@
281281
282 tracker_dict['x_residual_pt'] = ROOT.TH2F( \282 tracker_dict['x_residual_pt'] = ROOT.TH2F( \
283 tracker+'_x_residual_pt', "X Residuals in p_{t}", \283 tracker+'_x_residual_pt', "X Residuals in p_{t}", \
284 PT_BIN, PT_MIN, PT_MAX, 500, -50.0, 50.0 )284 PT_BIN, PT_MIN, PT_MAX, 500, -20.0, 20.0 )
285 tracker_dict['y_residual_pt'] = ROOT.TH2F( \285 tracker_dict['y_residual_pt'] = ROOT.TH2F( \
286 tracker+'_y_residual_pt', "Y Residuals in p_{t}", \286 tracker+'_y_residual_pt', "Y Residuals in p_{t}", \
287 PT_BIN, PT_MIN, PT_MAX, 500, -50.0, 50.0 )287 PT_BIN, PT_MIN, PT_MAX, 500, -20.0, 20.0 )
288 tracker_dict['r_residual_pt'] = ROOT.TH2F( \288 tracker_dict['r_residual_pt'] = ROOT.TH2F( \
289 tracker+'_r_residual_pt', "Radius Residuals in p_{t}", \289 tracker+'_r_residual_pt', "Radius Residuals in p_{t}", \
290 PT_BIN, PT_MIN, PT_MAX, 500, -50.0, 50.0 )290 PT_BIN, PT_MIN, PT_MAX, 500, 0.0, 50.0 )
291291
292 tracker_dict['px_residual_pt'] = ROOT.TH2F( \292 tracker_dict['px_residual_pt'] = ROOT.TH2F( \
293 tracker+'_px_residual_pt', "p_{x} Residuals in p_{t}", \293 tracker+'_px_residual_pt', "p_{x} Residuals in p_{t}", \
@@ -310,13 +310,13 @@
310310
311 tracker_dict['x_residual_pz'] = ROOT.TH2F( \311 tracker_dict['x_residual_pz'] = ROOT.TH2F( \
312 tracker+'_x_residual_pz', "X Residuals in p_{z}", \312 tracker+'_x_residual_pz', "X Residuals in p_{z}", \
313 PZ_BIN, PZ_MIN, PZ_MAX, 500, -50.0, 50.0 )313 PZ_BIN, PZ_MIN, PZ_MAX, 500, -20.0, 20.0 )
314 tracker_dict['y_residual_pz'] = ROOT.TH2F( \314 tracker_dict['y_residual_pz'] = ROOT.TH2F( \
315 tracker+'_y_residual_pz', "Y Residuals in p_{z}", \315 tracker+'_y_residual_pz', "Y Residuals in p_{z}", \
316 PZ_BIN, PZ_MIN, PZ_MAX, 500, -50.0, 50.0 )316 PZ_BIN, PZ_MIN, PZ_MAX, 500, -20.0, 20.0 )
317 tracker_dict['r_residual_pz'] = ROOT.TH2F( \317 tracker_dict['r_residual_pz'] = ROOT.TH2F( \
318 tracker+'_r_residual_pz', "Radius Residuals in p_{z}", \318 tracker+'_r_residual_pz', "Radius Residuals in p_{z}", \
319 PZ_BIN, PZ_MIN, PZ_MAX, 500, -50.0, 50.0 )319 PZ_BIN, PZ_MIN, PZ_MAX, 500, 0.0, 50.0 )
320320
321 tracker_dict['mx_residual_pz'] = ROOT.TH2F( \321 tracker_dict['mx_residual_pz'] = ROOT.TH2F( \
322 tracker+'_mx_residual_pz', "m_{x} Residuals in p_{z}", \322 tracker+'_mx_residual_pz', "m_{x} Residuals in p_{z}", \
323323
=== modified file 'bin/utilities/data_tracker_verify.py'
--- bin/utilities/data_tracker_verify.py 2016-05-24 16:01:44 +0000
+++ bin/utilities/data_tracker_verify.py 2016-06-20 10:16:19 +0000
@@ -173,15 +173,26 @@
173 reco_plots['channels_cluster'] = ROOT.TH1F( 'channels_cluster', \173 reco_plots['channels_cluster'] = ROOT.TH1F( 'channels_cluster', \
174 "Channels per Cluster", 50, 0.0, 50.0 )174 "Channels per Cluster", 50, 0.0, 50.0 )
175 reco_plots['spacepoints_station'] = ROOT.TH1F( "spacepoints_station", \175 reco_plots['spacepoints_station'] = ROOT.TH1F( "spacepoints_station", \
176 "Spacepoints Found in Each Station", 11, -5.0, 6.0 )176 "Spacepoints Found in Each Station", 11, -5.5, 5.5 )
177 reco_plots['2_hit_spacepoints_station'] = ROOT.TH1F( \177 reco_plots['2_hit_spacepoints_station'] = ROOT.TH1F( \
178 "2_hit_spacepoints_station", \178 "2_hit_spacepoints_station", \
179 "Spacepoints Found in Each Station", 11, -5.0, 6.0 )179 "Spacepoints Found in Each Station", 11, -5.5, 5.5 )
180 reco_plots['3_hit_spacepoints_station'] = ROOT.TH1F( \180 reco_plots['3_hit_spacepoints_station'] = ROOT.TH1F( \
181 "3_hit_spacepoints_station", \181 "3_hit_spacepoints_station", \
182 "Spacepoints Found in Each Station", 11, -5.0, 6.0 )182 "Spacepoints Found in Each Station", 11, -5.5, 5.5 )
183 reco_plots['clusters_plane'] = ROOT.TH1F( "clusters_plane", \183 reco_plots['clusters_plane'] = ROOT.TH1F( "clusters_plane", \
184 "Clusters Found in Each Plane", 31, -15.0, 16.0 )184 "Clusters Found in Each Plane", 31, -15.5, 15.5 )
185 reco_plots['spacepoints_station_used'] = ROOT.TH1F( \
186 "spacepoints_station_used", \
187 "Spacepoints Found in Each Station", 11, -5.5, 5.5 )
188 reco_plots['2_hit_spacepoints_station_used'] = ROOT.TH1F( \
189 "2_hit_spacepoints_station_used", \
190 "Spacepoints Found in Each Station", 11, -5.5, 5.5 )
191 reco_plots['3_hit_spacepoints_station_used'] = ROOT.TH1F( \
192 "3_hit_spacepoints_station_used", \
193 "Spacepoints Found in Each Station", 11, -5.5, 5.5 )
194 reco_plots['clusters_plane_used'] = ROOT.TH1F( "clusters_plane_used", \
195 "Clusters Found in Each Plane", 31, -15.5, 15.5 )
185 reco_plots['spacepoints'] = ROOT.TH2F( 'spacepoints', \196 reco_plots['spacepoints'] = ROOT.TH2F( 'spacepoints', \
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 )
187 reco_plots['saturations_event'] = ROOT.TH1F( 'saturations_event', \198 reco_plots['saturations_event'] = ROOT.TH1F( 'saturations_event', \
@@ -268,6 +279,9 @@
268 200, -200.0, 200.0, 200, -200.0, 200.0 )279 200, -200.0, 200.0, 200, -200.0, 200.0 )
269 station_plots[dir_name]['kuno_plot'] = ROOT.TH1F( dir_name+'_kuno', \280 station_plots[dir_name]['kuno_plot'] = ROOT.TH1F( dir_name+'_kuno', \
270 "Kuno Plot: "+dir_name, 1001, -0.25, 500.25 )281 "Kuno Plot: "+dir_name, 1001, -0.25, 500.25 )
282 station_plots[dir_name]['kuno_plot_used'] = ROOT.TH1F( \
283 dir_name+'_kuno_used', \
284 "Kuno Plot: "+dir_name, 1001, -0.25, 500.25 )
271285
272286
273 plane_plots = {}287 plane_plots = {}
@@ -290,6 +304,8 @@
290304
291 plane_plots[dir_name]['channels_cluster'] = ROOT.TH1F( \305 plane_plots[dir_name]['channels_cluster'] = ROOT.TH1F( \
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 )
307 plane_plots[dir_name]['channels_cluster_used'] = ROOT.TH1F( \
308 dir_name+'_channels_cluster_used', "Channels per Cluster", 50, 0.0, 50.0 )
293 plane_plots[dir_name]['npe_cluster'] = ROOT.TH1F( \309 plane_plots[dir_name]['npe_cluster'] = ROOT.TH1F( \
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 )
295311
@@ -386,6 +402,7 @@
386 Examine a SciFi Event to see if it should be vetoed402 Examine a SciFi Event to see if it should be vetoed
387 """403 """
388 digits = event.digits()404 digits = event.digits()
405 tracks = event.scifitracks()
389 saturation_counter = 0406 saturation_counter = 0
390407
391 for digit in digits :408 for digit in digits :
@@ -394,8 +411,33 @@
394411
395 if saturation_counter > 1000 :412 if saturation_counter > 1000 :
396 return True413 return True
397 else :414
398 return False415 upstream_tracks = 0
416 downstream_tracks = 0
417 for track in tracks :
418 if track.P_value() < P_VALUE_CUT :
419 return True
420
421 if track.tracker() == 0 :
422 upstream_tracks += 1
423 else :
424 downstream_tracks += 1
425
426 trackpoints = track.scifitrackpoints()
427 count_trackpoints = 0
428 for tp in trackpoints :
429 if tp.has_data() :
430 count_trackpoints += 1
431 elif tools.calculate_plane_id( tp.tracker(), tp.station(), tp.plane()) \
432 in IGNORE_PLANES :
433 count_trackpoints += 1
434 if count_trackpoints < MIN_NUM_TRACKPOINTS :
435 return True
436
437 if (upstream_tracks != 1) or (downstream_tracks != 1) :
438 return True
439
440 return False
399441
400442
401def fill_plots_data(plot_dict, data_dict, event) :443def fill_plots_data(plot_dict, data_dict, event) :
@@ -468,11 +510,15 @@
468 plot_dict['recon_plots']['saturations_event'].Fill( saturation_counter )510 plot_dict['recon_plots']['saturations_event'].Fill( saturation_counter )
469511
470 kuno_sums = {}512 kuno_sums = {}
513 kuno_sums_used = {}
471 for tracker in [ 0, 1 ] :514 for tracker in [ 0, 1 ] :
472 kuno_sums_stations = {}515 kuno_sums_stations = {}
516 kuno_sums_stations_used = {}
473 for station in [ 1, 2, 3, 4, 5 ] :517 for station in [ 1, 2, 3, 4, 5 ] :
474 kuno_sums_stations[ station ] = 0.0518 kuno_sums_stations[ station ] = 0.0
519 kuno_sums_stations_used[ station ] = 0.0
475 kuno_sums[tracker] = kuno_sums_stations520 kuno_sums[tracker] = kuno_sums_stations
521 kuno_sums_used[tracker] = kuno_sums_stations_used
476522
477 for cluster in clusters :523 for cluster in clusters :
478 tracker = cluster.get_tracker()524 tracker = cluster.get_tracker()
@@ -488,6 +534,10 @@
488 ( -1.0 if tracker == 0 else 1.0 )534 ( -1.0 if tracker == 0 else 1.0 )
489 clus_digits = cluster.get_digits_pointers()535 clus_digits = cluster.get_digits_pointers()
490 reco_plots['clusters_plane'].Fill(plane_id)536 reco_plots['clusters_plane'].Fill(plane_id)
537 if cluster.is_used() :
538 kuno_sums_used[tracker][station] += cluster.get_channel()
539 reco_plots['clusters_plane_used'].Fill(plane_id)
540 plane_plots[dir_name]['channels_cluster_used'].Fill( len(clus_digits) )
491 reco_plots['channels_cluster'].Fill( len(clus_digits) )541 reco_plots['channels_cluster'].Fill( len(clus_digits) )
492 plane_plots[dir_name]['channels_cluster'].Fill( len(clus_digits) )542 plane_plots[dir_name]['channels_cluster'].Fill( len(clus_digits) )
493543
@@ -513,6 +563,8 @@
513 for station in [ 1, 2, 3, 4, 5 ] :563 for station in [ 1, 2, 3, 4, 5 ] :
514 dir_name = str(tracker)+'.'+str(station)564 dir_name = str(tracker)+'.'+str(station)
515 station_plots[dir_name]['kuno_plot'].Fill( kuno_sums[tracker][station] )565 station_plots[dir_name]['kuno_plot'].Fill( kuno_sums[tracker][station] )
566 station_plots[dir_name]['kuno_plot_used'].Fill( \
567 kuno_sums_used[tracker][station] )
516568
517 for spacepoint in spacepoints :569 for spacepoint in spacepoints :
518 tracker = spacepoint.get_tracker()570 tracker = spacepoint.get_tracker()
@@ -520,6 +572,8 @@
520572
521 station_id = station * ( -1.0 if tracker == 0 else 1.0 )573 station_id = station * ( -1.0 if tracker == 0 else 1.0 )
522 reco_plots['spacepoints_station'].Fill(station_id)574 reco_plots['spacepoints_station'].Fill(station_id)
575 if spacepoint.is_used() :
576 reco_plots['spacepoints_station_used'].Fill(station_id)
523 reco_plots['spacepoints'].Fill( spacepoint.get_position().x(), \577 reco_plots['spacepoints'].Fill( spacepoint.get_position().x(), \
524 spacepoint.get_position().y() )578 spacepoint.get_position().y() )
525579
@@ -541,6 +595,13 @@
541 raise ValueError( "Unknown Number of spacepoints: " + \595 raise ValueError( "Unknown Number of spacepoints: " + \
542 str( sp_clusters ) )596 str( sp_clusters ) )
543597
598 if spacepoint.is_used() :
599 if len( sp_clusters ) == 2 :
600 reco_plots['2_hit_spacepoints_station_used'].Fill( station_id )
601 elif len( sp_clusters ) == 3 :
602 reco_plots['3_hit_spacepoints_station_used'].Fill( station_id )
603
604
544 npe = 0.0605 npe = 0.0
545 for cluster in sp_clusters :606 for cluster in sp_clusters :
546 clus_digits = cluster.get_digits_pointers()607 clus_digits = cluster.get_digits_pointers()
@@ -967,11 +1028,11 @@
967##### 3. Fill plots ###########################################################1028##### 3. Fill plots ###########################################################
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 ) :
969 continue1030 continue
970 if namespace.cut_scifi and \1031 elif namespace.cut_scifi and \
971 cut_scifi_event( plot_dict, scifi_event ) :1032 cut_scifi_event( plot_dict, scifi_event ) :
972 continue1033 continue
9731034 else :
974 fill_plots_data(plot_dict, data_dict, scifi_event)1035 fill_plots_data(plot_dict, data_dict, scifi_event)
9751036
976 except ValueError as ex :1037 except ValueError as ex :
977 print "An Error Occured: " + str( ex )1038 print "An Error Occured: " + str( ex )
9781039
=== modified file 'src/common_cpp/Recon/SciFi/SciFiGeometryHelper.cc'
--- src/common_cpp/Recon/SciFi/SciFiGeometryHelper.cc 2016-06-10 11:57:21 +0000
+++ src/common_cpp/Recon/SciFi/SciFiGeometryHelper.cc 2016-06-20 10:16:19 +0000
@@ -135,7 +135,11 @@
135135
136 SciFiTrackerGeometry trackerGeo = _geometry_map[tracker_n];136 SciFiTrackerGeometry trackerGeo = _geometry_map[tracker_n];
137 trackerGeo.Position = referencePos;137 trackerGeo.Position = referencePos;
138 trackerGeo.Rotation = trackerModule->globalRotation();138 if (UseActiveRotations == true) {
139 trackerGeo.Rotation = trackerModule->globalRotation();
140 } else {
141 trackerGeo.Rotation = trackerModule->globalRotation().inverse();
142 }
139 FieldValue(trackerModule, trackerGeo);143 FieldValue(trackerModule, trackerGeo);
140 trackerGeo.Planes[plane_id] = this_plane;144 trackerGeo.Planes[plane_id] = this_plane;
141145
142146
=== modified file 'src/common_py/analysis/inspectors.py'
--- src/common_py/analysis/inspectors.py 2016-05-06 17:17:13 +0000
+++ src/common_py/analysis/inspectors.py 2016-06-20 10:16:19 +0000
@@ -106,7 +106,9 @@
106 def add_hit(self, hit) :106 def add_hit(self, hit) :
107 if self.momentum_bias is not None :107 if self.momentum_bias is not None :
108 p = hit.get_p()108 p = hit.get_p()
109 correction = 1.0 + (self.momentum_bias + self.momentum_correlation*p) / p109# correction = 1.0 + (self.momentum_bias + self.momentum_correlation*p) / p
110 correction = ((p - self.momentum_bias) / \
111 (1.0 - self.momentum_correlation)) / p
110 hit.set_px(hit.get_px()*correction)112 hit.set_px(hit.get_px()*correction)
111 hit.set_py(hit.get_py()*correction)113 hit.set_py(hit.get_py()*correction)
112 hit.set_pz(hit.get_pz()*correction)114 hit.set_pz(hit.get_pz()*correction)
113115
=== modified file 'src/common_py/analysis/tools.py'
--- src/common_py/analysis/tools.py 2016-05-11 13:10:28 +0000
+++ src/common_py/analysis/tools.py 2016-06-20 10:16:19 +0000
@@ -102,23 +102,22 @@
102 projection = hist.ProjectionY( \102 projection = hist.ProjectionY( \
103 name+'_pro_'+str(i), i, i )103 name+'_pro_'+str(i), i, i )
104 if projection.GetEntries() == 0 :104 if projection.GetEntries() == 0 :
105 x_pos.append( 0.0 )105 continue
106 y_pos.append( 0.0 )
107 x_error.append( 0.0 )
108 y_error.append( 0.0 )
109106
110 pro_mean, pro_mean_err, pro_std, pro_std_err = \107 pro_mean, pro_mean_err, pro_std, pro_std_err = \
111 fit_gaussian( projection, fit_min, fit_max )108 fit_gaussian( projection, fit_min, fit_max )
112109
113 x_pos.append( hist.GetXaxis().GetBinCenter( i ) )110 x_pos.append( hist.GetXaxis().GetBinCenter( i ) )
114 y_pos.append( pro_mean )111 y_pos.append( pro_mean )
115 x_error.append( hist.GetXaxis().GetBinWidth( i ) )112 x_error.append( 0.5*hist.GetXaxis().GetBinWidth( i ) )
116 y_error.append( pro_mean_err )113 y_error.append( pro_mean_err )
117114
118 profile = ROOT.TGraphErrors( len( x_pos ), x_pos, y_pos, x_error, y_error )115 if len( x_pos ) < 1 :
119 profile.SetName( name+'_profile' )116 return None
120117 else :
121 return profile118 profile = ROOT.TGraphErrors( len( x_pos ), x_pos, y_pos, x_error, y_error )
119 profile.SetName( name+'_profile' )
120 return profile
122121
123122
124def gaussian_profile_y(hist, fit_min=0, fit_max=0) :123def gaussian_profile_y(hist, fit_min=0, fit_max=0) :
@@ -137,10 +136,7 @@
137 projection = hist.ProjectionX( \136 projection = hist.ProjectionX( \
138 name+'_pro_'+str(i), i, i )137 name+'_pro_'+str(i), i, i )
139 if projection.GetEntries() == 0 :138 if projection.GetEntries() == 0 :
140 x_pos.append( 0.0 )139 continue
141 y_pos.append( 0.0 )
142 x_error.append( 0.0 )
143 y_error.append( 0.0 )
144140
145 pro_mean, pro_mean_err, pro_std, pro_std_err = \141 pro_mean, pro_mean_err, pro_std, pro_std_err = \
146 fit_gaussian( projection, fit_min, fit_max )142 fit_gaussian( projection, fit_min, fit_max )
@@ -148,12 +144,14 @@
148 x_pos.append( pro_mean )144 x_pos.append( pro_mean )
149 y_pos.append( hist.GetYaxis().GetBinCenter( i ) )145 y_pos.append( hist.GetYaxis().GetBinCenter( i ) )
150 x_error.append( pro_mean_err )146 x_error.append( pro_mean_err )
151 y_error.append( hist.GetYaxis().GetBinWidth( i ) )147 y_error.append( 0.5*hist.GetYaxis().GetBinWidth( i ) )
152148
153 profile = ROOT.TGraphErrors( len( x_pos ), x_pos, y_pos, x_error, y_error )149 if len( x_pos ) < 1 :
154 profile.SetName( name+'_profile' )150 return None
155151 else :
156 return profile152 profile = ROOT.TGraphErrors( len( x_pos ), x_pos, y_pos, x_error, y_error )
153 profile.SetName( name+'_profile' )
154 return profile
157155
158156
159def sort_arrays(array_lists, key_list=0, descending=True) :157def sort_arrays(array_lists, key_list=0, descending=True) :
160158
=== modified file 'src/map/MapCppTrackerVirtualsDigitization/MapCppTrackerVirtualsDigitization.cc'
--- src/map/MapCppTrackerVirtualsDigitization/MapCppTrackerVirtualsDigitization.cc 2016-03-08 12:45:28 +0000
+++ src/map/MapCppTrackerVirtualsDigitization/MapCppTrackerVirtualsDigitization.cc 2016-06-20 10:16:19 +0000
@@ -443,12 +443,15 @@
443443
444 ThreeVector vec = geometry.Direction.Orthogonal().Unit();444 ThreeVector vec = geometry.Direction.Orthogonal().Unit();
445 double alpha = position.Dot(vec);445 double alpha = position.Dot(vec);
446 int channelNumber = floor(0.5 + ((7.0 * geometry.CentralFibre) -446 double channelNumber = 0.5 + ((7.0 * geometry.CentralFibre) -
447 (2.0 * alpha / geometry.Pitch)) / 7.0);447 (2.0 * alpha / geometry.Pitch)) / 7.0;
448
449 channelNumber = floor(channelNumber*2.0) / 2.0; // Force half integer binning
448450
449 double new_alpha;451 double new_alpha;
450 if (_smear_value < 0.0) {452 if (_smear_value < 0.0) {
451 new_alpha = 3.5 * geometry.Pitch * static_cast<double>(geometry.CentralFibre - channelNumber);453 new_alpha = 3.5 * geometry.Pitch *
454 (static_cast<double>(geometry.CentralFibre) - channelNumber);
452 } else {455 } else {
453 double smear_amount = CLHEP::RandGauss::shoot(0.0, _smear_value);456 double smear_amount = CLHEP::RandGauss::shoot(0.0, _smear_value);
454 new_alpha = alpha + smear_amount;457 new_alpha = alpha + smear_amount;

Subscribers

People subscribed via source and target branches