Changeset 6460 for trunk


Ignore:
Timestamp:
02/14/05 16:34:04 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r6459 r6460  
    8686   * mraw/MRawFileRead.cc:
    8787     - return kERROR if ReInit fails
     88
     89   * mfilter/MFSoftwareTrigger.[h,cc]: 
     90     - updated to allow using time coincidence
     91     - changed default values
     92     - added a pattern independant trigger algorithm
    8893
    8994
  • trunk/MagicSoft/Mars/mfilter/MFSoftwareTrigger.cc

    r6459 r6460  
    133133        return 0;
    134134
    135     const Float_t tm1 = (*fTme)[idx];
    136     if (fTimeWindow>0 && TMath::Abs(tm1-tm0)>fTimeWindow)
     135    const Float_t tm1 = fTme ? (*fTme)[idx] : 0;
     136    if (fTme && TMath::Abs(tm1-tm0)>fTimeWindow)
    137137        return 0;
    138138
     
    341341                continue;
    342342
    343             if (fTimeWindow>0)
     343            if (fTme)
    344344            {
    345345                const Float_t t0 = (*fTme)[pix0.GetPixId()];
     
    377377    }
    378378
    379     fTme = (MArrivalTime*)pList->FindObject("MArrivalTime");
    380     if (!fTme)
    381     {
    382         *fLog << err << "MArrivalTime not found... aborting." << endl;
    383         return kFALSE;
    384     }
    385 
     379    fTme = 0;
     380    if (fTimeWindow>0)
     381    {
     382        fTme = (MArrivalTime*)pList->FindObject("MArrivalTime");
     383        if (!fTme)
     384        {
     385            *fLog << err << "MArrivalTime not found... aborting." << endl;
     386            return kFALSE;
     387        }
     388    }
    386389
    387390    memset(fCut, 0, sizeof(fCut));
     
    437440    *fLog << (int)(fCut[0]*100/GetNumExecutions());
    438441    *fLog << "%) Evts fullfilled" << type;
    439     *fLog << " (Thresh>=" << fThreshold << ", Num>=";
    440     *fLog << (int)fNumNeighbors << ", Win=" << fTimeWindow << ")" << endl;
     442    *fLog << " (Thresh>=" << fThreshold << ", Num>=" << (int)fNumNeighbors;
     443    if (fTimeWindow>0)
     444        *fLog << ", Win=" << fTimeWindow;
     445    *fLog << ")" << endl;
    441446    *fLog << " " << setw(7) << fCut[1] << " (" << setw(3) ;
    442447    *fLog << (int)(fCut[1]*100/GetNumExecutions());
  • trunk/MagicSoft/Mars/mfilter/MFSoftwareTrigger.h

    r3454 r6460  
    99class MGeomCam;
    1010class MCerPhotEvt;
     11class MCerPhotPix;
     12class MArrivalTime;
    1113
    1214class MFSoftwareTrigger : public MFilter
    1315{
     16public:
     17    enum TriggerType_t {
     18        kSinglePixelNeighbors,
     19        kAnyPattern/*,
     20        kMagicLvl1*/
     21    };
     22
    1423private:
    15     const MGeomCam    *fCam; // Camera Geometry
    16     const MCerPhotEvt *fEvt; // Cerenkov Photon Event
     24    const MGeomCam     *fCam; // Camera Geometry
     25    const MCerPhotEvt  *fEvt; // Cerenkov Photon Event
     26    const MArrivalTime *fTme;
    1727
    18     Float_t     fNumMinPhotons; // nuber of minimum required photons
     28    Float_t     fThreshold;     // nuber of minimum required photons
     29    Float_t     fTimeWindow;    // Window for time coincidence
    1930    Byte_t      fNumNeighbors;  // number of required neighbours
    2031
     
    2334    Bool_t      fResult;
    2435
     36    TriggerType_t fType;
     37
     38    enum {
     39        kWasChecked     = BIT(21),
     40        kAboveThreshold = BIT(22),
     41        kIsCoincident   = BIT(23)
     42    };
     43
    2544    Int_t PreProcess(MParList *pList);
    2645    Int_t Process();
    2746    Int_t PostProcess();
    2847
     48    void ResetBits(Int_t bits) const;
     49    Bool_t CheckPixel(const MCerPhotPix &pix) const;
    2950    Bool_t SwTrigger() const;
     51    Bool_t SwCoincidence() const;
     52    //Int_t CheckCoincidence(Int_t idx, Float_t tm0) const;
     53    //Bool_t MagicLvl1Trigger() const;
     54    Int_t  CountPixels(Int_t idx, Float_t tm) const;
     55    Bool_t ClusterTrigger() const;
    3056
    3157    Bool_t IsExpressionTrue() const { return fResult; }
     
    3460    MFSoftwareTrigger(const char *name=NULL, const char *title=NULL);
    3561
    36     void SetNumMinPhotons(Float_t minphotons) { fNumMinPhotons = minphotons; }
    37     void SetNumNeighbors(Byte_t num) { fNumNeighbors = num; }
     62    void SetThreshold(Float_t min)          { fThreshold    = min; }
     63    void SetNumNeighbors(Byte_t num)        { fNumNeighbors = num; }
     64    void SetTimeWindow(Float_t win=-1)      { fTimeWindow   = win; }
     65    void SetTriggerType(TriggerType_t type) { fType = type; }
     66
     67    Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print=kFALSE);
    3868
    3969    ClassDef(MFSoftwareTrigger, 0) // Filter for software trigger
Note: See TracChangeset for help on using the changeset viewer.