ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided
Hi Everyone,
I have five TLorentzVectors. I want to do the following mathematical operation but sometimes it is giving me plot but sometimes the plot is coming out to be empty. Please check the following code.
mathematical operation is something like this: p1 - p2 -p3 -p4 - p5 - p6.
I use ROOT6.14.
Need help to write it.
“”""""""""""""""""""""""""""""
void lfv2()
{
TFile* f3= new TFile("/home/souvik/root_work/lfv2.root");
TTree* t3=(TTree*)f3->Get("tree");
float pd1[4];
float pd3[4];
float pd4[4];
float pd5[4];
float pd6[4];
t3->SetBranchAddress("Upsilon4S_P4", &pd1);
t3->SetBranchAddress("Upsilon4S_D0_P4", &pd3);
t3->SetBranchAddress("Upsilon4S_pi_P4", &pd4);
t3->SetBranchAddress("Upsilon4S_K_S0_P4", &pd3);
t3->SetBranchAddress("Upsilon4S_gamma_P4", &pd4);
TH1F *hist3 = new TH1F("", "Adding two four momenta ", 50, 1.7, 3.5);
TCanvas* c2 = new TCanvas();
c2->cd();
Int_t n_tot3 = (Int_t)t3->GetEntries();
for (int i=0; i<n_tot3 ;i++)
{
t3->GetEntry(i);
TLorentzVector lv_B_pi0(pd1);
TLorentzVector lv_B_pi1(pd3);
TLorentzVector lv_B_pi2(pd4);
TLorentzVector lv_B_pi3(pd5);
TLorentzVector lv_B_pi4(pd6);
const auto this_mass =(lv_B_pi0- lv_B_pi1-lv_B_pi2-lv_B_pi3-lv_B_pi4).Mag();
{
hist3->Fill(this_mass);
}
}
hist3->Draw();
}
Thanks and Regards