Subversion Repositories f9daq

Compare Revisions

Ignore whitespace Rev 84 → Rev 175

/lightguide/trunk/src/raySimulator.cpp
90,7 → 90,7
char sbuff[256];
sprintf(sbuff, "SiPM = %.1lf, L.y. = %.2lf, d = %.1lf | gap = (%.1lf, %.1lf, %.1lf), #theta = %.1lf | acceptance = %.3lf",
parameters.getA(), parameters.getLightYield()*acc, parameters.getD(),
parameters.getGap().x(), parameters.getGap().y(), parameters.getGap().z(), theta, acc);
parameters.getGap().x(), parameters.getGap().y(), parameters.getGap().z(), theta, acc*100);
 
if(!only2d) {
RTCanvas *cdata = new RTCanvas((char*)"Data", sbuff, 350, 0, 950, 950);
98,12 → 98,11
int cpc = 1;
cdata->cd(cpc++);
TH2F* generated = detector->GetGenerated();
int nGenerated = generated->GetEntries();
int minimum = generated->GetBinContent(generated->GetMinimumBin());
double nGenerated = generated->GetEntries();
//int minimum = generated->GetBinContent(generated->GetMinimumBin());
int maximum = generated->GetBinContent(generated->GetMaximumBin());
generated->GetZaxis()->SetRangeUser(0, 1.05*maximum);
double variation = (maximum-minimum)/(double)nGenerated;
printf("Statistical variation (max-min)/all = %f perc. \n", variation*100);
//double variation = (maximum-minimum)/(double)nGenerated;
generated->SetTitle("Generated");
generated->Draw("colz");
cdata->cd(cpc++); //((detector->GetLG())->GetHIn())->Draw("COLZ");
115,6 → 114,10
 
cdata->cd(cpc++);
TH2F* histoActive = (detector->GetHActive());
//double nAccepted = histoActive->GetEntries();
//double variation = 1 / sqrt(nAccepted);
double variation = sqrt(acc*(1-acc)/nGenerated);
printf("Statistical error = %f perc.\n", variation*100);
histoActive->Draw("COLZ");
cdata->cd(cpc++);
TH2F* histoLaser = (detector->GetHLaser());
/lightguide/trunk/src/guide.cpp
545,7 → 545,7
// --------------- reflection at "reflection" probability ---------------------
// ----------------------------------------------------------------------------
case SURF_REFLE:
p_ref = rand.Uniform(0.0, 1.0);
//p_ref = rand.Uniform(0.0, 1.0);
if(p_ref < reflection) { // se odbije
cosTi = in.GetK() * n;
transmit = in.GetK() - 2*cosTi*n;
560,7 → 560,7
 
// total reflection from n1 to n2 with R probbability
case SURF_IMPER:
p_ref = rand.Uniform(0.0, 1.0);
//p_ref = rand.Uniform(0.0, 1.0);
if(p_ref < reflection) { // se odbije
cosTi = in.GetK() * n;
if(TMath::Abs(cosTi) < cosTtotal) { // totalni odboj
643,7 → 643,7
TVector3 activePosition(center);
activePosition += TVector3(_d, 0, 0);
TVector3 normal(1,0,0);
grease.Set(activePosition, normal, 0.95*a/2.0);
grease.Set(activePosition, normal, 0.80*a/2.0);
 
if(fresnel) for(int i=0; i<6; i++) s_side[i].SetFresnel(1);