Ignore:
Timestamp:
02/08/00 12:50:36 (25 years ago)
Author:
harald
Message:
This is the version of the class MTrigger that was presented at the
general MAGIC in BARCELONA at the beginning of February. It is inside the
repository for further development. Especially for a better implementation
of diskriminator, NN, secondLevelTrigger, and NSB simulations.
File:
1 edited

Legend:

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

    r307 r351  
    1 //
     1#ifndef __MTrigger__
     2#define __MTrigger__
     3
    24//     class MTrigger
    35//
     
    1214#include <math.h>
    1315
     16#include "TROOT.h"
    1417#include "TObject.h"
     18#include "TRandom.h"
     19#include "TH1.h"
    1520
    1621#include "Mdefine.h"
     22#include "MMcEvt.h"
    1723
    18 #define TRIGGER_TIME_SLICES    400
     24#include "MTriggerDefine.h"
     25
     26
     27//==========
     28//  MTrigger
    1929//
    20 //      We need 400 Time Slices of 0.25 nsec width.
    21 //      So the whole Time range we studies is 100 nsec.
     30//  The simulation of the Trigger for MonteCarlo Events is using this
     31//  class. So all methods concerning the trigger should be done inside this
     32//  class.
    2233//
    23 #define RESPONSE_SLICES        40
     34//  For a better understanding of the behavior of the trigger is here small
     35//  abstract of the trigger. This may change in the future.
    2436//
    25 //       This is for the standard response Signal to 1 Photoelectron
    26 //       that leaves the Photocathode
    27 //       The whole Timescale for the signal is 10 nsec
     37// 
     38//  We now from the camera program (This is the surrounding of the class
     39//  MTrigger.) that one photo electron leaves at time t the photo cathode
     40//  of the pixel number iPix).
     41//
     42//  At the end of the PMT, the preamp, the optical fiber transmission we
     43//  get a signal of a given shape. After some discussion with Eckart the
     44//  standard response function looks like this :   
     45//                                 
     46//  It is a gaussian Signal with a given FWHM.
     47//
     48//  So whenever a photo electron leaves the photo cathod, on has to add
     49//  the standard response function to the analog signal of the pixel.
     50//
     51//  Each pixel of the camera has such an summed-up analog signal. It may
     52//  look like this picture:
    2853//
    2954//
    30 //       These values are discussed with Eckart. We start from this point.
    31 #define RESPONSE_FWHM          2.
    32 #define RESPONSE_AMPLITUDE     1.
     55//  This is the input of the discriminator for the pixels. The output of
     56//  the discriminator is a digital signal. The response of the diskriminator
     57//  is not fixed at the moment. There are discussion about this topic.
     58// 
     59//  At the moment the response is very simple. Whenever the analog signal
     60//  is crossing a defined threshold from below to above, a digital signal
     61//  with a given length is created.
     62//
     63//  No one can start with the simulation of different trigger levels.
     64// 
     65//  The TriggerLevelZero is a very easy one. It is just looking if there
     66//  are more then N digital signals at level ON (=1). If this is the case,
     67//  a TriggerLevelZero signal is created.
    3368//
    34 //       This are the Standard values of the response function for
    35 //       1 photo electron.
    36 //       We assume a gaussian pulse with FWHM 2.5 nsec.
    37 //
     69//  The TriggerLevelOne is not implemented now. This will be a kind of next
     70//  neighbour condition (i.e. four neigbouring analog signals at the same
     71//  time, but this requests at least four digital signals at level ON, what
     72//  is equivalent with a TriggerLevelZero.   
     73// 
     74// 
     75class MTrigger {
    3876
    39 #define CHANNEL_THRESHOLD      2.
    40 //
    41 //       This is the diskriminator threshold for each individual channel
    42 //       First we set the value to 2 unit of the RESPONSE_AMPLITUDE
    43 //
    44 #define TRIGGER_GATE           3.
    45 //
    46 //       Here we set the width of the digital signal we get if the signal
    47 //       passes the diskriminator
    48 //
    49 #define TRIGGER_MULTI          4. 
    50 //
    51 //       We get a Level Zero Trigger, if we have a least TRIGGER_MULTI
    52 //       channels with a diskrimiator signal at the same time
    53 //
     77 private:
     78  //
     79  //    then for all pixels the shape of all the analog signals
     80  //
     81  Bool_t   used [TRIGGER_PIXELS] ;  //  a boolean to indicated if the pixels is used in this event
     82  Int_t    nphot[TRIGGER_PIXELS];   //  count the photo electrons per pixel (NSB phe are not counted)
     83 
     84  Float_t  *a_sig[TRIGGER_PIXELS] ; //  the analog signal for pixels
    5485
     86  Float_t  baseline[TRIGGER_PIXELS] ; //  for the baseline shift
     87
     88  //
     89  //    then for all pixels the shape of the digital signal
     90  //
     91  Bool_t  dknt [TRIGGER_PIXELS] ;  //  a boolean to indicated if the pixels has passed the diskrminator
     92  Float_t *d_sig[TRIGGER_PIXELS] ; //  the digital signal for all pixels
     93
     94  //
     95  //    and the sum of all digital signals
     96  //
     97  Float_t sum_d_sig[TRIGGER_TIME_SLICES] ;
     98
     99
     100  //
     101  //    first the data for the response function
     102  //
     103  Float_t fwhm_resp ;                      // fwhm of the phe_response function
     104  Float_t ampl_resp ;                      // amplitude of the phe_response function (in mV)
     105  Float_t sing_resp[ RESPONSE_SLICES ] ;   // the shape of the phe_response function
     106
     107  TH1F     *histPmt ;
     108  Float_t  histMean ;    // Mean value of the distribution of Rasmik (stored in histPmt)
     109  TRandom  *GenElec  ;   // RandomGenerator for the Electronic Noise
     110
     111  //
     112  //    some values for the trigger settings
     113  //
     114 
     115  Float_t chan_thres ; // the threshold (in mV) for each individuel pixels
     116  Float_t gate_leng  ; // the length of the digital signal if analog signal is above threshold
     117
     118  Float_t trigger_multi  ;  // Number of Pixels requested for a Trigger
     119
     120  //
     121  //  The lookup table for the next neighbours
     122  //
     123
     124  Int_t NN[TRIGGER_PIXELS][6] ;
     125 
     126  //
     127  //    some information about the different TriggerLevels in each Event
     128  //
     129
     130  Int_t  nZero ;         // how many ZeroLevel Trigger in one Event
     131  Int_t  SlicesZero[5] ; // Times Slices at which the ZeroLevel Triggers occur
     132
     133  Int_t  nFirst ;         // how many FirstLevel Trigger in one Event
     134  Int_t  SlicesFirst[5] ; // Times Slices at which the FirstLevel Triggers occur
     135
     136  Int_t  nSecond ;         // how many SecondLevel Trigger in one Event
     137  Int_t  SlicesSecond[5] ; // Times Slices at which the SecondLevel Triggers occur
     138
     139
     140public:
     141
     142  MTrigger() ;
     143
     144  ~MTrigger() ;
     145
     146  void Reset() ;
     147
     148  Float_t  Fill( Int_t, Float_t ) ; 
     149
     150  Float_t  FillNSB( Int_t, Float_t ) ; 
     151
     152  void ElecNoise() ;
     153
     154  Int_t Diskriminate() ;
     155
     156  Int_t FirstLevel() ;   
     157
     158  Bool_t PassNextNeighbour( Bool_t m[] ) ;
     159 
     160  void ShowSignal (MMcEvt *McEvt) ;
     161
     162  Float_t GetFirstLevelTime( Int_t il ) ;
     163
     164} ;
     165
     166#endif
     167
Note: See TracChangeset for help on using the changeset viewer.