Changeset 19695 for trunk/Mars


Ignore:
Timestamp:
09/27/19 20:13:47 (5 years ago)
Author:
tbretz
Message:
Added an option to write the trigger channel intp the raw channels to sample the trigger channel instead of the raw channels.
Location:
trunk/Mars/msimcamera
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Mars/msimcamera/MSimTrigger.cc

    r19683 r19695  
    112112      fMinMultiplicity(-1),
    113113      fCableDelay(21),
    114       fCableDamping(0.)     // default Damping Set to zero, so users, who do not set
    115                             // the CableDamoing in the ceres.rc do not see a difference.
     114      fCableDamping(0.),    // default Damping Set to zero, so users, who do not set
     115      fDebugTrigger(kFALSE) // the CableDamoing in the ceres.rc do not see a difference.
    116116
    117117{
     
    301301        return kFALSE;
    302302
    303     if (!fSimulateElectronics)
     303    if (!fSimulateElectronics && !fDebugTrigger)
    304304    {
    305305        *fLog << inf << "Simulation of electronics switched off... first photon will trigger." << endl;
     
    400400    *fLog << "Using fCableDelay " << fCableDelay << " samples" << endl;
    401401    *fLog << "Using fCableDamping " << fCableDamping << endl;
     402
     403    if (!fSimulateElectronics)
     404        *fLog << inf << "Simulation of electronics switched off... first photon will trigger." << endl;
    402405
    403406    ////////////////////////////////
     
    516519    const Float_t max = fCamera->GetValidRangeMax()-(nsamp-pulspos);
    517520
    518     if (!fSimulateElectronics)
     521    // Check if routing should be done
     522    const Bool_t empty = fRouteAC.IsEmpty();
     523
     524    if (!fSimulateElectronics && (empty || (!empty && !fDebugTrigger)))
    519525    {
    520526        SetTrigger(min, -1);
     
    526532    // FIXME: Before we can bundle the channels we have to make a copy
    527533    //        and simulate clipping
    528 
    529     // Check if routing should be done
    530     const Bool_t empty = fRouteAC.IsEmpty();
    531534
    532535    // If no channels are summed the number of patches stays the same
     
    560563            }
    561564        }
     565
     566        if (fDebugTrigger)
     567        {
     568            for (UInt_t patch_id=0; patch_id<npatch; patch_id++)
     569            {
     570                const MArrayI &row = fRouteAC.GetRow(patch_id);
     571                for (UInt_t pxl_in_patch=0; pxl_in_patch<row.GetSize(); pxl_in_patch++)
     572                {
     573                    const UInt_t pixel_id = row[pxl_in_patch];
     574                    if (pixel_id<fCamera->GetNumChannels())
     575                        (*fCamera)[pixel_id].CopySignal((*patches)[patch_id]);
     576                }
     577            }
     578        }
     579    }
     580
     581    if (!fSimulateElectronics)
     582    {
     583        SetTrigger(min, -1);
     584        return kTRUE;
    562585    }
    563586
     
    865888    }
    866889
    867 
     890    if (IsEnvDefined(env, prefix, "DebugTrigger", print))
     891    {
     892        rc = kTRUE;
     893        fDebugTrigger = GetEnvValue(env, prefix, "DebugTrigger", fDebugTrigger);
     894    }
    868895
    869896    return rc;
  • trunk/Mars/msimcamera/MSimTrigger.h

    r19683 r19695  
    5353    Float_t fCableDamping;              // the signal is damped a bit when reflecting at the end of the cable and is inverted as well.
    5454                                        // Damping factor in [-1..0]. In short tests by Kai Schennetten it looked like -0.96.
     55
     56    Bool_t fDebugTrigger;               // Copy the sum signal back to the camera for debugging purpose
     57
    5558#if 0
    5659    // debugging
Note: See TracChangeset for help on using the changeset viewer.