Changeset 6460 for trunk/MagicSoft/Mars/mfilter
- Timestamp:
- 02/14/05 16:34:04 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/mfilter
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mfilter/MFSoftwareTrigger.cc
r6459 r6460 133 133 return 0; 134 134 135 const Float_t tm1 = (*fTme)[idx];136 if (fT imeWindow>0&& TMath::Abs(tm1-tm0)>fTimeWindow)135 const Float_t tm1 = fTme ? (*fTme)[idx] : 0; 136 if (fTme && TMath::Abs(tm1-tm0)>fTimeWindow) 137 137 return 0; 138 138 … … 341 341 continue; 342 342 343 if (fT imeWindow>0)343 if (fTme) 344 344 { 345 345 const Float_t t0 = (*fTme)[pix0.GetPixId()]; … … 377 377 } 378 378 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 } 386 389 387 390 memset(fCut, 0, sizeof(fCut)); … … 437 440 *fLog << (int)(fCut[0]*100/GetNumExecutions()); 438 441 *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; 441 446 *fLog << " " << setw(7) << fCut[1] << " (" << setw(3) ; 442 447 *fLog << (int)(fCut[1]*100/GetNumExecutions()); -
trunk/MagicSoft/Mars/mfilter/MFSoftwareTrigger.h
r3454 r6460 9 9 class MGeomCam; 10 10 class MCerPhotEvt; 11 class MCerPhotPix; 12 class MArrivalTime; 11 13 12 14 class MFSoftwareTrigger : public MFilter 13 15 { 16 public: 17 enum TriggerType_t { 18 kSinglePixelNeighbors, 19 kAnyPattern/*, 20 kMagicLvl1*/ 21 }; 22 14 23 private: 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; 17 27 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 19 30 Byte_t fNumNeighbors; // number of required neighbours 20 31 … … 23 34 Bool_t fResult; 24 35 36 TriggerType_t fType; 37 38 enum { 39 kWasChecked = BIT(21), 40 kAboveThreshold = BIT(22), 41 kIsCoincident = BIT(23) 42 }; 43 25 44 Int_t PreProcess(MParList *pList); 26 45 Int_t Process(); 27 46 Int_t PostProcess(); 28 47 48 void ResetBits(Int_t bits) const; 49 Bool_t CheckPixel(const MCerPhotPix &pix) const; 29 50 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; 30 56 31 57 Bool_t IsExpressionTrue() const { return fResult; } … … 34 60 MFSoftwareTrigger(const char *name=NULL, const char *title=NULL); 35 61 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); 38 68 39 69 ClassDef(MFSoftwareTrigger, 0) // Filter for software trigger
Note:
See TracChangeset
for help on using the changeset viewer.