Changeset 633


Ignore:
Timestamp:
02/23/01 10:32:37 (24 years ago)
Author:
magicsol
Message:
Member functions to get the diskriminator map of pixel at given time and to
set the NSb response from the databse have been added.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Simulation/Detector/include-MTrigger/MTrigger.cxx

    r486 r633  
    229229  histMean =  histPmt->GetMean() ;   
    230230 
    231   histPmt->SetContent( ValRazmik) ;
     231  for (i=0;i<41;i++){
     232    histPmt->SetBinContent(i,ValRazmik[i]);
     233  }
    232234
    233235  histMean =  histPmt->GetMean() ;
     
    455457  histMean =  histPmt->GetMean() ;   
    456458 
    457   histPmt->SetContent( ValRazmik) ;
     459  for (i=0;i<41;i++){
     460    histPmt->SetBinContent(i,ValRazmik[i]);
     461  }
    458462
    459463  histMean =  histPmt->GetMean() ;
     
    794798
    795799
     800void MTrigger::SetNSB( Int_t iPix, Float_t resp[TRIGGER_TIME_SLICES]){
     801  // ================================================================
     802  //
     803  //     Sets the information in the array for the analog signal
     804  //     from a given array
     805  //
     806
     807  if ( iPix < 0 ) {
     808    cout << "     ERROR: in MTrigger::SetNSB()    " << endl ;
     809    cout << "     ERROR: Pixel Id < 0 ---> Exit " << endl ;
     810    exit (1) ;
     811  }
     812  else if ( iPix >= CAMERA_PIXELS ) {
     813    cout << "     ERROR: in MTrigger::SetNSB()    " << endl ;
     814    cout << "     ERROR: Pixel Id > CAMERA_PIXELS ---> Exit " << endl ;
     815    exit (1) ;
     816  }
     817  else if ( iPix >= TRIGGER_PIXELS ) {
     818    //
     819    //  We have not to fill information in the trigger part.
     820    //
     821  }
     822  else { 
     823    //
     824    // we have a trigger pixel and we fill it
     825    //
     826    Int_t i ;
     827
     828    //
     829    //  but at the beginning we must check if this pixel is
     830    //  hitted the first time
     831    //
     832   
     833    if ( used[iPix] == FALSE ) {
     834      used [iPix] = TRUE ;
     835     
     836      for (i=0; i < TRIGGER_TIME_SLICES; i++ ) {
     837        a_sig[iPix][i] = 0. ;
     838        d_sig[iPix][i] = 0. ;
     839      }
     840    }
     841
     842    //
     843    //  look over the response signal and put it in the signal line
     844    //
     845
     846    for ( i = 0 ; i<TRIGGER_TIME_SLICES; i++ ) {
     847     
     848      a_sig[iPix][i] = resp[i];
     849    }
     850
     851  }
     852}
    796853
    797854void MTrigger::ElecNoise() {
     
    876933 
    877934}
     935
     936void MTrigger::GetMapDiskriminator(Byte_t *map){
     937  //=============================================================
     938  //
     939  //   Gives a map of the fired pixels (Bool_t  dknt [TRIGGER_PIXELS])
     940  //   in an array of Byte_t (each byte has the information for 8 pixels)
     941  //
     942
     943  Int_t i,ii;
     944
     945  for(i=0;i<TRIGGER_PIXELS/8+1;i++){
     946    map[i]=0;
     947  }
     948
     949  for(i=0;i<TRIGGER_PIXELS;i++){
     950    ii=(Int_t)i/8;
     951    if (dknt[i]==TRUE){
     952      map[ii]=map[ii]+(Int_t)pow(2,i-ii*8);
     953    }
     954  }
     955}
     956
    878957
    879958void MTrigger::Diskriminate() {
Note: See TracChangeset for help on using the changeset viewer.