#define dose3_cxx #include "dose3.h" #include #include #include void dose3::Loop() { // In a ROOT session, you can do: // root> .L dose3.C // root> dose3 t // root> t.GetEntry(12); // Fill t data members with entry number 12 // root> t.Show(); // Show values of entry 12 // root> t.Show(16); // Read and show values of entry 16 // root> t.Loop(); // Loop on all entries // // This is the loop skeleton where: // jentry is the global entry number in the chain // ientry is the entry number in the current Tree // Note that the argument to GetEntry must be: // jentry for TChain::GetEntry // ientry for TTree::GetEntry and TBranch::GetEntry // // To read only selected branches, Insert statements like: // METHOD1: // fChain->SetBranchStatus("*",0); // disable all branches // fChain->SetBranchStatus("branchname",1); // activate branchname // METHOD2: replace line // fChain->GetEntry(jentry); //read all branches //by b_branchname->GetEntry(ientry); //read only this branch if (fChain == 0) return; int nbins = 2000; gStyle->SetOptStat(1111); gStyle->SetPalette(57); TCanvas *can = new TCanvas("can","can",900,700); // control TCanvas *can1 = new TCanvas("can1","can1",900,700); //Ag /*TCanvas *can2 = new TCanvas("can2","can2",900,700); //I TCanvas *can3 = new TCanvas("can3","can3",900,700); //air TCanvas *can4 = new TCanvas("can4","can4",900,700); //Ti TCanvas *can5 = new TCanvas("can5","can5",900,700); //world */ can->SetFrameBorderMode(1); can->SetLeftMargin(0.01); can1->SetFrameBorderMode(1); can1->SetLeftMargin(0.01); /*can2->SetFrameBorderMode(1); can2->SetLeftMargin(0.01); can3->SetFrameBorderMode(1); can3->SetLeftMargin(0.01); can4->SetFrameBorderMode(1); can4->SetLeftMargin(0.01); can5->SetFrameBorderMode(1); can5->SetLeftMargin(0.01);//*/ //bins more than 800 doesn't work to TH3F // can TH2F *ana= new TH2F("ana","ana", nbins, 0.0,0.0455, nbins, 0.0,23.0); TH2F *ana1 = new TH2F("ana1","ana1",nbins, 0.0,0.0455, nbins, 0.0,23.0); //can1 TH2F *ana2 = new TH2F("ana2","ana2",nbins, 0.0,0.0455, nbins, 0.0,1850.0); TH2F *ana3 = new TH2F("ana3","ana3",nbins, 0.0,0.0455, nbins, 0.0,1850.0); // can1 /*TH2F *ana4= new TH2F("ana4","ana4", nbins, 0.0,0.0455, nbins, 0.0,0.5); TH2F *ana5 = new TH2F("ana5","ana5",nbins, 0.0,0.0455, nbins, 0.0,0.5); TProfile2D *ana6 = new TProfile2D("anaPos","anaPos",nbins, -1.0,1.0, nbins, -1.0,1.0); TProfile2D *ana7 = new TProfile2D("anaPos","anaPos",nbins, -1.0,1.0, nbins, -1.0,1.0);//*/ // can2 /*TH2F *ana8= new TH2F("ana8","ana8", nbins, 0.0,0.0455, nbins, 0.0,0.5); TH2F *ana9 = new TH2F("ana9","ana9",nbins, 0.0,0.0455, nbins, 0.0,0.5); TProfile2D *ana10 = new TProfile2D("anaPos","anaPos",nbins, -1.0,1.0, nbins, -1.0,1.0); TProfile2D *ana11 = new TProfile2D("anaPos","anaPos",nbins, -1.0,1.0, nbins, -1.0,1.0);//*/ // can3 /*TH2F *ana12= new TH2F("ana12","ana12", nbins, 0.0,0.0455, nbins, 0.0,0.5); TH2F *ana13 = new TH2F("ana13","ana13",nbins, 0.0,0.0455, nbins, 0.0,0.5); TProfile2D *ana14 = new TProfile2D("anaPos","anaPos",nbins, -1.0,1.0, nbins, -1.0,1.0); TProfile2D *ana15 = new TProfile2D("anaPos","anaPos",nbins, -1.0,1.0, nbins, -1.0,1.0);//*/ // can4 /*TH2F *ana16= new TH2F("ana16","ana16", nbins, 0.0,0.0455, nbins, 0.0,0.45); TH2F *ana17 = new TH2F("ana17","ana17",nbins, 0.0,0.0455, nbins, 0.0,0.45); TProfile2D *ana18 = new TProfile2D("anaPos","anaPos",nbins, -1.0,1.0, nbins, -1.0,1.0); TProfile2D *ana19 = new TProfile2D("anaPos","anaPos",nbins, -1.0,1.0, nbins, -1.0,1.0);//*/ // can5 /*TH2F *ana20= new TH2F("ana20","ana20", nbins, 0.0,0.0455, nbins, 0.0,1850.0); TH2F *ana21 = new TH2F("ana21","ana21",nbins, 0.0,0.0455, nbins, 0.0,1850.0); TProfile2D *ana22 = new TProfile2D("anaPos","anaPos",nbins, -1.0,1.0, nbins, -1.0,1.0); TProfile2D *ana23 = new TProfile2D("anaPos","anaPos",nbins, -1.0,1.0, nbins, -1.0,1.0);//*/ can->Divide(2,2); can1->Divide(2,2); /*can2->Divide(2,2); can3->Divide(2,2); can4->Divide(2,2); can5->Divide(2,2);//*/ can->cd(1);//*/ can1->cd(1);//*/ //can2->cd(1);//*/ //can3->cd(1);//*/ //can4->cd(1);//*/ //can5->cd(1);//*/ Long64_t nentries = fChain->GetEntries(); //para 25000 event => 202287 steps, deu 209435 1997243 //Long64_t nentries = fChain->GetEntriesFast(); for (Long64_t jentry=674890; jentryGetEntry(jentry); nbytes += nb; // if (Cut(ientry) < 0) continue; cout<<"size total = " <at(cont),2)+pow(Step_FinalPosY->at(cont),2)+pow(Step_FinalPosZ->at(cont),2))>=0.40)&&((TMath::Sqrt(pow(Step_FinalPosX->at(cont),2)+pow(Step_FinalPosY->at(cont),2)+pow(Step_FinalPosZ->at(cont),2)))<22.))){mm2++; if(Step_Particle->at(cont) == "gamma"){gg++;} else{ if(Step_Particle->at(cont) == "e-"){ee++;} } for(Int_t l=0;lsize()-1;l++){mm8++; if((Step_AccumulatedEnergyDeposited->at(l)>0)&&((TMath::Sqrt(pow(Step_FinalPosX->at(l),2)+pow(Step_FinalPosY->at(l),2)+pow(Step_FinalPosZ->at(l),2))>=0.40)&&((TMath::Sqrt(pow(Step_FinalPosX->at(l),2)+pow(Step_FinalPosY->at(l),2)+pow(Step_FinalPosZ->at(l),2)))<22.))){mm9++; ekin = ekin + Step_FinalKineticEnergy->at(l); edep = edep + Step_AccumulatedEnergyDeposited->at(l); dose = dose + Step_AccumulatedDose->at(l); /*cout<<"edep = "<at(l)<at(cont)=="compt")&& ana3->Fill(Step_FinalPosY->at(cont), Step_FinalPosZ->at(cont), Step_AccumulatedEnergyDeposited->at(cont)); //*/ /*if(somaTotal==0.03549){mm23++; cout<<"sumDep events= "<at(cont)=="NIST_Air")&&((TMath::Sqrt(pow(Step_FinalPosX->at(cont),2)+pow(Step_FinalPosY->at(cont),2)+pow(Step_FinalPosZ->at(cont),2))>=22.)&&((TMath::Sqrt(pow(Step_FinalPosX->at(cont),2)+pow(Step_FinalPosY->at(cont),2)+pow(Step_FinalPosZ->at(cont),2))<1838.)))){mm7++; if(Step_Particle->at(cont) == "gamma"){gg1++;} else{ if(Step_Particle->at(cont) == "e-"){ee1++;} } for(Int_t l=0;lsize();l++){mm18++; if((Step_AccumulatedEnergyDeposited->at(l)>0)&&(TMath::Sqrt(pow(Step_FinalPosX->at(l),2)+pow(Step_FinalPosY->at(l),2)+pow(Step_FinalPosZ->at(l),2))>=22.)&&((TMath::Sqrt(pow(Step_FinalPosX->at(l),2)+pow(Step_FinalPosY->at(l),2)+pow(Step_FinalPosZ->at(l),2))<1838))){mm19++; edepWor = edepWor + Step_AccumulatedEnergyDeposited->at(l); ana2->Fill(edepWor,TMath::Sqrt(pow(Step_FinalPosX->at(l),2)+pow(Step_FinalPosY->at(l),2)+pow(Step_FinalPosZ->at(l),2))); } } sumDepWor=edepWor; somaTotalWor=somaTotalWor+sumDepWor; somaTotalWor1=somaTotalWor; ana3->Fill(somaTotalWor,TMath::Sqrt(pow(Step_FinalPosX->at(cont),2)+pow(Step_FinalPosY->at(cont),2)+pow(Step_FinalPosZ->at(cont),2))); //((Step_FinalProcess->at(cont)=="msc")&&(Step_CreatorProcess->at(cont)=="phot")&& /*ana6->Fill(Step_FinalPosX->at(cont), Step_FinalPosZ->at(cont), Step_AccumulatedEnergyDeposited->at(cont)); ana7->Fill(Step_FinalPosY->at(cont), Step_FinalPosZ->at(cont), Step_AccumulatedEnergyDeposited->at(cont)); //*/ /*if((Step_FinalProcess->at(cont)=="eIoni")&&(Step_CreatorProcess->at(cont)=="phot")&&(somaTotalWor==0.03549)){mm23++; cout<<"sumDepWor events= "<size();l++){mm21++; if((Step_AccumulatedEnergyDeposited->at(l)>0)){mm22++;} } } } } cout< SetFillColor(0); gPad->SetLeftMargin(0.1); gPad->SetRightMargin(0.15); ana->GetZaxis()->SetTitleOffset(1.6); //anaPos->GetZaxis()->SetRangeUser(-0.6, 0.6); //gPad->SetLogy(); ana -> Draw("colz"); can->cd(2); //ana -> SetNameTitle("energy", "Edep x distance in to center Control projection; Energy[MeV]; Sqrt(x^2+y^2+z^2) [mm]; Counts"); ana-> SetFillColor(0); gPad->SetLeftMargin(0.1); gPad->SetRightMargin(0.15); ana->GetZaxis()->SetTitleOffset(1.6); //anaPos->GetZaxis()->SetRangeUser(-0.6, 0.6); "energy", "PosX x PosY Ti; PosX [mm]; PosY [mm]; Edep[MeV]" gPad->SetLogy(); ana -> ProjectionX("pjcX")->Draw(); //ana17 -> Draw("colz");//*/ can->cd(3); ana1 -> SetNameTitle("energy", "Ekin x distance in to center Control per event; Energy[MeV]; Sqrt(x^2+y^2+z^2) [mm]; Counts"); ana1-> SetFillColor(0); gPad->SetLeftMargin(0.1); gPad->SetRightMargin(0.15); ana1->GetZaxis()->SetTitleOffset(1.6); //anaPos->GetZaxis()->SetRangeUser(-0.6, 0.6); //gPad->SetLogz(); //gPad->SetLogy(); ana1 -> Draw("colz"); can->cd(4); //ana1 -> SetNameTitle("energy1", "Edep x distance in to center Control per event; Energy[MeV]; Sqrt(x^2+y^2+z^2) [mm]; Counts"); ana1-> SetFillColor(0); gPad->SetLeftMargin(0.1); gPad->SetRightMargin(0.15); ana1->GetZaxis()->SetTitleOffset(1.6); //anaPos->GetZaxis()->SetRangeUser(-0.6, 0.6); "energy", "PosX x PosY Ti; PosX [mm]; PosY [mm]; Edep[MeV]" gPad->SetLogy(); ana1 -> ProjectionX("PROJECTION IN X")->Draw(); //ana17 -> Draw("colz");//*/ ////////////////////////////////***********************************//////////////////////////////////// //can1 can1->cd(1); ana2-> SetNameTitle("energy", "Ekin x distance in to center World STEP; Energy[MeV]; Sqrt(x^2+y^2+z^2) [mm]; Counts"); ana2 -> SetFillColor(0); gPad->SetLeftMargin(0.1); gPad->SetRightMargin(0.15); ana2->GetZaxis()->SetTitleOffset(1.6); //anaPos->GetZaxis()->SetRangeUser(-0.6, 0.6); //gPad->SetLogy(); ana2 -> Draw("colz"); can1->cd(2); //ana4 -> SetNameTitle("energy", "Edep x distance in to center Ag; Energy[MeV]; Sqrt(x^2+y^2+z^2) [mm]; Counts"); ana2-> SetFillColor(0); gPad->SetLeftMargin(0.1); gPad->SetRightMargin(0.15); ana2->GetZaxis()->SetTitleOffset(1.6); //anaPos->GetZaxis()->SetRangeUser(-0.6, 0.6); //gPad->SetLogz(); gPad->SetLogy(); ana2 -> ProjectionX("")->Draw(); //ana4 -> Draw("colz"); can1->cd(3); ana3 -> SetNameTitle("energy", "Ekin x distance in to center World per event; Energy[MeV]; Sqrt(x^2+y^2+z^2) [mm]; Counts"); ana3-> SetFillColor(0); gPad->SetLeftMargin(0.1); gPad->SetRightMargin(0.15); ana3->GetZaxis()->SetTitleOffset(1.6); //gPad->SetLogy(); //anaPos->GetZaxis()->SetRangeUser(-0.6, 0.6); //gPad->SetLogz(); ana3 -> Draw("colz"); can1->cd(4); //ana5 -> SetNameTitle("energy", "Edep x distance in to center Ag per event; Energy[MeV]; Sqrt(x^2+y^2+z^2) [mm]; Counts"); ana3-> SetFillColor(0); gPad->SetLeftMargin(0.1); gPad->SetRightMargin(0.15); ana3->GetZaxis()->SetTitleOffset(1.6); //anaPos->GetZaxis()->SetRangeUser(-0.6, 0.6); //gPad->SetLogz(); gPad->SetLogy(); ana3 -> ProjectionX("projX")->Draw(); //ana5 -> Draw("colz");//*/ //can2 /*can2->cd(1); ana8 -> SetNameTitle("energy", "Edep x distance in to center I STEP; Energy[MeV]; Sqrt(x^2+y^2+z^2) [mm]; Counts"); ana8 -> SetFillColor(0); gPad->SetLeftMargin(0.1); gPad->SetRightMargin(0.15); ana8->GetZaxis()->SetTitleOffset(1.6); //anaPos->GetZaxis()->SetRangeUser(-0.6, 0.6); //gPad->SetLogy(); ana8 -> Draw("colz"); can2->cd(2); //ana8 -> SetNameTitle("energy", "Edep x distance in to center I; Energy[MeV]; Sqrt(x^2+y^2+z^2) [mm]; Counts"); ana8-> SetFillColor(0); gPad->SetLeftMargin(0.1); gPad->SetRightMargin(0.15); ana8->GetZaxis()->SetTitleOffset(1.6); //anaPos->GetZaxis()->SetRangeUser(-0.6, 0.6); //gPad->SetLogz(); gPad->SetLogy(); ana8 -> ProjectionX("projectX")->Draw(); //ana8 -> Draw("colz"); can2->cd(3); ana9 -> SetNameTitle("energy", "Edep x distance in to center I per event; Energy[MeV]; Sqrt(x^2+y^2+z^2) [mm]; Counts"); ana9-> SetFillColor(0); gPad->SetLeftMargin(0.1); gPad->SetRightMargin(0.15); ana9->GetZaxis()->SetTitleOffset(1.6); //anaPos->GetZaxis()->SetRangeUser(-0.6, 0.6); //gPad->SetLogz(); //gPad->SetLogy(); ana9 -> Draw("colz"); can2->cd(4); //ana9 -> SetNameTitle("energy", "Edep x distance in to center I per event; Energy[MeV]; Sqrt(x^2+y^2+z^2) [mm]; Counts"); ana9-> SetFillColor(0); gPad->SetLeftMargin(0.1); gPad->SetRightMargin(0.15); ana9->GetZaxis()->SetTitleOffset(1.6); //anaPos->GetZaxis()->SetRangeUser(-0.6, 0.6); //gPad->SetLogz(); gPad->SetLogy(); ana9 -> ProjectionX("_px")->Draw(); //ana9 -> Draw("colz");//*/ //can3 /*can3->cd(1); ana12 -> SetNameTitle("energy", "Edep x distance in to center Ar STEP; Energy[MeV]; Sqrt(x^2+y^2+z^2) [mm]; Counts"); ana12 -> SetFillColor(0); gPad->SetLeftMargin(0.1); gPad->SetRightMargin(0.15); ana12->GetZaxis()->SetTitleOffset(1.6); //anaPos->GetZaxis()->SetRangeUser(-0.6, 0.6); //gPad->SetLogy(); ana12 -> Draw("colz"); can3->cd(2); //ana12 -> SetNameTitle("energy", "Edep x distance in to center Ar; Energy[MeV]; Sqrt(x^2+y^2+z^2) [mm]; Counts"); ana12-> SetFillColor(0); gPad->SetLeftMargin(0.1); gPad->SetRightMargin(0.15); ana12->GetZaxis()->SetTitleOffset(1.6); //anaPos->GetZaxis()->SetRangeUser(-0.6, 0.6); //gPad->SetLogz(); gPad->SetLogy(); ana12 -> ProjectionX("projecX")->Draw(); //ana12 -> Draw("colz"); can3->cd(3); ana13 -> SetNameTitle("energy", "Edep x distance in to center Ar per event; Energy[MeV]; Sqrt(x^2+y^2+z^2) [mm]; Counts"); ana13-> SetFillColor(0); gPad->SetLeftMargin(0.1); gPad->SetRightMargin(0.15); ana13->GetZaxis()->SetTitleOffset(1.6); //anaPos->GetZaxis()->SetRangeUser(-0.6, 0.6); //gPad->SetLogz(); //gPad->SetLogy(); ana13 -> Draw("colz"); can3->cd(4); //ana13 -> SetNameTitle("energy", "Edep x distance in to center Ar per event; Energy[MeV]; Sqrt(x^2+y^2+z^2) [mm]; Counts"); ana13-> SetFillColor(0); gPad->SetLeftMargin(0.1); gPad->SetRightMargin(0.15); ana13->GetZaxis()->SetTitleOffset(1.6); //anaPos->GetZaxis()->SetRangeUser(-0.6, 0.6); //gPad->SetLogz(); gPad->SetLogy(); ana13 -> ProjectionX("_projX")->Draw(); //ana12 -> Draw("colz");//*/ //can4 /*can4->cd(1); ana16 -> SetNameTitle("energy", "Edep x distance in to center Ti STEP; Energy[MeV]; Sqrt(x^2+y^2+z^2) [mm]; Counts"); ana16 -> SetFillColor(0); gPad->SetLeftMargin(0.1); gPad->SetRightMargin(0.15); ana16->GetZaxis()->SetTitleOffset(1.6); //anaPos->GetZaxis()->SetRangeUser(-0.6, 0.6); //gPad->SetLogy(); ana16 -> Draw("colz"); can4->cd(2); //ana16 -> SetNameTitle("energy", "Edep x distance in to center Ti; Energy[MeV]; Sqrt(x^2+y^2+z^2) [mm]; Counts"); ana16-> SetFillColor(0); gPad->SetLeftMargin(0.1); gPad->SetRightMargin(0.15); ana16->GetZaxis()->SetTitleOffset(1.6); //anaPos->GetZaxis()->SetRangeUser(-0.6, 0.6); "energy", "PosX x PosY Ti; PosX [mm]; PosY [mm]; Edep[MeV]" //gPad->SetLogz(); gPad->SetLogy(); ana16 -> ProjectionX("proX")->Draw(); //ana17 -> Draw("colz"); can4->cd(3); ana17 -> SetNameTitle("energy", "Edep x distance in to center Ti per event; Energy[MeV]; Sqrt(x^2+y^2+z^2) [mm]; Counts"); ana17-> SetFillColor(0); gPad->SetLeftMargin(0.1); gPad->SetRightMargin(0.15); ana17->GetZaxis()->SetTitleOffset(1.6); //anaPos->GetZaxis()->SetRangeUser(-0.6, 0.6); //gPad->SetLogz(); ana17 -> Draw("colz"); can4->cd(4); //ana17 -> SetNameTitle("energy", "Edep x distance in to center Ti per event; Energy[MeV]; Sqrt(x^2+y^2+z^2) [mm]; Counts"); ana17-> SetFillColor(0); gPad->SetLeftMargin(0.1); gPad->SetRightMargin(0.15); ana17->GetZaxis()->SetTitleOffset(1.6); //anaPos->GetZaxis()->SetRangeUser(-0.6, 0.6); //gPad->SetLogz(); gPad->SetLogy(); ana17 -> ProjectionX("pX")->Draw(); //ana17 -> Draw("colz");//*/ //can5 /*can5->cd(1); ana20 -> SetNameTitle("energy", "Edep x distance in to center World STEP; Energy[MeV]; Sqrt(x^2+y^2+z^2) [mm]; Counts"); ana20 -> SetFillColor(0); gPad->SetLeftMargin(0.1); gPad->SetRightMargin(0.15); ana20->GetZaxis()->SetTitleOffset(1.6); //anaPos->GetZaxis()->SetRangeUser(-0.6, 0.6); //gPad->SetLogy(); ana20 -> Draw("colz"); can5->cd(2); ana20 -> SetNameTitle("energy", "Edep x distance in to center World; Energy[MeV]; Sqrt(x^2+y^2+z^2) [mm]; Counts"); ana20-> SetFillColor(0); gPad->SetLeftMargin(0.1); gPad->SetRightMargin(0.15); ana20->GetZaxis()->SetTitleOffset(1.6); //anaPos->GetZaxis()->SetRangeUser(-0.6, 0.6); //gPad->SetLogz(); gPad->SetLogy(); ana20 -> ProjectionX("Pr in X")->Draw(); //ana21 -> Draw("colz"); can5->cd(3); ana21 -> SetNameTitle("energy", "Edep x distance in to center World per event; Energy[MeV]; Sqrt(x^2+y^2+z^2) [mm]; Counts"); ana21-> SetFillColor(0); gPad->SetLeftMargin(0.1); gPad->SetRightMargin(0.15); ana21->GetZaxis()->SetTitleOffset(1.6); //anaPos->GetZaxis()->SetRangeUser(-0.6, 0.6); //gPad->SetLogy(); ana21 -> Draw("colz"); can5->cd(4); //ana21 -> SetNameTitle("energy", "Edep x distance in to center World per event; Energy[MeV]; Sqrt(x^2+y^2+z^2) [mm]; Counts"); ana21-> SetFillColor(0); gPad->SetLeftMargin(0.1); gPad->SetRightMargin(0.15); ana21->GetZaxis()->SetTitleOffset(1.6); //anaPos->GetZaxis()->SetRangeUser(-0.6, 0.6); //gPad->SetLogz(); gPad->SetLogy(); ana21 -> ProjectionX("pjX")->Draw(); //ana20 -> Draw("colz");//*/ // out file TFile *p = new TFile("EnKin.root", "RECREATE"); // Sam 0.05mm ana->Write(); ana1->Write(); ana2->Write(); ana3->Write();//*/ /*ana4->Write(); ana5->Write(); ana6->Write(); ana7->Write();//*/ /*ana8->Write(); ana9->Write(); ana10->Write(); ana11->Write();//*/ /*ana12->Write(); ana13->Write(); ana14->Write(); ana15->Write();//*/ /*ana16->Write(); ana17->Write(); ana18->Write(); ana19->Write();//*/ /*ana20->Write(); ana21->Write(); ana22->Write(); ana23->Write();//*/ }