#define TotIon_cxx #include "TotIon.h" #include #include #include void TotIon::Loop() { // In a ROOT session, you can do: // root> .L TotIon.C // root> TotIon 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 = 3500; int nbins1 = 450; gStyle->SetOptStat(1111); gStyle->SetPalette(57); //kRainBow gStyle->SetPalette(kRainBow); 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);//*/ // can //TH2F *ana= new TH2F("ana","ana", nbins, 0.0,0.0455, nbins, -0.8,0.8); //edep TH1D *ana= new TH1D("ana","ana", nbins, 0.0,0.0455); //edep //TH1F *ana1= new TH1F("ana1","ana1", nbins, 0.0,0.0455); //edep //auto *ana1 = new TH2F("ana1","ana1",nbins, 0.0,23.0, nbins1, 0.0,0.25*pow(10,-12)); //dose - control 250000 = 10^-12 //can1 //TH2F *ana2= new TH2F("ana2","ana2", nbins, 0.0,0.0455, nbins, 0.0,23.); // edep //TH2F *ana3 = new TH2F("ana3","ana3", nbins, 0.0,23.0, nbins1, 0.0,10.0*pow(10,-9)); //dose - control 250000 = 10^-9 // can2 /*TH2F *ana4 = new TH2F("ana4","ana4",nbins1, 0.0,0.0455, nbins1, 0.0,1850.); TH2F *ana5 = new TH2F("ana5","ana5",nbins1, 0.0,0.0455, nbins1, 0.0,1850.); //can3 TH2F *ana6= new TH2F("ana6","ana6", nbins, 0.0,0.0455, nbins, 0.0,1850.); TH2F *ana7 = new TH2F("ana7","ana7",nbins, 0.0,0.0455, nbins, 0.0,1850.); // world//*/ can->Divide(1,1); //can1->Divide(1,1); //can2->Divide(2,2); can->cd(1);//*/ //can1->cd(1);//*/ Long64_t nentries = fChain->GetEntries(); Long64_t nbytes = 0, nb = 0; for (Long64_t jentry=0; jentry<100 ;jentry++) { Long64_t ientry = LoadTree(jentry); if (ientry < 0) break; nb = fChain->GetEntry(jentry); nbytes += nb; // if (Cut(ientry) < 0) continue; cout<<"size = "<size()-1)&&(Step_FinalMaterial->at(cont1)=="G4_WATER")){cont1++;}//*/ if((Step_FinalMaterial->at(cont1)=="G4_WATER")&&(Step_Particle->at(cont1)=="e-")){mm6++; for(Int_t l=0;lsize();l++){mm7++; //if(Step_FinalProcess->at(l)=="e-_G4DNAIonisation"){CountIon++;} //if(Step_FinalProcess->at(l)=="e-_G4DNAExcitation"){CountExc++;} ekin = ekin + Step_InitialKineticEnergy->at(l); }//*/ if(Step_InitialProcess->at(cont1)=="e-_G4DNAIonisation"){CountIon++;} if(Step_InitialProcess->at(cont1)=="e-_G4DNAExcitation"){CountExc++;} cout<<"Process = " << Step_FinalProcess->at(cont1)< 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(1); ana -> SetNameTitle("energy", "Kinect Energy spectrum - Electroes Totais (sem gamas); Energy[MeV]; Counts"); //ana -> SetNameTitle("energy", "Kinect Energy spectrum - Electroes Primarios - 0.05mm; Energy[MeV]; Counts"); //ana -> SetNameTitle("energy", "Kinect Energy spectrum - Electroes Secundarios; Energy[MeV]; Counts"); //ana -> SetNameTitle("energy", "Kinect Energy spectrum - Fotoes; Energy[MeV]; 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(); ana -> Draw("s1"); //ana17 -> Draw("colz");//*/ // out file TFile *p = new TFile("SPEC_ElecDNA.root", "RECREATE"); // Sam 0.05mm //TFile *p = new TFile("SPEC_1arioElectroesA.root", "RECREATE"); // Sam 0.05mm //TFile *p = new TFile("SPEC_2arioElectroes.root", "RECREATE"); // Sam 0.05mm //TFile *p = new TFile("SPEC_Fotoes.root", "RECREATE"); // Sam 0.05mm ana->Write(); p->Write(); //p->Close(); }