Changeset 884


Ignore:
Timestamp:
07/19/01 10:28:30 (23 years ago)
Author:
blanch
Message:
A new command, which allows to set individual trigger threshod for each pixel,
has been added.
File:
1 edited

Legend:

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

    r672 r884  
    1919//=
    2020//= $RCSfile: creadparam.cxx,v $
    21 //= $Revision: 1.9 $
     21//= $Revision: 1.10 $
    2222//= $Author: blanch $
    23 //= $Date: 2001-03-05 10:43:18 $
     23//= $Date: 2001-07-19 09:28:30 $
    2424//=
    2525//=//////////////////////////////////////////////////////////////////////
     
    7878static float meanNSB;           //@< NSB mean value (per pixel)
    7979static int nphe2NSB=0;            //@< Number of phe from shower to do NSB simulation
    80 static float qThreshold;        //@< Threshold value
     80static float qThreshold[TRIGGER_PIXELS];     //@< Threshold values
     81static int Individual_Thres = FALSE;
    8182static char NSB_directory[PATH_MAX_LENGTH];  //@< database for NSB
    8283static float qTailCut;          //@< Tail Cut value
     
    142143  char line[LINE_MAX_LENGTH];    //@< line to get from the stdin
    143144  char token[ITEM_MAX_LENGTH];   //@< a single token
    144   int i, j;                      //@< dummy counters
     145  int i, j, k;                      //@< dummy counters
     146  float aux;                    //@< auxiliar variable
    145147  ifstream ifile;
    146148
     
    268270      break;
    269271
    270     case threshold:           //@< value of threshold for trigger (q0)
     272    case pixel_thres:           //@< value of threshold for trigger (q0)
    271273         
    272274      // get value of threshold (in ph.e.)
    273       sscanf(line, "%s %f", token, &qThreshold);
     275      sscanf(line, "%s %i %f", token,&k, &aux);
     276      qThreshold[k]=aux;
     277      Individual_Thres = TRUE;
    274278
    275279      break;
     
    436440      sscanf(line, "%s %d %d %d %d %d %d", token, &Trigger_loop_lthres, &Trigger_loop_uthres, &Trigger_loop_lmult, &Trigger_loop_umult, &Trigger_loop_ltop, &Trigger_loop_utop );
    437441
     442      // Set qThreshold to a global value
     443      for(k=0;k<TRIGGER_PIXELS;k++){
     444        qThreshold[k]=Trigger_loop_lthres;
     445      }
     446
    438447      // change boolean value
    439448      Trigger_Loop = TRUE;
    440449      Write_RawEvt = FALSE;
     450      Individual_Thres = FALSE;
    441451
    442452      break;
     
    446456      //  Get trigger conditions
    447457      sscanf(line, "%s %f %d %d", token, &Trigger_threshold, &Trigger_multiplicity, &Trigger_topology);
     458
     459      // Set qThreshold to a global value
     460      for(k=0;k<TRIGGER_PIXELS;k++){
     461        qThreshold[k]=Trigger_threshold;
     462      }
    448463
    449464      // change boolean value
    450465      Trigger_Loop = FALSE;
    451466      Write_RawEvt = TRUE;
     467      Individual_Thres = FALSE;
    452468
    453469      break;
     
    653669
    654670//!@{
    655 float
    656 get_threshold(void)
    657 {
    658   return( qThreshold );
     671void
     672get_threshold(float *t)
     673{
     674  for(int i=0;i<TRIGGER_PIXELS;i++)
     675    t[i]=qThreshold[i];
     676}
     677//!@}
     678
     679
     680//!-----------------------------------------------------------
     681// @name get_indi_thres_pixel
     682//                                               
     683// @desc get boolean information about global (FALSE) or
     684// @desc individual (TRUE) pixel trigger threshold
     685//
     686// @return   Value for the Individual_Thres
     687//
     688// @date Wed Jul 18 16:29:43 CEST 2001
     689//------------------------------------------------------------
     690// @function
     691
     692//!@{
     693int get_indi_thres_pixel(void){
     694  return  Individual_Thres;
    659695}
    660696//!@}
     
    11321168get_Trigger_Single(float *t, int *m, int *g)
    11331169{
    1134   *t=Trigger_threshold;
     1170  for(int i=0;i<TRIGGER_PIXELS;i++)
     1171    t[i]=qThreshold[i];
    11351172  *m=Trigger_multiplicity;
    11361173  *g=Trigger_topology;
     
    11451182//
    11461183// $Log: not supported by cvs2svn $
     1184// Revision 1.9  2001/03/05 10:43:18  blanch
     1185// New input commands have been added:
     1186//
     1187//      - write_McFadc: to write the FADC simulation information.
     1188//      - fadc_prop: gives the shape of the single phe response of the FADC
     1189//
     1190// And new value has been added in the mean_NSB command that tells how many phes
     1191// have to come from the shower to do the NSB simulation in that shower (it speeds
     1192// up the simulation).
     1193//
    11471194// Revision 1.8  2001/02/23 10:55:43  magicsol
    11481195// An input commmand that talls the path for the NSB database has been added.
Note: See TracChangeset for help on using the changeset viewer.