Skip to content

Commit e5b5ad6

Browse files
committed
Bug fix in accessing intersections.
Adjust plot limits in some histograms.
1 parent fdb7dcd commit e5b5ad6

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

AllInOne/src/All01_module.cc

+17-10
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,14 @@ namespace mu2e {
8787
void All01::beginJob(){
8888
art::ServiceHandle<art::TFileService> tfs;
8989
_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. );
9191
_hHasCalo = tfs->make<TH1F>("hHasCalo", "Number of calorimeter hits.", 2, 0., 2. );
9292
_ht0 = tfs->make<TH1F>("ht0", "Track time at mid-point of Tracker ;(ns)", 100, 0., 2000. );
9393
_hp = tfs->make<TH1F>("hp", "Track momentum at mid-point of tracker;( MeV/c)", 100, 70., 120. );
9494
_hpErr = tfs->make<TH1F>("hpErr", "Error on track momentum at mid-point of tracker;( MeV/c)", 100, 0., 2. );
9595
_hnSkip = tfs->make<TH1F>("hnSkip", "Cut tree for skipped tracks;( MeV/c)", 3, 0., 3. );
9696
_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. );
9898
_hdTCrv = tfs->make<TH1F>("hdTnCrv", "delta(T) track-CRV Coincidence cluster;(ns)", 200, -2000., 2000. );
9999

100100
// Time, Momentum, Error on Momentum at Front, Mid and Back planes of the tracker
@@ -123,17 +123,24 @@ namespace mu2e {
123123
continue;
124124
}
125125

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 ){
134138
_hnSkip->Fill(1.);
135139
continue;
136140
}
141+
auto front = frontCol.at(0);
142+
auto mid = midCol.at(0);
143+
auto back = backCol.at(0);
137144

138145
// Apply fiducial time cut;
139146
if ( mid->time() < _tmin ){

0 commit comments

Comments
 (0)