Changeset 1195 for trunk/MagicSoft


Ignore:
Timestamp:
01/18/02 17:41:02 (23 years ago)
Author:
blanch
Message:
The option of adding noise to all pixels or to not adding the noise
has been added.
We removed the pixels larger than 577. When there were more than one
trigger in one shower, the pixel number was increasing. Now it is
flagged by the variable MMcTrig::fFirstLvlTrig.
File:
1 edited

Legend:

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

    r1089 r1195  
    2121//
    2222// $RCSfile: camera.cxx,v $
    23 // $Revision: 1.30 $
     23// $Revision: 1.31 $
    2424// $Author: blanch $
    25 // $Date: 2001-11-27 09:49:54 $
     25// $Date: 2002-01-18 17:41:02 $
    2626//
    2727////////////////////////////////////////////////////////////////////////
     
    240240static float Trigger_response_fwhm = 2.0;
    241241static float Trigger_overlaping_time= 0.25;
     242static float Trigger_noise= 0.3;
    242243
    243244//@: Properties of the FADC
    244245static float FADC_response_ampl = MFADC_RESPONSE_AMPLITUDE;
    245246static float FADC_response_fwhm = MFADC_RESPONSE_FWHM;
     247static float FADC_noise = 2.0;
    246248
    247249//@: Trigger conditions for a single trigger mode
     
    431433  int i, j, k;                //@< simple counters
    432434
     435  int addElecNoise;           //@< Will we add ElecNoise?
     436
    433437  int simulateNSB;            //@< Will we simulate NSB?
    434438  int nphe2NSB;               //@< From how many phe will we simulate NSB?
     
    621625
    622626  qTailCut = get_tail_cut();
    623   simulateNSB = get_nsb( &meanNSB, &nphe2NSB );
     627  addElecNoise = add_elec_noise(&FADC_noise, &Trigger_noise);
     628  simulateNSB = get_nsb( &meanNSB, &nphe2NSB ); 
    624629  countIslands = get_islands_cut( &nIslandsCut );
    625630
     
    950955
    951956  for(i=0;i<CAMERA_PIXELS;i++){
    952       fadc_elecnoise[i]=2.0;
    953   }
     957      fadc_elecnoise[i]=FADC_noise;
     958  }
     959
    954960  fadc.GetPedestals(&fadc_pedestals[0]);
    955961
     
    13801386        //   This is done inside the class MTrigger by the method ElecNoise.
    13811387        //   
    1382         Trigger.ElecNoise() ;
    1383        
    1384         fadc.ElecNoise() ;
     1388        if (addElecNoise){     
     1389            Trigger.ElecNoise(Trigger_noise) ;
     1390           
     1391            fadc.ElecNoise(FADC_noise) ;
     1392        }
    13851393
    13861394        //  We should simulate the AC coupling behaviour:
     
    14411449                  if(Lev0!=0)
    14421450                      Lev1=Trigger.FirstLevel();
    1443                   if (Write_McTrig)
    1444                     McTrig[iconcount]->SetFirstLevel (Lev1);
    14451451                  if(Lev1>0) {
    14461452                    btrigger= 1;
     
    14481454                  }
    14491455                 
     1456                  Lev0=1;
    14501457                  if(Lev1==0 && (Write_All_Images || btrigger)){
    14511458                    btrigger= 1;
    14521459                    Lev1=1;
     1460                    Lev0=0;
    14531461                  }
    14541462                  numPix=0;
    14551463                  for (Int_t ii=0;ii<Lev1;ii++){
    1456                     if (Write_McTrig)
    1457                       McTrig[iconcount]->SetTime(Trigger.GetFirstLevelTime(ii),ii+1);
    1458                     if (Write_McTrig){
    1459                       Trigger.GetMapDiskriminator(trigger_map);
    1460                       McTrig[iconcount]->SetMapPixels(trigger_map,ii);
    1461                     }
     1464                      if (Write_McTrig){
     1465                          McTrig[iconcount]->SetFirstLevel ((ii+1)*Lev0);
     1466                          McTrig[iconcount]->SetTime(Trigger.GetFirstLevelTime(ii),ii+1);
     1467                          Trigger.GetMapDiskriminator(trigger_map);
     1468                          McTrig[iconcount]->SetMapPixels(trigger_map,ii);
     1469                      }
    14621470                    //
    14631471                    //  fill inside the class fadc the member output
     
    14771485                          fadcValues->AddAt(fadc.GetFadcSignal(i,j),j);
    14781486                        }
    1479                         EvtData[iconcount]->AddPixel(i+1000*ii,fadcValues,0);
     1487                        EvtData[iconcount]->AddPixel(i,fadcValues,0);
    14801488                      }
    14811489                    }
     
    15651573          if ( Lev0 > 0 || Write_All_Images) {
    15661574            Lev1= Trigger.FirstLevel();
    1567             if (Write_McTrig)
    1568               McTrig[0]->SetFirstLevel (Lev1);
    15691575          }
    15701576          if (Lev1>0){
    15711577            ++ntrigger;
    15721578          }
     1579          Lev0=1;
    15731580          if (Lev1==0 && Write_All_Images){
    15741581            Lev1=1;
     1582            Lev0=0;
    15751583          }
    15761584
     
    15841592            fadc.TriggeredFadc(Trigger.GetFirstLevelTime(ii));
    15851593
    1586             if (Write_McTrig)
     1594            if (Write_McTrig){
     1595              McTrig[0]->SetFirstLevel ((ii+1)*Lev0);
    15871596              McTrig[0]->SetTime(Trigger.GetFirstLevelTime(ii),ii+1);
    1588 
    1589             if (Write_McTrig){
    15901597              Trigger.GetMapDiskriminator(trigger_map);
    15911598              McTrig[0]->SetMapPixels(trigger_map,ii);
     
    16081615                  fadcValues->AddAt(fadc.GetFadcSignal(i,j),j);
    16091616                }
    1610                 EvtData[0]->AddPixel(i+ii*1000,fadcValues,0);
     1617                EvtData[0]->AddPixel(i,fadcValues,0);
    16111618              }
    16121619            }       
     
    33103317//
    33113318// $Log: not supported by cvs2svn $
     3319// Revision 1.30  2001/11/27 09:49:54  blanch
     3320// Fixing bug which was treating wrongly the extension of star photons.
     3321//
    33123322// Revision 1.29  2001/11/14 17:38:23  blanch
    33133323// Sveral changes have been done:
     
    33903400//
    33913401// $Log: not supported by cvs2svn $
     3402// Revision 1.30  2001/11/27 09:49:54  blanch
     3403// Fixing bug which was treating wrongly the extension of star photons.
     3404//
    33923405// Revision 1.29  2001/11/14 17:38:23  blanch
    33933406// Sveral changes have been done:
Note: See TracChangeset for help on using the changeset viewer.