#include #include #include #include "TMyGen.h" void Omega_2018_myclass() { // example of use of TGenPhaseSpace //Author: TH1F *hCosTheta_lab_neutron = new TH1F("CosTheta_lab_neutron","CosTheta_lab_neutron", 30,0.7,1); TH1F *hCosTheta_cm_neutron = new TH1F("CosTheta_cm_neutron","CosTheta_cm_neutron", 30,-1,1); TH1F *hPhi_lab_neutron = new TH1F("Phi_lab_neutron","Phi_lab_neutron", 50,0,180); TH1F *hPhi_cm_neutron = new TH1F("Phi_cm_neutron","Phi_cm_neutron", 50,0,180); TH1F *hTheta_lab_neutron = new TH1F("Theta_lab_neutron","Theta_lab_neutron", 30,0,60); TH1F *hTheta_cm_neutron = new TH1F("Theta_cm_neutron","Theta_cm_neutron", 50,0,180); TH1F *hCosTheta_lab_piplus = new TH1F("CosTheta_lab_piplus","CosTheta_lab_piplus", 30,0.7,1); TH1F *hCosTheta_cm_piplus = new TH1F("CosTheta_cm_piplus","CosTheta_cm_piplus", 30,-1,1); TH1F *hPhi_lab_piplus = new TH1F("Phi_lab_piplus","Phi_lab_piplus", 50,0,180); TH1F *hPhi_cm_piplus = new TH1F("Phi_cm_piplus","Phi_cm_piplus", 50,0,180); TH1F *hTheta_lab_piplus = new TH1F("Theta_lab_piplus","Theta_lab_piplus", 100,0,180); TH1F *hTheta_cm_piplus = new TH1F("Theta_cm_piplus","Theta_cm_piplus", 50,0,180); TH1F *hCosTheta_lab_piminus = new TH1F("CosTheta_lab_piminus","CosTheta_lab_piminus", 30,0.7,1); TH1F *hCosTheta_cm_piminus = new TH1F("CosTheta_cm_piminus","CosTheta2", 30,-1,1); TH1F *hPhi_lab_piminus = new TH1F("Phi_lab_piminus","Phi_lab_piminus", 50,0,180); TH1F *hPhi_cm_piminus = new TH1F("Phi_cm_piminus","Phi_cm_piminus", 50,0,180); TH1F *hTheta_lab_piminus = new TH1F("Theta_lab_piminus","Theta_lab_piminus", 100,0,180); TH1F *hTheta_cm_piminus = new TH1F("Theta_cm_piminus","Theta_cm_piminus", 50,0,180); TH1F *hCosTheta_lab_pizero = new TH1F("CosTheta_lab_pizero","CosTheta_lab_pizero", 30,0.7,1); TH1F *hCosTheta_cm_pizero = new TH1F("CosTheta_cm_pizero","CosTheta2", 30,-1,1); TH1F *hPhi_lab_pizero = new TH1F("Phi_lab_pizero","Phi_lab_pizero", 50,0,180); TH1F *hPhi_cm_pizero = new TH1F("Phi_cm_pizero","Phi_cm_pizero", 50,0,180); TH1F *hTheta_lab_pizero = new TH1F("Theta_lab_pizero","Theta_lab_pizero", 100,0,180); TH1F *hTheta_cm_pizero = new TH1F("Theta_cm_pizero","Theta_cm_pizero", 50,0,180); TH1F *hCosTheta_lab_photon1 = new TH1F("CosTheta_lab_photon1","CosTheta_lab_photon1", 30,0,1); TH1F *hCosTheta_cm_photon1 = new TH1F("CosTheta_cm_photon1","CosTheta_cm_photon1", 30,-1,1); TH1F *hPhi_lab_photon1 = new TH1F("Phi_lab_photon1","Phi_lab_photon1", 50,0,180); TH1F *hPhi_cm_photon1 = new TH1F("Phi_cm_photon1","Phi_cm_photon1", 50,0,180); TH1F *hTheta_lab_photon1 = new TH1F("Theta_lab_photon1","Theta_lab_photon1", 100,0,180); TH1F *hTheta_cm_photon1 = new TH1F("Theta_cm_photon1","Theta_cm_photon1", 50,0,180); TH1F *hCosTheta_lab_phot2 = new TH1F("CosTheta_lab_phot2","CosTheta_lab_phot2", 30,0,1); TH1F *hCosTheta_cm_phot2 = new TH1F("CosTheta_cm_phot2","CosTheta_cm_phot2", 30,-1,1); TH1F *hPhi_lab_phot2 = new TH1F("Phi_lab_phot2","Phi_lab_phot2", 50,0,180); TH1F *hPhi_cm_phot2 = new TH1F("Phi_cm_phot2","Phi_cm_phot2", 50,0,180); TH1F *hTheta_lab_phot2 = new TH1F("Theta_lab_phot2","Theta_lab_phot2", 100,0,180); TH1F *hTheta_cm_phot2 = new TH1F("Theta_cm_phot2","Theta_cm_phot2", 50,0,180); //TH1F *hCosThetaomega = new TH1F("CosThetaomega","CosThetaomega", 50,0.6,1); //TH1F *hCosTheta2omega = new TH1F("CosTheta2omega","CosTheta2omega", 50,-1,1); //TH1F *hPhiomega = new TH1F("Phiomega","Phiomega", 50,0,180); //TH1F *hPhi2omega = new TH1F("Phi2omega","Phi2omega", 50,0,180); //TH1F *hThetaomega = new TH1F("Thetaomega","Thetaomega", 50,0,180); //TH1F *hTheta2omega = new TH1F("Theta2omega","Theta2omega", 50,0,180); //TH2F *h2 = new TH2F("h2","h2", 50,1.1,1.8, 50,1.1,1.8); //TH1F *h1 = new TH1F("h1", "h1", 2000, -1, 1); //TH1F *h1 = new TH1F("h1", "h1", 2000, 0, 180); //TH1F *hCOM = new TH1F("hCOM", "hCOM", 2000, 0, 2); if (!gROOT->GetClass("TMyGen")) gSystem->Load("libPhysics"); Double_t Egamma=2.3; TLorentzVector target(0.0, 0.0, 0.0, 0.938);//assuming just a neutron at rest TLorentzVector beam(0.0, 0.0, Egamma, Egamma); TLorentzVector W = beam + target; //Double_t thetaNeutron, phiNeutron, thetaOmega, phiOmega, CoMthetaNeutron; //Double_t bx=0,by=0,bz=Egamma/(Egamma+0.940); //TVector3 BCM(bx,by,bz); //BCM=W.BoostVector(); //comp[100]; //(Momentum, Energy units are Gev/C, GeV) Double_t masses[2] = { 0.783, 0.938} ; Double_t masses1[3] = { 0.139,0.139, 0.135} ; Double_t masses2[2] = { 0.0,0.0} ; TMyGen event,event1, event2; event.SetDecay(W, 2, masses); for (Int_t n=0;n<1000000;n++) { Double_t weight = event.Generate(); TLorentzVector *fourpNeutron = event.GetDecay(1); TLorentzVector *fourpomega = event.GetDecay(0); event1.SetDecay(*fourpomega, 3, masses1); Double_t weight1 = event1.Generate(); TLorentzVector *fourppip = event1.GetDecay(0); TLorentzVector *fourppim = event1.GetDecay(1); TLorentzVector *fourppizero = event1.GetDecay(2); event2.SetDecay(*fourppizero, 2, masses2); Double_t weight2 = event2.Generate(); TLorentzVector *fourpgamma1 = event2.GetDecay(0); TLorentzVector *fourpphot2 = event2.GetDecay(1); /******************************Neutron*************************************************/ hCosTheta_lab_neutron->Fill(fourpNeutron->CosTheta(), weight); //lab frame hPhi_lab_neutron->Fill(fourpNeutron->Phi()*180/3.1416, weight); hTheta_lab_neutron->Fill(fourpNeutron->Theta()*180/3.1416, weight); //hCosThetaomega->Fill(fourpkm->CosTheta(), weight); //lab frame omega //hPhiomega->Fill(fourpkm->Phi()*180/3.1416, weight); //hThetaomega->Fill(fourpkm->Theta()*180/3.1416, weight); /*******************************Photon1*****************************************************/ hCosTheta_lab_photon1->Fill(fourpgamma1->CosTheta(), weight2); //lab frame hPhi_lab_photon1->Fill(fourpgamma1->Phi()*180/3.1416, weight2); hTheta_lab_photon1->Fill(fourpgamma1->Theta()*180/3.1416, weight2); //hCosThetaomega->Fill(fourpkm->CosTheta(), weight1); //lab frame omega //hPhiomega->Fill(fourpkm->Phi()*180/3.1416, weight1); //hThetaomega->Fill(fourpkm->Theta()*180/3.1416, weight1); //fourpNeutron->Boost(-W.BoostVector()); //fourpomega->Boost(-W.BoostVector()); //TVector3 pNeutron = fourpNeutron->Vect(); //TVector3 pomega = fourpomega->Vect(); //Double_t dottest = pomega.Dot(pNeutron); //TVector3 CoMpNeutron = CoMfourpNeutron.Vect(); //thetaNeutron = (pNeutron.Theta())*180/3.1416; //thetaNeutron = (pNeutron.Theta()); //CoMthetaNeutron = CoMpNeutron.Theta(); //TLorentzVector *pPim = event.GetDecay(2); //TLorentzVector pfinal = *pProton + *pomega; //TLorentzVector pPPim = *pProton + *pPim; // hCOM->Fill(CoMthetaNeutron ,weight); //h2->Fill(pPPip.M2() ,pPPim.M2() ,weight); //hdot->Fill(dottest); hCosTheta_lab_phot2->Fill(fourpphot2->CosTheta(), weight2); hPhi_lab_phot2->Fill(fourpphot2->Phi()*180/3.1416, weight2); hTheta_lab_phot2->Fill(fourpphot2->Theta()*180/3.1416, weight2); //hCosTheta2omega->Fill(fourpomega->CosTheta(), weight); //hPhi2omega->Fill(fourpomega->Phi()*180/3.1416, weight); // hTheta2omega->Fill(fourpomega->Theta()*180/3.1416, weight); /************************* pions ******************************************/ hPhi_lab_piplus->Fill(fourppip->Phi()*180/3.1416, weight1); hPhi_lab_piminus->Fill(fourppim->Phi()*180/3.1416, weight1); hPhi_lab_pizero->Fill(fourppizero->Phi()*180/3.1416, weight1); hCosTheta_lab_piplus->Fill(fourppip->CosTheta(), weight1); hCosTheta_lab_piminus->Fill(fourppim->CosTheta(), weight1); hCosTheta_lab_pizero->Fill(fourppizero->CosTheta(), weight1); } // Set up Cavnas TCanvas *b = new TCanvas("fits","fits",1000,1000); //define canvas for monitoring b->Divide(3,3); //TCanvas *c[12]; // CosTheta b->cd(1); //c[0] = new TCanvas("c1","Cosine Theta of the Neutron in the Lab Frame",800,800); hCosTheta_lab_neutron->GetXaxis()->SetTitle("Cosine Theta"); hCosTheta_lab_neutron->GetYaxis()->SetTitle("Events"); hCosTheta_lab_neutron->GetXaxis()->SetLabelSize(0.03); hCosTheta_lab_neutron->GetYaxis()->SetLabelSize(0.03); hCosTheta_lab_neutron->GetXaxis()->SetTitleOffset(1.1); hCosTheta_lab_neutron->GetYaxis()->SetTitleOffset(1.4); hCosTheta_lab_neutron->DrawCopy(); // Phi b->cd(2); //c[1] = new TCanvas("c2","Phi of the Neutron in the Lab Frame",800,800); hPhi_lab_neutron->GetXaxis()->SetTitle("Phi"); hPhi_lab_neutron->GetYaxis()->SetTitle("Events"); hPhi_lab_neutron->GetXaxis()->SetLabelSize(0.03); hPhi_lab_neutron->GetYaxis()->SetLabelSize(0.03); hPhi_lab_neutron->GetXaxis()->SetTitleOffset(1.1); hPhi_lab_neutron->GetYaxis()->SetTitleOffset(1.4); hPhi_lab_neutron->DrawCopy(); // Theta b->cd(3); //c[2] = new TCanvas("c3","Theta of the Neutron in the Lab Frame",800,800); hTheta_lab_neutron->GetXaxis()->SetTitle("Theta"); hTheta_lab_neutron->GetYaxis()->SetTitle("Events"); hTheta_lab_neutron->GetXaxis()->SetLabelSize(0.03); hTheta_lab_neutron->GetYaxis()->SetLabelSize(0.03); hTheta_lab_neutron->GetXaxis()->SetTitleOffset(1.1); hTheta_lab_neutron->GetYaxis()->SetTitleOffset(1.4); hTheta_lab_neutron->DrawCopy(); // CosTheta b->cd(4); //c[3] = new TCanvas("c4","Cosine Theta of the photon1 in the Lab Frame",800,800); hCosTheta_lab_photon1->GetXaxis()->SetTitle("Cosine Theta"); hCosTheta_lab_photon1->GetYaxis()->SetTitle("Events"); hCosTheta_lab_photon1->GetXaxis()->SetLabelSize(0.03); hCosTheta_lab_photon1->GetYaxis()->SetLabelSize(0.03); hCosTheta_lab_photon1->GetXaxis()->SetTitleOffset(1.1); hCosTheta_lab_photon1->GetYaxis()->SetTitleOffset(1.4); hCosTheta_lab_photon1->DrawCopy(); // Phi b->cd(5); //c[4] = new TCanvas("c5","Phi of the photon1 in the Lab Frame",800,800); hPhi_lab_photon1->GetXaxis()->SetTitle("Phi"); hPhi_lab_photon1->GetYaxis()->SetTitle("Events"); hPhi_lab_photon1->GetXaxis()->SetLabelSize(0.03); hPhi_lab_photon1->GetYaxis()->SetLabelSize(0.03); hPhi_lab_photon1->GetXaxis()->SetTitleOffset(1.1); hPhi_lab_photon1->GetYaxis()->SetTitleOffset(1.4); hPhi_lab_photon1->DrawCopy(); // Theta b->cd(6); //c[5] = new TCanvas("c6","Theta of the photon1 in the Lab Frame",800,800); hTheta_lab_photon1->GetXaxis()->SetTitle("Theta"); hTheta_lab_photon1->GetYaxis()->SetTitle("Events"); hTheta_lab_photon1->GetXaxis()->SetLabelSize(0.03); hTheta_lab_photon1->GetYaxis()->SetLabelSize(0.03); hTheta_lab_photon1->GetXaxis()->SetTitleOffset(1.1); hTheta_lab_photon1->GetYaxis()->SetTitleOffset(1.4); hTheta_lab_photon1->DrawCopy(); // CosTheta b->cd(7); //c[6] = new TCanvas("c7","Cosine Theta of the Neutron in the Lab Frame",800,800); hCosTheta_lab_phot2->GetXaxis()->SetTitle("Cosine Theta"); hCosTheta_lab_phot2->GetYaxis()->SetTitle("Events"); hCosTheta_lab_phot2->GetXaxis()->SetLabelSize(0.03); hCosTheta_lab_phot2->GetYaxis()->SetLabelSize(0.03); hCosTheta_lab_phot2->GetXaxis()->SetTitleOffset(1.1); hCosTheta_lab_phot2->GetYaxis()->SetTitleOffset(1.4); hCosTheta_lab_phot2->DrawCopy(); // Phi b->cd(8); //c[7] = new TCanvas("c8","Phi of the Neutron in the Lab Frame",800,800); hPhi_lab_phot2->GetXaxis()->SetTitle("Phi"); hPhi_lab_phot2->GetYaxis()->SetTitle("Events"); hPhi_lab_phot2->GetXaxis()->SetLabelSize(0.03); hPhi_lab_phot2->GetYaxis()->SetLabelSize(0.03); hPhi_lab_phot2->GetXaxis()->SetTitleOffset(1.1); hPhi_lab_phot2->GetYaxis()->SetTitleOffset(1.4); hPhi_lab_phot2->DrawCopy(); // Theta b->cd(9); //c[8] = new TCanvas("c9","Theta of the Neutron in the Lab Frame",800,800); hTheta_lab_phot2->GetXaxis()->SetTitle("Theta"); hTheta_lab_phot2->GetYaxis()->SetTitle("Events"); hTheta_lab_phot2->GetXaxis()->SetLabelSize(0.03); hTheta_lab_phot2->GetYaxis()->SetLabelSize(0.03); hTheta_lab_phot2->GetXaxis()->SetTitleOffset(1.1); hTheta_lab_phot2->GetYaxis()->SetTitleOffset(1.4); hTheta_lab_phot2->DrawCopy(); /* // CosTheta in CM omega c[10] = new TCanvas("c11","Cosine Theta of the Omega in the CM Frame",800,800); hCosTheta2omega->GetXaxis()->SetTitle("Cosine Theta"); hCosTheta2omega->GetYaxis()->SetTitle("Events"); hCosTheta2omega->GetXaxis()->SetLabelSize(0.03); hCosTheta2omega->GetYaxis()->SetLabelSize(0.03); hCosTheta2omega->GetXaxis()->SetTitleOffset(1.1); hCosTheta2omega->GetYaxis()->SetTitleOffset(1.4); hCosTheta2omega->DrawCopy(); // Phi in CM omega c[11] = new TCanvas("c12","Phi of the Omega in the CM Frame",800,800); hPhi2omega->GetXaxis()->SetTitle("Phi"); hPhi2omega->GetYaxis()->SetTitle("Events"); hPhi2omega->GetXaxis()->SetLabelSize(0.03); hPhi2omega->GetYaxis()->SetLabelSize(0.03); hPhi2omega->GetXaxis()->SetTitleOffset(1.1); hPhi2omega->GetYaxis()->SetTitleOffset(1.4); hPhi2omega->DrawCopy(); // Theta in CM omega c[12] = new TCanvas("c13","Theta of the Omega in the CM Frame",800,800); hTheta2omega->GetXaxis()->SetTitle("Theta"); hTheta2omega->GetYaxis()->SetTitle("Events"); hTheta2omega->GetXaxis()->SetLabelSize(0.03); hTheta2omega->GetYaxis()->SetLabelSize(0.03); hTheta2omega->GetXaxis()->SetTitleOffset(1.1); hTheta2omega->GetYaxis()->SetTitleOffset(1.4); hTheta2omega->DrawCopy();*/ TCanvas *d = new TCanvas("fits2","fits2",1000,1000); //define canvas for monitoring d->Divide(3,2); d->cd(1); hPhi_lab_piplus->GetXaxis()->SetTitle("Phi"); hPhi_lab_piplus->GetYaxis()->SetTitle("Events"); hPhi_lab_piplus->GetXaxis()->SetLabelSize(0.03); hPhi_lab_piplus->GetYaxis()->SetLabelSize(0.03); hPhi_lab_piplus->GetXaxis()->SetTitleOffset(1.1); hPhi_lab_piplus->GetYaxis()->SetTitleOffset(1.4); hPhi_lab_piplus->DrawCopy(); d->cd(2); hPhi_lab_piminus->GetXaxis()->SetTitle("Phi"); hPhi_lab_piminus->GetYaxis()->SetTitle("Events"); hPhi_lab_piminus->GetXaxis()->SetLabelSize(0.03); hPhi_lab_piminus->GetYaxis()->SetLabelSize(0.03); hPhi_lab_piminus->GetXaxis()->SetTitleOffset(1.1); hPhi_lab_piminus->GetYaxis()->SetTitleOffset(1.4); hPhi_lab_piminus->DrawCopy(); d->cd(3); hPhi_lab_pizero->GetXaxis()->SetTitle("Phi"); hPhi_lab_pizero->GetYaxis()->SetTitle("Events"); hPhi_lab_pizero->GetXaxis()->SetLabelSize(0.03); hPhi_lab_pizero->GetYaxis()->SetLabelSize(0.03); hPhi_lab_pizero->GetXaxis()->SetTitleOffset(1.1); hPhi_lab_pizero->GetYaxis()->SetTitleOffset(1.4); hPhi_lab_pizero->DrawCopy(); d->cd(4); hCosTheta_lab_piplus->GetXaxis()->SetTitle("Cosine Theta"); hCosTheta_lab_piplus->GetYaxis()->SetTitle("Events"); hCosTheta_lab_piplus->GetXaxis()->SetLabelSize(0.03); hCosTheta_lab_piplus->GetYaxis()->SetLabelSize(0.03); hCosTheta_lab_piplus->GetXaxis()->SetTitleOffset(1.1); hCosTheta_lab_piplus->GetYaxis()->SetTitleOffset(1.4); hCosTheta_lab_piplus->DrawCopy(); d->cd(5); hCosTheta_lab_piminus->GetXaxis()->SetTitle("Cosine Theta"); hCosTheta_lab_piminus->GetYaxis()->SetTitle("Events"); hCosTheta_lab_piminus->GetXaxis()->SetLabelSize(0.03); hCosTheta_lab_piminus->GetYaxis()->SetLabelSize(0.03); hCosTheta_lab_piminus->GetXaxis()->SetTitleOffset(1.1); hCosTheta_lab_piminus->GetYaxis()->SetTitleOffset(1.4); hCosTheta_lab_piminus->DrawCopy(); d->cd(6); hCosTheta_lab_pizero->GetXaxis()->SetTitle("Cosine Theta"); hCosTheta_lab_pizero->GetYaxis()->SetTitle("Events"); hCosTheta_lab_pizero->GetXaxis()->SetLabelSize(0.03); hCosTheta_lab_pizero->GetYaxis()->SetLabelSize(0.03); hCosTheta_lab_pizero->GetXaxis()->SetTitleOffset(1.1); hCosTheta_lab_pizero->GetYaxis()->SetTitleOffset(1.4); hCosTheta_lab_pizero->DrawCopy(); }