Ignore:
Timestamp:
11/17/04 11:34:49 (20 years ago)
Author:
moralejo
Message:
 Added input card command  "noise_gain_fluctuations_off", to disable the
 PMT gain fluctuations also for the NSB noise (just for tests). Added
 a flag to MMcFadcHeader and MMcTrigHeader about this. Also copied the flag
 fGainFluctuations of MMcFadcHeader to MMcTrigHeader, since the gain
 fluctuations affect both the trigger and the signal in the FADC.
File:
1 edited

Legend:

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

    r5341 r5417  
    2121//
    2222// $RCSfile: camera.cxx,v $
    23 // $Revision: 1.81 $
     23// $Revision: 1.82 $
    2424// $Author: moralejo $
    25 // $Date: 2004-11-04 22:00:51 $
     25// $Date: 2004-11-17 11:34:49 $
    2626//
    2727////////////////////////////////////////////////////////////////////////
     
    839839
    840840  if (! apply_gain_fluctuations())
    841     log(SIGNATURE, "PMT gain fluctuations have been switched OFF in the input card.\n\n");
     841    {
     842      log(SIGNATURE, "PMT gain fluctuations for the signal phes have been switched OFF");
     843      log(SIGNATURE, "in the input card.\n\n");
     844    }
     845  if (! apply_noise_gain_fluctuations())
     846    {
     847      log(SIGNATURE, "PMT gain fluctuations for the NSB phes have been switched OFF\n");
     848      log(SIGNATURE, "in the input card.\n\n");
     849    }
     850
     851  if ( apply_gain_fluctuations() && !apply_noise_gain_fluctuations())
     852    {
     853      log(SIGNATURE, "Warning: you switched off PMT gain fluctuations for the NSB\n");
     854      log(SIGNATURE, "photoelectrons, but not for the signal photoelectrons.\n\n");
     855    }
     856  else if ( !apply_gain_fluctuations() && apply_noise_gain_fluctuations())
     857    {
     858      log(SIGNATURE, "Warning: you switched off PMT gain fluctuations for the signal\n");
     859      log(SIGNATURE, "photoelectrons, but not for the NSB photoelectrons.\n");
     860    }
     861
    842862
    843863  // log flags information
     
    12231243    HeaderTrig[0]->SetGate(Trigger_gate_length);
    12241244    HeaderTrig[0]->SetElecNoise(Trigger_noise);
    1225   }
     1245    HeaderTrig[0]->SetGainFluctuations(Trigger_CT[0]->GetGainFluctuations());
     1246    HeaderTrig[0]->SetNoiseGainFluctuations((Bool_t)apply_noise_gain_fluctuations());
     1247  }
     1248
    12261249  if(!Trigger_Loop && Write_McTrig && ct_Number>1){
    12271250    for(int i=0;i<ct_Number;i++){
     
    12341257      HeaderTrig[i]->SetGate(Trigger_gate_length);
    12351258      HeaderTrig[i]->SetElecNoise(Trigger_noise);
    1236     }   
     1259      HeaderTrig[i]->SetGainFluctuations(Trigger_CT[i]->GetGainFluctuations());
     1260      HeaderTrig[i]->SetNoiseGainFluctuations((Bool_t)apply_noise_gain_fluctuations());
     1261    }
    12371262  } 
    12381263  if(Trigger_Loop && Write_McTrig){
     
    12551280          HeaderTrig[iconcount]->SetGate(Trigger_gate_length);
    12561281          HeaderTrig[iconcount]->SetElecNoise(Trigger_noise);
     1282          HeaderTrig[iconcount]->SetGainFluctuations(Trigger_CT[0]->GetGainFluctuations());
     1283          HeaderTrig[iconcount]->SetNoiseGainFluctuations((Bool_t)apply_noise_gain_fluctuations());
    12571284          iconcount++;
    12581285        }
     
    12851312    HeaderFadc[0]->SetElecNoise(&fadc_elecnoise[0], &fadc_diginoise[0],
    12861313                                ((MGeomCam*)(camgeom.UncheckedAt(0)))->GetNumPixels());
     1314
     1315    //
     1316    // Fill also the flag indicating whether the PMT gain fluctuations
     1317    // were simulated or not:
     1318    //
     1319    HeaderFadc[0]->SetGainFluctuations(Trigger_CT[0]->GetGainFluctuations());
     1320    HeaderFadc[0]->SetNoiseGainFluctuations((Bool_t)apply_noise_gain_fluctuations());
     1321
    12871322  }
    12881323
     
    13091344      HeaderFadc[i]->SetElecNoise(&fadc_elecnoise[0], &fadc_diginoise[0],
    13101345                                  ((MGeomCam*)(camgeom.UncheckedAt(i)))->GetNumPixels());
     1346
     1347      //
     1348      // Fill also the flag indicating whether the PMT gain fluctuations
     1349      // were simulated or not:
     1350      //
     1351      HeaderFadc[i]->SetGainFluctuations(Trigger_CT[i]->GetGainFluctuations());
     1352      HeaderFadc[i]->SetNoiseGainFluctuations((Bool_t)apply_noise_gain_fluctuations());
     1353
    13111354    }
    13121355  }
     
    13381381          HeaderFadc[iconcount]->SetElecNoise(&fadc_elecnoise[0],
    13391382                                              &fadc_diginoise[0],ct_NPixels);
     1383
     1384          HeaderFadc[iconcount]->SetGainFluctuations(Trigger_CT[0]->GetGainFluctuations());
     1385          HeaderFadc[iconcount]->SetNoiseGainFluctuations((Bool_t)apply_noise_gain_fluctuations());
     1386
    13401387          iconcount++;
    13411388        }
     
    14491496  MLons lons(0, Trigger_response_ampl, Trigger_response_fwhm,
    14501497             FADC_shape, FADC_response_integ, FADC_response_fwhm,
    1451              FADC_slices_per_ns);
     1498             FADC_slices_per_ns, apply_noise_gain_fluctuations());
    14521499
    14531500  lons.SetSeed(((UInt_t)(get_seeds(1)*get_seeds(1)*get_seeds(0))));
     
    14581505  MLons lons_outer(0, Trigger_response_ampl, Trigger_response_fwhm,
    14591506                   FADC_shape_out,FADC_resp_integ_out,FADC_resp_fwhm_out,
    1460                    FADC_slices_per_ns);
     1507                   FADC_slices_per_ns, apply_noise_gain_fluctuations());
    14611508
    14621509  lons_outer.SetSeed(((UInt_t)(get_seeds(1)*get_seeds(0)*get_seeds(0))));
     
    16171664    }
    16181665    for(int ie=0; ie < empty_events; ie++){
    1619       Fadc_CT[ict]->Reset() ;
    1620       if (addElecNoise){       
     1666      Fadc_CT[ict]->Reset();
     1667      if (addElecNoise){
    16211668        Fadc_CT[ict]->ElecNoise() ;
    16221669      }
     
    16391686                  else
    16401687                    {
    1641                       k=lons.GetResponse(nsb_phepns[ict][ui],0.01,
    1642                                          & nsb_trigresp[0],& nsb_fadcresp[0]);
     1688                      k = lons.GetResponse(nsb_phepns[ict][ui],0.01,
     1689                                           & nsb_trigresp[0],& nsb_fadcresp[0]);
    16431690                    }
    16441691
     
    16881735                                      ((MGeomCam*)(camgeom.UncheckedAt(ict)))
    16891736                                      ->GetNumPixels());
    1690 
    1691     //
    1692     // Fill also the flag indicating whether the PMT gain fluctuations
    1693     // were simulated or not:
    1694     //
    1695     HeaderFadc[ict]->SetGainFluctuations(Trigger_CT[ict]->GetGainFluctuations());
    16961737  }
    16971738
     
    49224963//
    49234964// $Log: not supported by cvs2svn $
     4965// Revision 1.81  2004/11/04 22:00:51  moralejo
     4966//
     4967//  Removed unused variables fTelesTheta and fTelesPhi from MMcRunHeader. They
     4968//  were not useful because telescope orientation may change from event to
     4969//  event. Added fMirrorFraction to the MMcConfigRunHeader container in the
     4970//  camera output.
     4971//
    49244972// Revision 1.80  2004/10/26 19:21:05  moralejo
    49254973//
Note: See TracChangeset for help on using the changeset viewer.