SND@LHC Software
Loading...
Searching...
No Matches
GFGbl.cc File Reference
#include "GFGbl.h"
#include "GblTrajectory.h"
#include "GblPoint.h"
#include "MyDebugTools.h"
#include "AbsMeasurement.h"
#include "PlanarMeasurement.h"
#include "KalmanFitterInfo.h"
#include "Track.h"
#include <TFile.h>
#include <TH1F.h>
#include <TTree.h>
#include <string>
#include <list>
#include <FieldManager.h>
#include <HMatrixU.h>
#include <HMatrixV.h>
#include <Math/SMatrix.h>
#include <TMatrixD.h>
#include <TVectorDfwd.h>
#include <TMatrixT.h>
#include <TVector3.h>
Include dependency graph for GFGbl.cc:

Go to the source code of this file.

Functions

void getScattererFromMatList (double &length, double &theta, double &s, double &ds, const double p, const double mass, const double charge, const std::vector< MatStep > &steps)
 Evaluates moments of radiation length distribution from list of material steps and computes parameters describing a corresponding thick scatterer.
 

Variables

gbl::MilleBinarymilleFile
 
const double scatEpsilon = 1.e-8
 

Function Documentation

◆ getScattererFromMatList()

void getScattererFromMatList ( double &  length,
double &  theta,
double &  s,
double &  ds,
const double  p,
const double  mass,
const double  charge,
const std::vector< MatStep > &  steps 
)

Evaluates moments of radiation length distribution from list of material steps and computes parameters describing a corresponding thick scatterer.

Based on input from Claus Kleinwort (DESY), adapted for continuous material distribution represented by a sum of step functions. Returned thick scatterer can be represented by two GBL scattering points at (s - ds) and (s + ds) with variance of theta equal to theta/sqrt(2) for both points. Calculates variance of theta from total sum of radiation lengths instead of summimg squares of individual deflection angle variances.

Parameters
lengthreturned: Length of the track
thetareturned: Variation of distribution of deflection angle
sreturned: First moment of material scattering distribution
dsreturned: Second moment (variance) of material scattering distribution
pParticle momentum magnitude (GeV/c)
massMass of particle (GeV/c/c)
stepsVector of material steps from (RKTrackRep) extrapolation
Returns
void

Definition at line 262 of file GFGbl.cc.

263{
264 theta = 0.; s = 0.; ds = 0.;
265 if (steps.empty()) return;
266
267 // sum of step lengths
268 double len = 0.;
269 // normalization
270 double sumxx = 0.;
271 // first moment (non-normalized)
272 double sumx2x2 = 0.;
273 // (part of) second moment / variance (non-normalized)
274 double sumx3x3 = 0.;
275
276 double xmin = 0.;
277 double xmax = 0.;
278
279 for (unsigned int i = 0; i < steps.size(); i++) {
280 const MatStep step = steps.at(i);
281 // inverse of material radiation length ... (in 1/cm) ... "density of scattering"
282 double rho = 1. / step.materialProperties_.getRadLen();
283 len += fabs(step.stepSize_);
284 xmin = xmax;
285 xmax = xmin + fabs(step.stepSize_);
286 // Compute integrals
287
288 // integral of rho(x)
289 sumxx += rho * (xmax - xmin);
290 // integral of x*rho(x)
291 sumx2x2 += rho * (xmax * xmax - xmin * xmin) / 2.;
292 // integral of x*x*rho(x)
293 sumx3x3 += rho * (xmax * xmax * xmax - xmin * xmin * xmin) / 3.;
294 }
295 // This ensures PDG formula still gives positive results (but sumxx should be > 1e-4 for it to hold)
296 if (sumxx < 1.0e-10) return;
297 // Calculate theta from total sum of radiation length
298 // instead of summimg squares of individual deflection angle variances
299 // PDG formula:
300 double beta = p / sqrt(p * p + mass * mass);
301 theta = (0.0136 / p / beta) * fabs(charge) * sqrt(sumxx) * (1. + 0.038 * log(sumxx));
302 //theta = (0.015 / p / beta) * fabs(charge) * sqrt(sumxx);
303
304 // track length
305 length = len;
306 // Normalization factor
307 double N = 1. / sumxx;
308 // First moment
309 s = N * sumx2x2;
310 // Square of second moment (variance)
311 // integral of (x - s)*(x - s)*rho(x)
312 double ds_2 = N * (sumx3x3 - 2. * sumx2x2 * s + sumxx * s * s);
313 ds = sqrt(ds_2);
314
315 #ifdef DEBUG
316 //cout << "Thick scatterer parameters:" << endl;
317 //cout << "Variance of theta: " << theta << endl;
318 //cout << "Mean s : " << s << endl;
319 //cout << "Variance of s : " << ds << endl;
320
321 #endif
322}
int i
Definition ShipAna.py:86
Simple struct containing MaterialProperties and stepsize in the material.
Definition AbsTrackRep.h:42

Variable Documentation

◆ milleFile

gbl::MilleBinary* milleFile

Definition at line 166 of file GFGbl.cc.

◆ scatEpsilon

const double scatEpsilon = 1.e-8

Definition at line 168 of file GFGbl.cc.