raytrace_spread.C
Go to the documentation of this file.00001
00002
00003 void raytrace_spread() {
00004
00005
00006 const Int_t NUM_RANGES = 11;
00007
00008 const Double_t E_START = 2.75;
00009 const Double_t E_STEP = 0.25;
00010
00011 TCanvas *c1 = new TCanvas();
00012
00013 c1->Divide(4,3);
00014
00015
00016 for (int i=0; i<NUM_RANGES; i++) {
00017
00018 c1->cd(i+1);
00019
00020 raytraces(2.75+i*E_STEP,2.75+(i+1)*E_STEP);
00021
00022 }
00023
00024
00025 }
00026
00027 void raytraces(Double_t min, Double_t max) {
00028
00029 TString cut = "ion&&z==11965&&";
00030
00031 cut+="kineE>";
00032 cut+=min*1000;
00033 cut+="&&kineE<";
00034 cut+=max*1000;
00035
00036 geant->Draw("theta0:kineE:num",cut,"goff");
00037
00038 Double_t *id = geant->GetV3();
00039 Double_t *en = geant->GetV2();
00040 Double_t *th = geant->GetV1();
00041
00042 Int_t tot = htemp->GetEntries();
00043 const Int_t N = tot;
00044
00045 cout << N << endl;
00046
00047 Double_t index[N];
00048 Double_t kineE[N];
00049 Double_t theta[N];
00050
00051 Double_t e_min=5000000, e_max=-500000, id_min=5000000, id_max=-5000000;
00052
00053
00054 for (int i=0; i<N; i++) {
00055 index[i]= *(id +i);
00056 theta[i]= *(th +i);
00057 kineE[i]= *(en +i);
00058
00059 if (kineE[i]>e_max) {e_max=kineE[i]; id_max=index[i];}
00060 if (kineE[i]<e_min) {e_min=kineE[i]; id_min=index[i];}
00061
00062 }
00063
00064
00065 TString cut = "num==";
00066 cut+=id_max;
00067
00068 geant->Draw("r:z",cut,"C");
00069
00070 for (int i=1; i<N; i++) {
00071
00072 TString cut = "num==";
00073 cut+=index[i];
00074
00075 geant->Draw("r:z",cut,"Csame");
00076
00077 }
00078
00079
00080
00081 TString title = "E = {";
00082
00083 title+=min;
00084 title+=", ";
00085 title+=max;
00086 title+="} GeV";
00087
00088 htemp->SetTitle(title);
00089 htemp->GetYaxis()->SetRangeUser(0,350);
00090 htemp->GetXaxis()->SetRangeUser(0,25000);
00091
00092
00093 }