Added dead layer contribution to P(B)

This commit is contained in:
Bastian M. Wojek 2009-06-16 09:07:19 +00:00
parent 6fe8f1c8cf
commit 8402cba3ca
2 changed files with 21 additions and 5 deletions

View File

@ -140,7 +140,7 @@ TLondon1D3LSub::~TLondon1D3LSub() {
// creates (a pointer to) the TPofTCalc object (with the FFT plan)
//------------------
TLondon1DHS::TLondon1DHS() : fCalcNeeded(true), fFirstCall(true) {
TLondon1DHS::TLondon1DHS() : fCalcNeeded(true), fFirstCall(true), fDeadLayerChanged(true) {
// read startup file
string startup_path_name("TFitPofB_startup.xml");
@ -165,8 +165,10 @@ TLondon1DHS::TLondon1DHS() : fCalcNeeded(true), fFirstCall(true) {
fParForPofB.push_back(startupHandler->GetDeltat());
fParForPofB.push_back(startupHandler->GetDeltaB());
fParForPofB.push_back(0.0);
// fParForPofB.push_back(0.0);
fParForPofB.push_back(0.0); // Energy
fParForPofB.push_back(0.0); // Bkg-Field
fParForPofB.push_back(0.005); // Bkg-width
fParForPofB.push_back(0.0); // Bkg-weight
TTrimSPData *x = new TTrimSPData(rge_path, energy_vec);
fImpProfile = x;
@ -230,6 +232,9 @@ double TLondon1DHS::operator()(double t, const vector<double> &par) const {
par_changed = true;
if (i == 0) {
only_phase_changed = true;
} else if (i == 3) {
fDeadLayerChanged = true;
only_phase_changed = false;
} else {
only_phase_changed = false;
}
@ -253,7 +258,16 @@ double TLondon1DHS::operator()(double t, const vector<double> &par) const {
fParForBofZ[i-2] = par[i];
fParForPofB[2] = par[1]; // energy
// fParForPofB[3] = par[3]; // deadlayer for convolution of field profile
fParForPofB[3] = par[2]; // Bkg-Field
//fParForPofB[4] = 0.005; // Bkg-width (in principle zero)
if(fDeadLayerChanged){
vector<double> interfaces;
interfaces.push_back(par[3]);// dead layer
fParForPofB[5] = fImpProfile->LayerFraction(par[1], 1, interfaces); // Fraction of muons in the deadlayer
interfaces.clear();
fDeadLayerChanged = false;
}
TLondon1D_HS BofZ(fParForBofZ);
TPofBCalc PofB(BofZ, *fImpProfile, fParForPofB);

View File

@ -127,7 +127,7 @@ if (type == "skg"){ // skewed Gaussian
//-----------
// Constructor that does the P(B) calculation for given analytical inverse of B(z) and its derivative and n(z)
// Parameters: dt[us], dB[G], Energy[keV]
// Parameters: dt[us], dB[G], Energy[keV], Bbg[G], width[us^{-1}], weight[1]
//-----------
TPofBCalc::TPofBCalc( const TBofZCalcInverse &BofZ, const TTrimSPData &dataTrimSP, const vector<double> &para ) : fDT(para[0]), fDB(para[1])
@ -186,6 +186,8 @@ TPofBCalc::TPofBCalc( const TBofZCalcInverse &BofZ, const TTrimSPData &dataTrimS
for (unsigned int i(firstZerosEnd); i<lastZerosStart; i++)
fPB[i] /= pBsum;
AddBackground(para[3], para[4], para[5]);
}