本文整理汇总了C++中TLorentzVector::Angle方法的典型用法代码示例。如果您正苦于以下问题:C++ TLorentzVector::Angle方法的具体用法?C++ TLorentzVector::Angle怎么用?C++ TLorentzVector::Angle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TLorentzVector
的用法示例。
在下文中一共展示了TLorentzVector::Angle方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ffgammajet
void ztree::ffgammajet(std::string outfname, int centmin, int centmax, float phoetmin, float phoetmax, std::string gen)
{
string tag = outfname;
string s_alpha = gen;
if (fChain == 0) return;
Long64_t nentries = fChain->GetEntriesFast();
TFile * fout = new TFile(Form("%s_%s_%s_%d_%d.root",outfname.data(),tag.data(),s_alpha.data(),abs(centmin),abs(centmax)),"recreate");
TH2D * hsubept = new TH2D(Form("hsubept_%s_%s_%d_%d",tag.data(),s_alpha.data(),abs(centmin),abs(centmax)),Form(";#xi=ln(1/z);"),100,-0.5,99.5,100,0,100);
TH2D * hsubept_refcone = new TH2D(Form("hsubept_refcone_%s_%s_%d_%d",tag.data(),s_alpha.data(),abs(centmin),abs(centmax)),Form(";#xi=ln(1/z);"),100,-0.5,99.5,100,0,100);
TH1D * hjetpt = new TH1D(Form("hjetpt_%s_%s_%d_%d",tag.data(),s_alpha.data(),abs(centmin),abs(centmax)),Form(";jet p_{T};"),20,0,500);
TH1D * hjetgendphi = new TH1D(Form("hjetgendphi_%s_%s_%d_%d",tag.data(),s_alpha.data(),abs(centmin),abs(centmax)),Form(";#DeltaR_{gen,reco};"),20,0,0.1);
TH1D * hgammaff = new TH1D(Form("hgammaff_%s_%s_%d_%d",tag.data(),s_alpha.data(),abs(centmin),abs(centmax)),Form(";z;"),20,0,1);
TH1D * hgammaffxi = new TH1D(Form("hgammaffxi_%s_%s_%d_%d",tag.data(),s_alpha.data(),abs(centmin),abs(centmax)),Form(";#xi=ln(1/z);"),10,0,5);
TH1D * hgammaffxi_refcone = new TH1D(Form("hgammaffxi_refcone_%s_%s_%d_%d",tag.data(),s_alpha.data(),abs(centmin),abs(centmax)),Form(";#xi=ln(1/z);"),10,0,5);
TH1D * hgammaphoffxi = new TH1D(Form("hgammaphoffxi_%s_%s_%d_%d",tag.data(),s_alpha.data(),abs(centmin),abs(centmax)),Form(";#xi=ln(1/z);"),10,0,5);
TH1D * hgammaphoffxi_refcone = new TH1D(Form("hgammaphoffxi_refcone_%s_%s_%d_%d",tag.data(),s_alpha.data(),abs(centmin),abs(centmax)),Form(";#xi=ln(1/z);"),10,0,5);
Long64_t nbytes = 0, nb = 0;
cout<<phoetmin<<" "<<phoetmax<<endl;
for (Long64_t jentry=0; jentry<nentries;jentry++) {
if(jentry%10000==0) { cout<<jentry<<"/"<<nentries<<endl; }
Long64_t ientry = LoadTree(jentry);
if (ientry < 0) break;
// cout<<njet<<endl;
// if(jentry > 10000) break;
nb = fChain->GetEntry(jentry); nbytes += nb;
if(hiBin < centmin || hiBin >= centmax) continue; //centrality cut
if(nPho!=1) continue;
// if(phoEt[0]<phoetmin || phoEt[0]>phoetmax) continue;
if(weight==0) weight=1;
// cout<<njet<<endl;
if(gen.compare("gen")==0)
{
for (int ijet = 0; ijet < njet; ijet++) {
if(mcEt[pho_genMatchedIndex[0]]<phoetmin || mcEt[pho_genMatchedIndex[0]]>phoetmax) continue;
if( nPho==2 ) continue;
if( jetpt[ijet]<40 ) continue; //jet pt Cut
if( fabs(jeteta[ijet]) > 1.6) continue; //jeteta Cut
if( fabs(jeteta[ijet]) < 0.3) continue; //jeteta Cut for reflected cone
if( jetID[ijet]==0 ) continue; //redundant in this skim (all true)
if( acos(cos(jetphi[ijet] - phoPhi[0])) < 7 * pi / 8 ) continue;
hjetpt->Fill(jetpt[ijet]);
float denrecodphi = acos(cos(jetphi[ijet] - gjetphi[ijet]));
hjetgendphi->Fill(denrecodphi);
TLorentzVector vjet;
vjet.SetPtEtaPhiM(gjetpt[ijet],gjeteta[ijet],gjetphi[ijet],0);
for(int igen = 0 ; igen < mult ; ++igen)
{
if(!(abs(pdg[igen])==11 || abs(pdg[igen])==13 || abs(pdg[igen])==211 || abs(pdg[igen])==2212 || abs(pdg[igen])==321)) continue;
if(sube[igen] != 0) continue;
float dr = genjettrk_dr(igen,ijet);
float dr_refcone = genrefconetrk_dr(igen,ijet);
if(dr<0.3)
{
TLorentzVector vtrack;
vtrack.SetPtEtaPhiM(pt[igen],eta[igen],phi[igen],0);
float angle = vjet.Angle(vtrack.Vect());
float z = pt[igen]*cos(angle)/gjetpt[ijet];
float zpho = pt[igen]/phoEt[0];
float xi = log(1.0/z);
float xipho = log(1.0/zpho);
hgammaff->Fill(z);
hgammaffxi->Fill(xi);
hgammaphoffxi->Fill(xipho);
hsubept->Fill(sube[igen],pt[igen]);
// cout<<jetpt[ijet]<<endl;
}
if(dr_refcone<0.3)
{
float z = pt[igen]/gjetpt[ijet];
float zpho = pt[igen]/phoEt[0];
float xi = log(1.0/z);
float xipho = log(1.0/zpho);
hgammaffxi_refcone->Fill(xi);
hgammaphoffxi_refcone->Fill(xipho);
hsubept_refcone->Fill(sube[igen],pt[igen]);
}
}
}
}
else
{
for (int ijet = 0; ijet < njet; ijet++) {
if( nPho==2 ) continue;
if( phoEt[0]*phoCorr[0]<phoetmin || phoEt[0]*phoCorr[0]>phoetmax) continue;
if( jetpt[ijet]<40 ) continue; //jet pt Cut
if( fabs(jeteta[ijet]) > 1.6) continue; //jeteta Cut
if( fabs(jeteta[ijet]) < 0.3) continue; //jeteta Cut for reflected cone
if( jetID[ijet]==0 ) continue; //redundant in this skim (all true)
if( acos(cos(jetphi[ijet] - phoPhi[0])) < 7 * pi / 8 ) continue;
hjetpt->Fill(jetpt[ijet]);
TLorentzVector vjet;
vjet.SetPtEtaPhiM(jetpt[ijet],jeteta[ijet],jetphi[ijet],0);
for (int itrk = 0; itrk < nTrk; itrk++) {
float dr = jettrk_dr(itrk,ijet);
// float dr = genjetrecotrk_dr(itrk,ijet);
//.........这里部分代码省略.........
示例2: NewVariables
//.........这里部分代码省略.........
added_Xic_tree.Branch("pKpi_as_K_M", &pKpi_as_K_M, "pKpi_as_K_M/D");
added_Xic_tree.Branch("pKpi_as_p_M", &pKpi_as_p_M, "pKpi_as_p_M/D");
UInt_t Xic_nevents = Xic_tree->GetEntries();
cout << "Entries in Xic tree: " << Xic_nevents << endl;
for (UInt_t evt = 0; evt < Xic_nevents;evt++) {
Xic_tree->GetEntry(evt);
TVector3 dir(Xb_ENDVERTEX_X-Xb_OWNPV_X,Xb_ENDVERTEX_Y-Xb_OWNPV_Y,Xb_ENDVERTEX_Z-Xb_OWNPV_Z);
TVector3 mom;
mom.SetPtEtaPhi(Xb_PT,Xb_ETA,Xb_PHI);
double dmag2 = dir.Mag2();
double ptprime = 0;
if ( 0 == dmag2 ) ptprime = mom.Mag();
else ptprime = (mom - dir * ( mom.Dot( dir ) / dmag2 )).Mag() ;
Xb_CorrM = sqrt(Xb_M*Xb_M + ptprime*ptprime) + ptprime;
TLorentzVector Xb;
Xb.SetPtEtaPhiM(Xb_PT,Xb_ETA,Xb_PHI,Xb_CorrM);
TLorentzVector Xc;
Xc.SetPtEtaPhiM(Xc_PT,Xc_ETA,Xc_PHI,Xc_M);
for(int i = 0; i < Added_n_Particles; i++){
TLorentzVector Hpi;
Hpi.SetPtEtaPhiM(Added_H_PT[i],Added_H_ETA[i],Added_H_PHI[i],pionmass);
TLorentzVector HK;
HK.SetPtEtaPhiM(Added_H_PT[i],Added_H_ETA[i],Added_H_PHI[i],kaonmass);
TLorentzVector Hp;
Hp.SetPtEtaPhiM(Added_H_PT[i],Added_H_ETA[i],Added_H_PHI[i],protonmass);
TLorentzVector Xcpi = Hpi + Xc;
TLorentzVector XcK = HK + Xc;
TLorentzVector Xcp = Hp + Xc;
Xcpi.Boost(-Xb.BoostVector());
Xcpi_CosTheta[i] = cos(Xcpi.Angle(Xb.Vect()));
XcK.Boost(-Xb.BoostVector());
XcK_CosTheta[i] = cos(XcK.Angle(Xb.Vect()));
Xcp.Boost(-Xb.BoostVector());
Xcp_CosTheta[i] = cos(Xcp.Angle(Xb.Vect()));
}
TLorentzVector proton;
proton.SetPtEtaPhiM(p_PT,p_ETA,p_PHI,protonmass);
TLorentzVector kaon;
kaon.SetPtEtaPhiM(K_PT,K_ETA,K_PHI,kaonmass);
TLorentzVector pion;
pion.SetPtEtaPhiM(pi_PT,pi_ETA,pi_PHI,pionmass);
p_beta = (-proton.P()+kaon.P()+pion.P())/(proton.P()+kaon.P()+pion.P());
K_beta = ( proton.P()-kaon.P()+pion.P())/(proton.P()+kaon.P()+pion.P());
pi_beta = ( proton.P()+kaon.P()-pion.P())/(proton.P()+kaon.P()+pion.P());
TLorentzVector p_as_pi;
p_as_pi.SetVectM(proton.Vect(),pionmass);
TLorentzVector p_as_K;
p_as_K.SetVectM(proton.Vect(),kaonmass);
TLorentzVector K_as_pi;
K_as_pi.SetVectM(kaon.Vect(),pionmass);
TLorentzVector K_as_p;
K_as_p.SetVectM(kaon.Vect(),protonmass);
TLorentzVector pi_as_K;
pi_as_K.SetVectM(pion.Vect(),kaonmass);
TLorentzVector pi_as_p;
pi_as_p.SetVectM(pion.Vect(),protonmass);
示例3: PlotTheta
void PlotTheta( TString inputfilename, TString outputfilename = "output.root"){
// infile= new TFile("../PATGrid.SM.10k.root","READ");
infile = new TFile(inputfilename, "READ");
tree = (TTree*)infile->Get("Event");
outputFile = new TFile(outputfilename, "RECREATE");
outTree = new TTree("MyTree","Untersuchung der RekoObjekte");
//TH2::SetDefaultSumw2();
histogram__CosThetaDiff = new TH1D("histogram__CosThetaDiff", "Differenz CosTheta gen-reko", 400, -2, 2);
histogram__CosTheta_GenReko = new TH2D("histogram__CosTheta_GenReko", "Reko-cos(theta) gegen Gen-cos(theta)", 50, -1, 1, 50, -1, 1);
histogram__gen_A = new TH2D("histogram__gen_A", "histogram__gen_A", 5, -1, 1, 5, -1, 1);
histogram__gen_N = new TH2D("histogram__gen_N", "histogram__gen_N", 5, -1, 1, 5, -1, 1);
histogram__gen_LL = new TH2D("histogram__gen_LL", "histogram__gen_LL", 5, -1, 1, 5, -1, 1);
histogram__gen_LR = new TH2D("histogram__gen_LR", "histogram__gen_LR", 5, -1, 1, 5, -1, 1);
histogram__gen_RR = new TH2D("histogram__gen_RR", "histogram__gen_RR", 5, -1, 1, 5, -1, 1);
histogram__gen_RL = new TH2D("histogram__gen_RL", "histogram__gen_RL", 5, -1, 1, 5, -1, 1);
histogram__gen_Correlation = new TH2D("histogram__gen_Correlation", "histogram__gen_Correlation", 5, -1, 1, 5, -1, 1);
histogram__A = new TH2D("histogram__A", "histogram__A", 5, -1, 1, 5, -1, 1);
histogram__N = new TH2D("histogram__N", "histogram__N", 5, -1, 1, 5, -1, 1);
histogram__Correlation = new TH2D("histogram__Correlation", "histogram__Correlation", 5, -1, 1, 5, -1, 1);
histogram__Correlation_L15_B50_T1 = new TH2D("histogram__Correlation_L15_B50_T1", "histogram__Correlation_L15_B50_T1", 5, -1, 1, 5, -1, 1);
histogram__A_L15_B50_T1 = new TH2D("histogram__A_L15_B50_T1", "histogram__A_L15_B50_T1", 5, -1, 1, 5, -1, 1);
histogram__N_L15_B50_T1 = new TH2D("histogram__N_L15_B50_T1", "histogram__N_L15_B50_T1", 5, -1, 1, 5, -1, 1);
histogram__Correlation_L20 = new TH2D("histogram__Correlation_L20", "histogram__Correlation_L20", 5, -1, 1, 5, -1, 1);
histogram__A_L20 = new TH2D("histogram__A_L20", "histogram__A_L20", 5, -1, 1, 5, -1, 1);
histogram__N_L20 = new TH2D("histogram__N_L20", "histogram__N_L20", 5, -1, 1, 5, -1, 1);
histogram__Correlation_L20_B40 = new TH2D("histogram__Correlation_L20_B40", "histogram__Correlation_L20_B40", 5, -1, 1, 5, -1, 1);
histogram__A_L20_B40 = new TH2D("histogram__A_L20_B40", "histogram__A_L20_B40", 5, -1, 1, 5, -1, 1);
histogram__N_L20_B40 = new TH2D("histogram__N_L20_B40", "histogram__N_L20_B40", 5, -1, 1, 5, -1, 1);
histogram__Correlation_L20_B30_T1 = new TH2D("histogram__Correlation_L20_B30_T1", "histogram__Correlation_L20_B30_T1", 5, -1, 1, 5, -1, 1);
histogram__A_L20_B30_T1 = new TH2D("histogram__A_L20_B30_T1", "histogram__A_L20_B30_T1", 5, -1, 1, 5, -1, 1);
histogram__N_L20_B30_T1 = new TH2D("histogram__N_L20_B30_T1", "histogram__N_L20_B30_T1", 5, -1, 1, 5, -1, 1);
histogram__Correlation_L20_B40_T1 = new TH2D("histogram__Correlation_L20_B40_T1", "histogram__Correlation_L20_B40_T1", 5, -1, 1, 5, -1, 1);
histogram__A_L20_B40_T1 = new TH2D("histogram__A_L20_B40_T1", "histogram__A_L20_B40_T1", 5, -1, 1, 5, -1, 1);
histogram__N_L20_B40_T1 = new TH2D("histogram__N_L20_B40_T1", "histogram__N_L20_B40_T1", 5, -1, 1, 5, -1, 1);
histogram__Correlation_T1 = new TH2D("histogram__Correlation_T1", "histogram__Correlation_T1", 5, -1, 1, 5, -1, 1);
histogram__A_T1 = new TH2D("histogram__A_T1", "histogram__A_T1", 5, -1, 1, 5, -1, 1);
histogram__N_T1 = new TH2D("histogram__N_T1", "histogram__N_T1", 5, -1, 1, 5, -1, 1);
histogram__CosThetaDiff_TTbarPt = new TH2D("histogram__CosThetaDiff_TTbarPt", "histogram__CosThetaDiff_TTbarPt", 100, 0, 1000, 400, -2, 2);
histogram__LeptonRelIso = new TH1D("histogram__LeptonRelIso", "histogram__LeptonRelIso", 101, 0, 1.01);
histogram__semilepton_BLeptonMinus = new TH1D("histogram__semilepton_BLeptonMinus","histogram__semilepton_BLeptonMinus", 200, -1, 1);
histogram__semilepton_BLeptonPlus = new TH1D("histogram__semilepton_BLeptonPlus","histogram__semilepton_BLeptonPlus", 200, -1, 1);
histogram_nupx_gen_reco = new TH2D(" histogram_nupx_gen_reco", " histogram_nupx_gen_reco", 600, -300, 300, 600, -300, 300);
histogram_nupy_gen_reco = new TH2D(" histogram_nupy_gen_reco", " histogram_nupy_gen_reco", 600, -300, 300, 600, -300, 300);
histogram_nupz_gen_reco = new TH2D(" histogram_nupz_gen_reco", " histogram_nupz_gen_reco", 600, -300, 300, 600, -300, 300);
histogram_nubpx_gen_reco = new TH2D(" histogram_nubpx_gen_reco", " histogram_nubpx_gen_reco", 600, -300, 300, 600, -300, 300);
histogram_nubpy_gen_reco = new TH2D(" histogram_nubpy_gen_reco", " histogram_nubpy_gen_reco", 600, -300, 300, 600, -300, 300);
histogram_nubpz_gen_reco = new TH2D(" histogram_nubpz_gen_reco", " histogram_nubpz_gen_reco", 600, -300, 300, 600, -300, 300);
outTree->Branch("EventIsGood", &EventIsGood, "Event ist rekonstruiert/I");
outTree->Branch("numberOfJets", &numberOfJets, "Anzahl der Jets/I");
outTree->Branch("numberOfGoodJets", &numberOfGoodJets, "Anzahl der guten Jets/I");
outTree->Branch("CosThetaDiff" ,&CosThetaDiff ,"Differenz im cosTheta Reko zu Gen/D");
outTree->Branch("CosThetaPlus" ,&CosThetaPlus ,"cosTheta LeptonPlus/D");
outTree->Branch("CosThetaMinus" ,&CosThetaMinus ,"cosTheta LeptonMinus/D");
outTree->Branch("RekoCosThetaPlus" ,&RekoCosThetaPlus ,"cosTheta RekoLeptonPlus/D");
outTree->Branch("RekoCosThetaMinus" ,&RekoCosThetaMinus ,"cosTheta RekoLeptonMinus/D");
outTree->Branch("CosLeptonAngleD", &CosLeptonAngleD, "CosinusLeptonWinkel D/D");
outTree->Branch("CosRekoLeptonAngleD", &CosRekoLeptonAngleD, "CosinusRekoLeptonWinkel D/D");
outTree->Branch("TTbar_Pt", &TTbar_Pt, "Pt des TTbarsystems Generator/D");
outTree->Branch("RekoTTbar_Pt", &RekoTTbar_Pt, "Pt des TTbarsystems Reko/D");
outTree->Branch("TTbar_M", &TTbar_M, "Masse des TTbarsystems Generator/D");
outTree->Branch("RekoTTbar_M", &RekoTTbar_M, "Masse des TTbarsystems Reko/D");
outTree->Branch("Top_Pt", &Top_Pt, "Pt des Tops Generator/D");
outTree->Branch("Top_M", &Top_M, "M des Tops Generator/D");
outTree->Branch("AntiTop_Pt", &AntiTop_Pt, "Pt des AntiTops Generator/D");
outTree->Branch("AntiTop_M", &AntiTop_M, "M des AntiTops Generator/D");
outTree->Branch("RekoTop_Pt", &RekoTop_Pt, "Pt des Tops Reko/D");
outTree->Branch("RekoAntiTop_Pt", &RekoAntiTop_Pt, "Pt des AntiTops Reko/D");
outTree->Branch("RekoTop_M", &RekoTop_M, "M des Tops Reko/D");
outTree->Branch("RekoAntiTop_M", &RekoAntiTop_M, "M des AntiTops Reko/D");
outTree->Branch("Nu_Px", &Nu_Px, "Px des Neutrinos Generator/D");
outTree->Branch("Nu_Py", &Nu_Py, "Py des Neutrinos Generator/D");
outTree->Branch("Nu_Pz", &Nu_Pz, "Pz des Neutrinos Generator/D");
outTree->Branch("AntiNu_Px", &AntiNu_Px, "Px des AntiNeutrinos Generator/D");
outTree->Branch("AntiNu_Py", &AntiNu_Py, "Py des AntiNeutrinos Generator/D");
outTree->Branch("AntiNu_Pz", &AntiNu_Pz, "Pz des AntiNeutrinos Generator/D");
outTree->Branch("RekoNu_Px", &RekoNu_Px, "Px des Neutrinos Reko/D");
//.........这里部分代码省略.........
示例4: fit
bool leptonic_fitter_algebraic::fit( const TLorentzVector& B, const TH1& BITF, const TF1& Beff,
const TLorentzVector& lep,
double MEX, double MEY, const TF1& dnuPDF )
{
if( _dbg > 19 ) cout<<"DBG20 Entered leptonic_fitter_algebraic::fit with B mass: "<<B.M()<<", l_m:"<<lep.M()<<", MET: "<<MEX<<" "<<MEY<<endl;
if( B.M() <= 0 ) throw std::runtime_error( "leptonic_fitter_algebraic was given a b-jet with an illegal (non-positive) mass!");
if( lep.M() < 0 ) throw std::runtime_error( "leptonic_fitter_algebraic was given a lepton with an illegal (negative) mass!");
_converged = _swapped = false;
_obsB = B;
_obsL = lep;
_BITF = &BITF;
_Beff = &Beff;
_dnuPDF = dnuPDF;
_b_m2 = B.M2();
double lep_b_angle = lep.Angle( B.Vect() );
double cos_lep_b = TMath::Cos( lep_b_angle );
double sin_lep_b = TMath::Sin( lep_b_angle );
double b_p = B.P();
double b_e = B.E();
_denom = b_e - cos_lep_b * b_p;
_lep_p = lep.P();
_x0 = - _W_m2 / ( 2 * _lep_p );
_y1 = - sin_lep_b * _x0 * b_p / _denom;
_x1_0 = _x0 * b_e / _denom - _y1*_y1 / _x0;
_Z2_0 = _x0*_x0 - _W_m2 - _y1*_y1;
if( _dbg > 219 ) cout<<"DBG220 lfa updated lepton with: "<<lv2str( lep )<<" -> x0:"<<_x0<<", y1: "<<_y1<<", x1_0: "<<_x1_0<<", Z2_0: "<<_Z2_0<<endl;
static double bnums[3];
bnums[0] = B.X();
bnums[1] = B.Y();
bnums[2] = B.Z();
TMatrixD bXYZ( 3, 1, bnums );
_R_T = rotation( 2, lep.Phi() ); // R_z^T
_R_T *= rotation( 1, lep.Theta() - 0.5*TMath::Pi() ); // R_z^T R_y^T
TMatrixD rotation_vect( _R_T, TMatrixD::kTransposeMult, bXYZ ); // R_y R_z
double* rotation_array = rotation_vect.GetMatrixArray();
double phi_x = - TMath::ATan2( rotation_array[2], rotation_array[1] );
if( _dbg > 99 ) cout<<"DBG100 lfa x rotation vector is:"<<rotation_array[0]<<" "<<rotation_array[1]<<" "<<rotation_array[2]<<" -> phi_x:"<<phi_x<<endl;
_R_T *= rotation( 0, - phi_x ); // R_z^T R_y^T R_x^T
// set up _Nu's non-zero elements so that \vec{nu} = Nu \vec{t} for any \vec{t} (since only t's 3nd component is used, and its always 1).
_Nu[0][2] = MEX;
_Nu[1][2] = MEY;
double iVarMET = TMath::Power( TMath::Max( 1., dnuPDF.GetHistogram()->GetRMS() ), -2 );
_invFlatVar[0][0] = _invFlatVar[1][1] = iVarMET; // set up the chi^2 distance with the right order of magnitude (generalizes to rotated covariance matrix)
if( _dbg > 209 ) cout<<"DBG210 lfa "<<dnuPDF.GetName()<<" --> iVarMET:"<<iVarMET<<endl;
// (re)define fit parameter, so all fits start off on an equal footing
_mini->SetPrintLevel( _minimizer_print_level );
_mini->Clear();
_mini->SetFunction( _functor );
leptonic_fitter_algebraic_object = this; // set the function in the functor pointing back to this object. Doubtfull that all this redirection is needed...
_mini->SetTolerance( _tolerance );
bool OK = _mini->SetLimitedVariable( 0, "sB", 1.0, 0.4, 0.1, 6.0 );
//bool OK = _mini->SetVariable( 0, "sB", 1.0, 0.4 );
if( ! OK ) {cerr<<"minimizer (@lfa) failed to SetVariable."<<endl; return false;}
// define 1 sigma in terms of the function
_mini->SetErrorDef( 0.5 ); // since this is a likelihood fit
// do the minimization
OK = _mini->Minimize();
if( _dbg > 19 && ( ! OK || _dbg > 59 ) ) cout<<"DBG INFO: initial fit @lfa returned OK: "<<OK<<", has status: "<<_mini->Status()<<endl;
_converged = OK; // use status somehow? depends on fitter?
// read parameters
const double *xs = _mini->X();
for( int ip = 0; ip < 1; ++ip ) _params[ ip ] = xs[ ip ];
// return all intermediate results to the minimum, in particular, the discriminant
calc_MLL( _params, true );
TMatrixD nu_vec( _Emat, TMatrixD::kMult, _tvec );
update_nu_and_decay_chain( nu_vec );
if( _dbg > 203 ) cout<<"DBG204 lfa finalized _genN: "<<lv2str(_genN)<<", _W: "<<lv2str(_W)<<", & _t: "<<lv2str(_T)<<endl;
_MLL = _mini->MinValue();
return true;
}