close
Warning:
Can't synchronize with repository "(default)" ("(default)" is not readable or not a Git repository.). Look in the Trac log for more information.
- Timestamp:
-
Jan 6, 2017, 2:38:27 PM (8 years ago)
- Author:
-
Clarence Wret
- Comment:
-
--
Legend:
- Unmodified
- Added
- Removed
- Modified
-
v43
|
v44
|
|
260 | 260 | |
261 | 261 | {{{ |
262 | | // Need to make sure there's a muon |
263 | | if (event->NumFSParticle(13) == 0) return; |
264 | | }}} |
265 | | |
266 | | To then get the muon kinematics in the `FitEvent` we use `FitEvent::GetHMFSParticle(int pdg)` to get the '''H'''ighest'''M'''omentum'''F'''inal'''S'''tate'''Particle''', which return a `FitParticle` object. The implementation for the `FitParticle` is in `FitBase/FitParticle.cxx`. We can now access the ROOT object `TLorentzVector` which stores the kinematics for the muon. So to get the muon we do: |
267 | | |
268 | | {{{ |
269 | | // Get the muon |
270 | | TLorentzVector Pmu = event->GetHMFSParticle(13)->fP; |
| 262 | // Need to make sure there's a muon |
| 263 | if (event->NumFSParticle(13) == 0) return; |
| 264 | }}} |
| 265 | |
| 266 | To then get the muon kinematics in the `FitEvent` we use `FitEvent::GetHMFSParticle(int pdg)` to get the '''H'''ighest'''M'''omentum'''F'''inal'''S'''tate particle, which return a `FitParticle` object. The implementation for `FitParticle` is in `FitBase/FitParticle.cxx`. We can now access the ROOT object `TLorentzVector` in the `FitParticle` which stores the kinematics for the muon. So after we know there's a muon in the event we get the muon by: |
| 267 | |
| 268 | {{{ |
| 269 | // Get the muon |
| 270 | TLorentzVector Pmu = event->GetHMFSParticle(13)->fP; |
| 271 | }}} |
| 272 | |
| 273 | Now we just need the momentum of this `TLorentzVector`, which can simply be done by calling `TLorentzVector::Vect()::Mag()`, amongst others. |
| 274 | |
| 275 | However, we recommend using the `FitUtils` namespace to unify the implementations and minimize errors. The `FitUtils` namespace lives in `src/Utils/FitUtils.cxx`, in which we see the `double p(TLorentzVector)` function. |
| 276 | |
| 277 | To get the muon momentum (in GeV) we do |
| 278 | |
| 279 | {{{ |
| 280 | double p_mu = FitUtils::p(Pmu); |
| 281 | }}} |
| 282 | |
| 283 | and then to finally set the `Measurement1D` member which saves the dependent variable we do |
| 284 | |
| 285 | {{{ |
| 286 | fXVar = p_mu |
| 287 | |
| 288 | return; |
271 | 289 | }}} |
272 | 290 | === For the E^rec^,,nu,, === |