Project

General

Profile

Trackersoftwarereview-mtg7 » History » Version 11

Rogers, Chris, 08 September 2017 14:33

1 1 Rajaram, Durga
h1. Tracker Software Review: Meeting 7
2
3 3 Rajaram, Durga
h2. September 8, 2017: 1400 BST
4 1 Rajaram, Durga
5
h2. Agenda
6
7
# *Introduction* - K. Long
8
# *Actions from previous meetings*
9
* *PR*:
10 8 Dobbs, Adam
### AD: Handle errors correctly in MINUIT fits
11 1 Rajaram, Durga
### AD: Optimize Chi2 cut for “MINUIT” variant
12
### AD, CH: Check and implement MCS errors
13
### AD: Plot chisq per dof for 'perfect' events
14 8 Dobbs, Adam
### AD, KL: Define multi-track requirements
15 1 Rajaram, Durga
### -AD: Compare data/MC efficiencies for 8681- _Done_
16
### -AD: Show distributions with sign per station per tracker- _Done_
17 6 Dobbs, Adam
### -AD: Show individual residual distributions to understand details - is the station 1 distribution a binning artifact or a constraint from the fit?- _Done_
18 1 Rajaram, Durga
* *Track fit*:
19
### Repeat study that was done to investigate whether field integration (e.g. using Runge Kutta) is required to compensate for magnetic field non-uniformity
20
### Make study of magnetic-field alignment with a view to establishing whether the present algorithm is sufficiently insensitive to reasonable assumptions of maximum field-misalignment
21
### Study p-value: split up contributions to p-value shape using MC and study shape in data, e.g. is there an error in the resolution per plane, handling of MCS, handing of energy loss, b field..
22
* *Tracker, MC*:
23
## MU/EO: Understand reasons for shape of hits-per-station histogram - low-level
24
## PK: Check dead channel & noise handling in MC. 
25
## Tracker group: Summarize, show what has been studied so far for systematics (alignment, scattering, energy loss, field uniformity, etc).
26
27
28
# *Report on actions: Pattern recognition*: A. Dobbs
29
# *Report on actions: Track fit*: C. Hunt
30
# *Next Steps for review*
31
# *AoB*
32 11 Rogers, Chris
** http://micewww.pp.rl.ac.uk/attachments/download/9161/2016-04_1-2_6mm_diag.pdf
33 1 Rajaram, Durga
---
34
35
h2. Dial-in information
36
37
http://mice.iit.edu/phonebridge.html
38
39
---
40
41
h2. Attendance: KL, CR, PK, AD, CH, MU, DR
42
43
h2. Notes from Meeting 5: Aug 16, 2017:
44
45
* AD: Compare data/MC efficiencies for 8681
46
** done. 8681, 2.8.5 MC reprocessed with 2.9.1-PatRec,Kalman  -- results consistent with 2.9.1 reco
47
** Illustrative plots added 
48
49
* AD: Optimize Chi2 cut for “MINUIT” variant
50
** pushing cuts lower gives higher efficiencies, though purity may be an issue. Noted that critical parameter is efficiency
51
** Q: how loose should the LSQ cuts be? AD points to loosest cut in table from previous meeting.
52
53
* AD: Show residual distributions with sign per station per tracker
54
** sent to email list, added to meeting wiki
55
56
* AD: Plot chisq per dof for 'perfect’ events
57 2 Rajaram, Durga
** stands
58 1 Rajaram, Durga
59
* Define multi-track requirements
60 2 Rajaram, Durga
** stands. Need discussion and inputs on how to define 
61 1 Rajaram, Durga
62
* Adding errors:
63
** for circle fit: suggestion is to define a mean error and apply to every station rather than station-by-station errors.
64
** Q: how to define mean error? based on the geometric mean of the errors?
65
** Q: does taking the chi^2/mean_error^2 bias the pr fit?
66
** errors on the resulting circle fit parameters will feed into the longitudinal fit
67
68
* Discussion about aperture cut
69 2 Rajaram, Durga
** CR notes that aperture cut should be standardized by tracker group. AD notes that the cut in PR is loose -- 150.
70 1 Rajaram, Durga
** PK suggests a flag to indicate if track passed or failed an aperture cut
71
** All agree that fiducial cut should be standardized, 
72
** Q: does the current aperture cut throw out any potential tracks? If it does, cut should be loosened, but consensus seems to be that tracking should not do any "analysis-style" cuts but rather optimize track-finding. 
73
74 10 Dobbs, Adam
* Effect of magnetic field non-uniformity, alignment on track fit -- CH had issues reading mag field map from Joe Langland's program. CH will check against comsol map for 7469.
75
76
h2. Code snippet of pattern recognition residual analysis
77
78
<pre><code class="cplusplus">
79
bool AnalyserTrackerMCPRResiduals::analyse(MAUS::ReconEvent* const aReconEvent,
80
                                           MAUS::MCEvent* const aMCEvent) {
81
  if (!aReconEvent || !aMCEvent) {
82
    return false;
83
  }
84
85
  // Find a hit from a muon in the tracker references plane for each tracker
86
  MAUS::SciFiHit* tku_ref_hit = nullptr;
87
  MAUS::SciFiHit* tkd_ref_hit = nullptr;
88
  for (auto&& hitref : *(aMCEvent->GetSciFiHits())) {
89
    MAUS::SciFiHit* hit = &hitref;
90
    int pid = hit->GetParticleId();
91
    if (pid != 13 && pid != -13)
92
      continue;
93
    if (hit->GetChannelId()->GetStationNumber() == 1 && \
94
        hit->GetChannelId()->GetPlaneNumber() == 0) {
95
      if (hit->GetChannelId()->GetTrackerNumber() == 0) {
96
        tku_ref_hit = hit;
97
      } else if (hit->GetChannelId()->GetTrackerNumber() == 1) {
98
        tkd_ref_hit = hit;
99
      }
100
    }
101
    if (tku_ref_hit && tkd_ref_hit)
102
      break;
103
  }
104
105
  if (!tku_ref_hit || !tkd_ref_hit) {
106
    return false;
107
  }
108
109
  // Access the SciFi Event
110
  MAUS::SciFiEvent* sfevt = aReconEvent->GetSciFiEvent();
111
  if (!sfevt) {
112
    return false;
113
  }
114
115
  // Loop over all the scifi tracks in this event
116
  int nTkURecTracks = 0;
117
  int nTkDRecTracks = 0;
118
  MAUS::SciFiHelicalPRTrack* tku_trk = nullptr;
119
  MAUS::SciFiHelicalPRTrack* tkd_trk = nullptr;
120
  for (auto trk : sfevt->helicalprtracks()) {
121
    if (trk->get_tracker() == 0) {
122
      ++nTkURecTracks;
123
      tku_trk = trk;
124
    } else if (trk->get_tracker() == 1) {
125
      ++nTkDRecTracks;
126
      tkd_trk = trk;
127
    }
128
  }
129
130
  // Require 1 recon track in each tracker
131
  if (nTkURecTracks != 1 || nTkDRecTracks != 1) {
132
    return false;
133
  }
134
135
  if (tku_trk->get_spacepoints_pointers().size() != 5 ||
136
      tkd_trk->get_spacepoints_pointers().size() != 5) {
137
    return false;
138
  }
139
140
  // At this point we should an event that is good to analyse
141
  // Calculate the recon postion at the reference station, and the recon momentum (average)
142
  double tku_x = 0.0;
143
  double tku_y = 0.0;
144
  for (auto sp : tku_trk->get_spacepoints_pointers()) {
145
    if (sp->get_station() == 1) {
146
      tku_x = sp->get_position().x();
147
      tku_y = sp->get_position().y();
148
    }
149
  }
150
151
  double tkd_x = 0.0;
152
  double tkd_y = 0.0;
153
  for (auto sp : tkd_trk->get_spacepoints_pointers()) {
154
    if (sp->get_station() == 1) {
155
      tkd_x = sp->get_position().x();
156
      tkd_y = sp->get_position().y();
157
    }
158
  }
159
160
  double tku_dx = tku_x + tku_ref_hit->GetPosition().x();
161
  double tku_dy = tku_y - tku_ref_hit->GetPosition().y();
162
163
  double tku_ptmc = sqrt(tku_ref_hit->GetMomentum().x()*tku_ref_hit->GetMomentum().x() +
164
                         tku_ref_hit->GetMomentum().y()*tku_ref_hit->GetMomentum().y());
165
  double tku_ptrec = 0.3*mBfield*tku_trk->get_R(); // 0.3 comes from mom being in MeV and rad in mm
166
  double tku_dpt = tku_ptrec - tku_ptmc;
167
168
  double tku_pzrec = tku_ptrec / tku_trk->get_dsdz();
169
  double tku_dpz =  tku_pzrec + tku_ref_hit->GetMomentum().z();
170
171
  double tkd_dx = tkd_x - tkd_ref_hit->GetPosition().x();
172
  double tkd_dy = tkd_y - tkd_ref_hit->GetPosition().y();
173
174
  double tkd_ptmc = sqrt(tkd_ref_hit->GetMomentum().x()*tkd_ref_hit->GetMomentum().x() +
175
                         tkd_ref_hit->GetMomentum().y()*tkd_ref_hit->GetMomentum().y());
176
  double tkd_ptrec = 0.3*mBfield*tkd_trk->get_R(); // 0.3 comes from mom being in MeV and rad in mm
177
  double tkd_dpt = tkd_ptrec - tkd_ptmc;
178
179
  double tkd_pzrec = tkd_ptrec / tkd_trk->get_dsdz();
180
  double tkd_dpz = tkd_pzrec + tkd_ref_hit->GetMomentum().z();
181
182
  // Fill the histograms
183
  mHTkUMCPositionX->Fill(tku_ref_hit->GetPosition().x());
184
  mHTkUMCPositionY->Fill(tku_ref_hit->GetPosition().y());
185
  mHTkUMCMomentumT->Fill(tku_ptmc);
186
  mHTkUMCMomentumZ->Fill(tku_ref_hit->GetMomentum().z());
187
188
  mHTkURecPositionX->Fill(tku_x);
189
  mHTkURecPositionY->Fill(tku_y);
190
  mHTkURecMomentumT->Fill(tku_ptrec);
191
  mHTkURecMomentumZ->Fill(tku_pzrec);
192
193
  mHTkUPositionResidualsX->Fill(tku_dx);
194
  mHTkUPositionResidualsY->Fill(tku_dy);
195
  mHTkUMomentumResidualsT->Fill(tku_dpt);
196
  mHTkUMomentumResidualsZ->Fill(tku_dpz);
197
198
  mHTkDMCPositionX->Fill(tkd_ref_hit->GetPosition().x());
199
  mHTkDMCPositionY->Fill(tkd_ref_hit->GetPosition().y());
200
  mHTkDMCMomentumT->Fill(tkd_ptmc);
201
  mHTkDMCMomentumZ->Fill(tkd_ref_hit->GetMomentum().z());
202
203
  mHTkDRecPositionX->Fill(tkd_x);
204
  mHTkDRecPositionY->Fill(tkd_y);
205
  mHTkDRecMomentumT->Fill(tkd_ptrec);
206
  mHTkDRecMomentumZ->Fill(tkd_pzrec);
207
208
  mHTkDPositionResidualsX->Fill(tkd_dx);
209
  mHTkDPositionResidualsY->Fill(tkd_dy);
210
  mHTkDMomentumResidualsT->Fill(tkd_dpt);
211
  mHTkDMomentumResidualsZ->Fill(tkd_dpz);
212
213
  return true;
214
}  
215
</code></pre>