How do I boost momentum in center of mass frame from lab frame?

Dear Rooters,
I have momentum in lab frame and I want to boost them in the center of mass frame. Could you please correct my code or add few lines in it. Following is my code where momentum is in lab frame.

void lab_missmass()
     {
TFile* f1 = new TFile("/home/souvik/belle2/lab_missmass.root");
TTree* t1=(TTree*)f1->Get("ke");
Double_t p1x,p1y,p1z,E1 ;

t1->SetBranchAddress("daughter__bo0__cmpx__bc", &p1x);
 t1->SetBranchAddress("daughter__bo0__cmpy__bc", &p1y);
 t1->SetBranchAddress("daughter__bo0__cmpz__bc", &p1z);
 t1->SetBranchAddress("daughter__bo0__cmE__bc", &E1);

TH1F *hist1 = new TH1F("", "", 50, 0, 10);
 for (Int_t i = 0; i < t1->GetEntries(); ++i)
   {
     t1->GetEntry(i);
     {
TLorentzVector v1(p1x,p1y,p1z,E1);
hist1->Fill(v.Mag());
 }
   }
 TCanvas* c1 = new TCanvas();
 c1->cd();
 hist1->GetXaxis()->SetTitle("D_{s} mass in GeV/c^{2}");
 //hist1->GetXaxis()->SetTitle("#Delta M GeV/c^{2}");                           
 hist1->SetLineColor(2);
 hist1->SetLineWidth(2);
 hist1->Draw();
}

Thanks in Advance


ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided


Documentation for TLorentzVector is here. However, as mentioned there, you should migrate your code to use ROOT::Math::LorentzVector instead.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.