Changeset 886 for trunk


Ignore:
Timestamp:
07/19/01 10:29:53 (23 years ago)
Author:
blanch
Message:
Different threshold for each pixel can be used.
File:
1 edited

Legend:

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

    r781 r886  
    2121//
    2222// $RCSfile: camera.cxx,v $
    23 // $Revision: 1.25 $
     23// $Revision: 1.26 $
    2424// $Author: blanch $
    25 // $Date: 2001-05-08 08:07:54 $
     25// $Date: 2001-07-19 09:29:53 $
    2626//
    2727////////////////////////////////////////////////////////////////////////
     
    231231static int Trigger_Loop = FALSE;
    232232
     233//@: flag: TRUE: Different threshold for each pixel ; FALSE: same threshold for all pixels
     234static int Individual_Thres_Pixel = FALSE;
     235
    233236//@: Properties of the trigger
    234237static float Trigger_gate_length = 6.0;
     
    242245
    243246//@: Trigger conditions for a single trigger mode
    244 static float Trigger_threshold = 7.0;
     247static float qThreshold[TRIGGER_PIXELS]; 
    245248static int Trigger_multiplicity = 4;
    246249static int Trigger_topology = 2;
     
    386389  //@'
    387390
    388   int ioscar=0;
    389 
    390391  char inname[256];           //@< input file name
    391392  char starfieldname[256];    //@< starfield input file name
     
    455456  };                         
    456457
    457   float qThreshold;           //@< Threshold value
    458458  float qTailCut;             //@< Tail Cut value
    459459  int nIslandsCut;            //@< Islands Cut value
    460   int countIslands;           //@< Will we count the islands?
     460  int countIslands=FALSE;           //@< Will we count the islands?
    461461  int anaPixels;
    462462   
     
    471471  UShort_t numPix;            //@< number of sets of fadc written counts
    472472
    473   float fpixelthres[TRIGGER_PIXELS];
     473  float fpixelthres[TRIGGER_PIXELS];         //@< Threshold values
    474474
    475475  TArrayC *fadcValues;  //@< the analog Fadc siganl for pixels
     
    568568  Trigger_Scan = get_Trigger_Scan();
    569569
     570  Individual_Thres_Pixel = get_indi_thres_pixel();
     571
    570572  get_FADC_properties( &FADC_response_ampl, &FADC_response_fwhm);
    571573
     
    579581
    580582  if (!Trigger_Loop){
    581     get_Trigger_Single (&Trigger_threshold, &Trigger_multiplicity, &Trigger_topology);
     583    get_Trigger_Single (qThreshold, &Trigger_multiplicity, &Trigger_topology);
    582584    icontrigger=1;
    583585  }
     586  else
     587    get_threshold(qThreshold);
    584588
    585589  // get filenames
     
    595599  // get different parameters of the simulation
    596600
    597   qThreshold = get_threshold();
    598601  qTailCut = get_tail_cut();
    599602  simulateNSB = get_nsb( &meanNSB, &nphe2NSB );
     
    628631        rootname_loop);
    629632  }
    630   else{
     633  else if (Individual_Thres_Pixel == FALSE){
    631634    log(SIGNATURE,
    632635        "%s:\n\t%20s: %f\n\t%20s: %i\n\t%20s: %i\n",
    633636        "Single Trigger mode",
    634         "Threshold",Trigger_threshold,
     637        "Threshold",qThreshold[0],
    635638        "Multiplicity",Trigger_multiplicity,
    636639        "Topology",Trigger_topology);
    637640  }   
    638  
     641  else{
     642    log(SIGNATURE,
     643        "%s:\n\t%20s: %s\n\t%20s: %i\n\t%20s: %i\n",
     644        "Single Trigger mode",
     645        "Threshold","Different for each pixel",
     646        "Multiplicity",Trigger_multiplicity,
     647        "Topology",Trigger_topology);
     648  }
    639649  // log flags information
    640650
     
    659669 
    660670  log(SIGNATURE,
    661       "%s:\n\t%20s: %f\n\t%20s: %f\n\t%20s: %f %s\n\t%20s: %f %s\n",
     671      "%s:\n\t%20s: %f\n\t%20s: %f %s\n",
    662672      "Parameters",
    663       "q0 (Threshold)", qThreshold,
    664673      "t0 (Tail-cut)", qTailCut,
    665       "NSB (phes/pixel)", meanNSB, ONoff(simulateNSB),
    666       "i0 (Islands-cut)", nIslandsCut, ONoff(countIslands));
     674      "NSB (phes/pixel)", meanNSB, ONoff(simulateNSB));
    667675 
    668676  // log selections
     
    886894    HeaderTrig[0]->SetTopology((Short_t) Trigger_topology);
    887895    HeaderTrig[0]->SetMultiplicity((Short_t) Trigger_multiplicity);
    888     for(i=0;i<TRIGGER_PIXELS;i++){
    889       fpixelthres[i]=(Float_t)Trigger_threshold;
    890     }
    891     HeaderTrig[0]->SetThreshold( fpixelthres);
     896    HeaderTrig[0]->SetThreshold(qThreshold);
    892897    HeaderTrig[0]->SetAmplitud(Trigger_response_ampl);
    893898    HeaderTrig[0]->SetFwhm(Trigger_response_fwhm);
     
    902907          HeaderTrig[iconcount]->SetTopology((Short_t) itopocount+Trigger_loop_ltop);
    903908          HeaderTrig[iconcount]->SetMultiplicity((Short_t) imulticount+Trigger_loop_lmult);
    904           for(i=0;i<TRIGGER_PIXELS;i++){
    905             fpixelthres[i]=(Float_t)(ithrescount+Trigger_loop_lthres);
     909          for(int i=0;i<TRIGGER_PIXELS;i++){
     910            fpixelthres[i]=
     911              ((Float_t)(ithrescount+Trigger_loop_lthres)>=qThreshold[i])?
     912              (Float_t)(ithrescount+Trigger_loop_lthres):qThreshold[i];
    906913          }
    907914          HeaderTrig[iconcount]->SetThreshold( fpixelthres);
     
    13591366          for (int iconcount=0,ithrescount=Trigger_loop_lthres;ithrescount<=Trigger_loop_uthres;ithrescount++){
    13601367            for (i=0;i<TRIGGER_PIXELS;i++)
    1361               fpixelthres[i]=(float) ithrescount;
     1368              fpixelthres[i]=
     1369                ((Float_t)(ithrescount)>=qThreshold[i])?
     1370                (Float_t)(ithrescount):qThreshold[i];
    13621371            Trigger.SetThreshold(fpixelthres);
    13631372
     
    14961505          Trigger.SetMultiplicity(Trigger_multiplicity);
    14971506          Trigger.SetTopology(Trigger_topology);
    1498           for (i=0;i<TRIGGER_PIXELS;i++)
    1499             fpixelthres[i]=Trigger_threshold;
     1507          for (int i=0;i<TRIGGER_PIXELS;i++)
     1508            fpixelthres[i]=qThreshold[i];
    15001509          Trigger.SetThreshold(fpixelthres);
    15011510                                 
     
    32383247//
    32393248// $Log: not supported by cvs2svn $
     3249// Revision 1.25  2001/05/08 08:07:54  blanch
     3250// New numbering for branches from different trigger conditions has been
     3251// implemented. Now, they are calles: ClassName;1., ClasNema;2., ...
     3252// The MontaCarlo Headers (MMcTrigHeader and MMcFadcHeader) have been move to
     3253// the RunHeaders tree. Also the MRawRunHeader is thera with some of its
     3254// information already filled.
     3255//
    32403256// Revision 1.24  2001/04/06 16:48:09  magicsol
    32413257// New camera version able to read the new format of the reflector output:
     
    32943310//
    32953311// $Log: not supported by cvs2svn $
     3312// Revision 1.25  2001/05/08 08:07:54  blanch
     3313// New numbering for branches from different trigger conditions has been
     3314// implemented. Now, they are calles: ClassName;1., ClasNema;2., ...
     3315// The MontaCarlo Headers (MMcTrigHeader and MMcFadcHeader) have been move to
     3316// the RunHeaders tree. Also the MRawRunHeader is thera with some of its
     3317// information already filled.
     3318//
    32963319// Revision 1.24  2001/04/06 16:48:09  magicsol
    32973320// New camera version able to read the new format of the reflector output:
Note: See TracChangeset for help on using the changeset viewer.