Ignore:
Timestamp:
12/13/02 10:12:01 (22 years ago)
Author:
blanch
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Simulation/Detector/Camera/camera.cxx

    r1684 r1685  
    2121//
    2222// $RCSfile: camera.cxx,v $
    23 // $Revision: 1.48 $
     23// $Revision: 1.49 $
    2424// $Author: blanch $
    25 // $Date: 2002-12-12 17:40:50 $
     25// $Date: 2002-12-13 10:04:07 $
    2626//
    2727////////////////////////////////////////////////////////////////////////
     
    20302030                    0);
    20312031
     2032  //  Store qe for each PMT in output file
     2033  TArrayF qe_pmt;
     2034  TArrayF wav_pmt;
     2035  McConfigRunHeader->InitSizePMTs(ct_NPixels);
     2036  for(int i=0; i<ct_NPixels;i++){
     2037    McConfigRunHeader->AddPMT(i);
     2038    MGeomPMT &pmt  = McConfigRunHeader->GetPMT(i);
     2039    qe_pmt.Set(pointsQE,QE[i][1]);
     2040    wav_pmt.Set(pointsQE,QElambda);
     2041    pmt.SetArraySize(pointsQE);
     2042    pmt.SetPMTContent(i,wav_pmt,qe_pmt);
     2043  }
     2044
     2045  // Store Light Guides factors in the output file
     2046  TArrayF theta_lg;
     2047  TArrayF factor_lg;
     2048  theta_lg.Set(pointsWC,WC[0]);
     2049  factor_lg.Set(pointsWC,WC[1]);
     2050  McConfigRunHeader->SetLightGuides(theta_lg,factor_lg);
     2051
    20322052  //  Fill the Header Tree with the current leaves of each branch
    20332053  HeaderTree.Fill() ;
     
    26052625 
    26062626  if ( wcfile.bad() )
    2607     error( "read_WC", "Cannot open \"%s\". Exiting.\n", QE_FILE );
     2627    error( "read_WC", "Cannot open \"%s\". Exiting.\n", WC_FILE );
    26082628 
    26092629  // read file
     
    28542874  Float_t camwidth = -1.0;
    28552875
     2876  Int_t imir;
     2877  Float_t f,sx,sy,x,y,z,thetan,phin,xn,yn,zn;
     2878  Float_t dx,dy;
     2879  Int_t nummir, numref;
     2880  Float_t wav,ref;
     2881
    28562882  Char_t token[40];
    28572883  Char_t line[511];
    28582884  Char_t flag;
    2859   cout<<"To be implemented..."<<endl;
     2885
    28602886  while(1){
    28612887    if((flag=fgetc(sp))==EOF)
     
    28632889    fgets(&line[1],500,sp);
    28642890    line[0]=flag;
     2891    if (line[0]== '#' && line[2]=='n' && line[3]=='u' && line[4]=='m' &&
     2892        line[5]== 'b' && line[12]=='d' && line[13]=='a' && line[14]=='t'){
     2893      fgets(line,500,sp);
     2894      sscanf(line,"%i",&numref);
     2895      for(int i=0; i<numref;i++){
     2896        fgets(line,500,sp);
     2897        sscanf(line,"%f %f",&wav,&ref);
     2898      }
     2899      continue;
     2900    }
    28652901    if (line[0]== '#')
    28662902      continue;
    28672903    if (strstr(line, "type") == line)
    28682904      continue;
    2869     if (strstr(line, "focal_distance") == line)
     2905    if (strstr(line, "focal_distance") == line){
    28702906      sscanf(line,"%s %f",token,&focal);
    28712907      continue;
    2872     if (strstr(line, "focal_std") == line)
     2908    }
     2909    if (strstr(line, "focal_std") == line){
     2910      sscanf(line,"%s %f",token,&stdfocal);
    28732911      continue;
    2874     if (strstr(line, "point_spread") == line)
     2912    }
     2913    if (strstr(line, "point_spread") == line){
     2914      sscanf(line,"%s %f",token,&point);
    28752915      continue;
    2876     if (strstr(line, "point_std") == line)
     2916    }
     2917    if (strstr(line, "point_std") == line){
     2918      sscanf(line,"%s %f",token,&stdpoint);
    28772919      continue;
    2878     if (strstr(line, "adjustment_dev") == line)
     2920    }
     2921    if (strstr(line, "adjustment_dev") == line){
     2922      sscanf(line,"%s %f",token,&adjust);
    28792923      continue;
    2880     if (strstr(line, "black_spot") == line)
     2924    }
     2925    if (strstr(line, "black_spot") == line){
     2926      sscanf(line,"%s %f",token,&spot);
    28812927      continue;
    2882     if (strstr(line, "camera_width") == line)
     2928    }
     2929    if (strstr(line, "camera_width") == line){
     2930      sscanf(line,"%s %f",token,&camwidth);
    28832931      continue;
     2932    }
    28842933    if (strstr(line, "n_pixels") == line)
    28852934      continue;
     
    28902939    if (strstr(line, "n_gappixels") == line)
    28912940      continue;
    2892     if (strstr(line, "n_mirrors") == line)
     2941    if (strstr(line, "n_mirrors") == line){
     2942      sscanf(line,"%s %i",token,&nummir);
     2943      config->InitSizeMirror(nummir);
    28932944      continue;
    2894     if (strstr(line, "r_mirror") == line)
     2945    }
     2946    if (strstr(line, "r_mirror") == line){
     2947      sscanf(line,"%s %f",token,&radius);
    28952948      continue;
    2896     if (strstr(line, "define_mirrors") == line)
    2897       break;
    2898   }
     2949    }
     2950    if (strstr(line, "define_mirrors") == line){
     2951      for(int i=0;i<nummir;i++){
     2952        fgets(line,500,sp);
     2953        sscanf(line,"%i %f %f %f %f %f %f %f %f %f %f %f",
     2954               &imir,&f,&sx,&sy,&x,&y,&z,&thetan,&phin,&xn,&yn,&zn);
     2955        config->AddMirror(i);
     2956        MGeomMirror &mirror = config->GetMirror(i);
     2957        mirror.SetMirrorContent(imir,f,sx,sy,x,y,z,thetan,phin,xn,yn,zn);
     2958      }
     2959      fgets(line,500,sp);
     2960      while(line[2]!='w' || line[3]!='i' || line[4]!='t' || line[5]!='h'){
     2961        fgets(line,500,sp);
     2962      }
     2963      fgets(line,500,sp);
     2964      for(int i=0;i<nummir;i++){
     2965      fgets(line,500,sp);
     2966        sscanf(line,"%f %f",&dx,&dy);
     2967        MGeomMirror &mirror = config->GetMirror(i);
     2968        mirror.SetMirrorDeviations(dx,dy);
     2969      }     
     2970      continue;
     2971    }
     2972  }
     2973  config->SetMagicDef(radius, focal, stdfocal, point,
     2974                      stdpoint, adjust, spot, camwidth);
    28992975}
    29002976
     
    38573933//
    38583934// $Log: not supported by cvs2svn $
     3935// Revision 1.48  2002/12/12 17:40:50  blanch
     3936// *** empty log message ***
     3937//
    38593938// Revision 1.47  2002/12/10 17:19:31  blanch
    38603939// *** empty log message ***
     
    40024081//
    40034082// $Log: not supported by cvs2svn $
     4083// Revision 1.48  2002/12/12 17:40:50  blanch
     4084// *** empty log message ***
     4085//
    40044086// Revision 1.47  2002/12/10 17:19:31  blanch
    40054087// *** empty log message ***
Note: See TracChangeset for help on using the changeset viewer.