@@ -87,14 +87,14 @@ namespace mu2e {
87
87
void All01::beginJob (){
88
88
art::ServiceHandle<art::TFileService> tfs;
89
89
_hNTracks = tfs->make <TH1F>(" hNTracks" , " Number of tracks per event." , 10 , 0 ., 10 . );
90
- _hnDOF = tfs->make <TH1F>(" hnDOF" , " Number of degrees of freedom in fit." , 100 , 0 ., 100 . );
90
+ _hnDOF = tfs->make <TH1F>(" hnDOF" , " Number of degrees of freedom in fit." , 200 , 0 ., 200 . );
91
91
_hHasCalo = tfs->make <TH1F>(" hHasCalo" , " Number of calorimeter hits." , 2 , 0 ., 2 . );
92
92
_ht0 = tfs->make <TH1F>(" ht0" , " Track time at mid-point of Tracker ;(ns)" , 100 , 0 ., 2000 . );
93
93
_hp = tfs->make <TH1F>(" hp" , " Track momentum at mid-point of tracker;( MeV/c)" , 100 , 70 ., 120 . );
94
94
_hpErr = tfs->make <TH1F>(" hpErr" , " Error on track momentum at mid-point of tracker;( MeV/c)" , 100 , 0 ., 2 . );
95
95
_hnSkip = tfs->make <TH1F>(" hnSkip" , " Cut tree for skipped tracks;( MeV/c)" , 3 , 0 ., 3 . );
96
96
_heOverP = tfs->make <TH1F>(" heOverP" , " E/p for tracks with a matched Calo Cluster" , 150 , 0 ., 1.5 );
97
- _hnCrvCC = tfs->make <TH1F>(" hnCrvCC" , " Number of CRV Coincidence clusters" , 10 , 0 ., 10 . );
97
+ _hnCrvCC = tfs->make <TH1F>(" hnCrvCC" , " Number of CRV Coincidence clusters" , 20 , 0 ., 20 . );
98
98
_hdTCrv = tfs->make <TH1F>(" hdTnCrv" , " delta(T) track-CRV Coincidence cluster;(ns)" , 200 , -2000 ., 2000 . );
99
99
100
100
// Time, Momentum, Error on Momentum at Front, Mid and Back planes of the tracker
@@ -123,17 +123,24 @@ namespace mu2e {
123
123
continue ;
124
124
}
125
125
126
- // Only consider tracks that have all 3 sets of intersection information.
127
- // The three locations are at the intersections of the trajectory with planes
128
- // perpendicular to the z axis and at the front, middle and back of the tracker.
129
- // Just because. It's not a recommendation for analysis.
130
- auto front = ks.intersections ( SurfaceIdEnum::TT_Front ).front ();
131
- auto mid = ks.intersections ( SurfaceIdEnum::TT_Mid ).front ();
132
- auto back = ks.intersections ( SurfaceIdEnum::TT_Back ).front ();
133
- if ( front == ks.intersections ().end () || mid == ks.intersections ().end () || back == ks.intersections ().end () ){
126
+ // A hack to keep the example simple - this is NOT a recommendation for analysis.
127
+ //
128
+ // Only consider tracks that have exactly one intersection at each of the 3 reference surfaces
129
+ // - the reference surfaces are planes perpendicular z axis at the front, middle and back of the tracker.
130
+ // - the reported intersections are the intersection of the trajectory with each surface.
131
+ // Upstream going tracks that reflect in the magnetic mirror and pass through the tracker a second time,
132
+ // may have more than one intersection.
133
+ // It's also possible for a track to have zero intersections with some reference planes.
134
+ auto frontCol = ks.intersections ( SurfaceIdEnum::TT_Front );
135
+ auto midCol = ks.intersections ( SurfaceIdEnum::TT_Mid );
136
+ auto backCol = ks.intersections ( SurfaceIdEnum::TT_Back );
137
+ if ( frontCol.size () !=1 || midCol.size () !=1 || backCol.size () != 1 ){
134
138
_hnSkip->Fill (1 .);
135
139
continue ;
136
140
}
141
+ auto front = frontCol.at (0 );
142
+ auto mid = midCol.at (0 );
143
+ auto back = backCol.at (0 );
137
144
138
145
// Apply fiducial time cut;
139
146
if ( mid->time () < _tmin ){
0 commit comments