#include <SimDaqPlaneTrigger.h>
Inheritance diagram for SimDaqPlaneTrigger:

Public Member Functions | |
| virtual Bool_t | ApplyTriggerAt (PlexHandle plex, SimDigitList &sortedDigitList, UInt_t startAt, UInt_t stopAt) |
| SimDaqPlaneTrigger () | |
| virtual | ~SimDaqPlaneTrigger () |
Private Member Functions | |
| ClassDef (SimDaqPlaneTrigger, 1) | |
|
|
Definition at line 12 of file SimDaqPlaneTrigger.h. 00012 { }
|
|
|
Definition at line 13 of file SimDaqPlaneTrigger.h. 00013 { }
|
|
||||||||||||||||||||
|
Implements SimDaqTrigger. Definition at line 13 of file SimDaqPlaneTrigger.cxx. References PlexPlaneId::GetPlane(), PlexStripEndId::IsValid(), MSG, and PlexPixelSpotId::SetSpot(). 00018 {
00019 MSG("DetSim",Msg::kDebug) << "Plane Trigger Running." << endl;
00020
00021 // Quick check: do we have enough hits at all?
00022 if(Int_t(stopAt-startAt) < fN) return false; // Not enough digits total.
00023
00024 // Add the hits to a plane map.
00025 std::vector<Int_t> planeMap(600);
00026 for(UInt_t i = 0;i<planeMap.size();i++) planeMap[i]=0;
00027
00028
00029 Int_t totplanes = 0;
00030 Int_t firstPlane = 9999;
00031 Int_t lastPlane = -9999;
00032
00033 for(UInt_t idig = startAt; idig<stopAt; idig++) {
00034 // Find the plane.
00035 if(sortedDigitList[idig].GetErrors()) continue;
00036 PlexPixelSpotId psid = sortedDigitList[idig].GetPixelSpotId();
00037 PlexStripEndId seid = plex.GetStripEndId(psid);
00038 if(!seid.IsValid()) {
00039 psid.SetSpot(1);
00040 seid = plex.GetStripEndId(psid);
00041 }
00042 Int_t plane = seid.GetPlane();
00043
00044 if(plane > (Int_t)planeMap.size()) continue;
00045
00046 // Add plane to map.
00047 if(planeMap[plane] ==0){
00048 totplanes++;
00049 if(plane<firstPlane) firstPlane = plane;
00050 if(plane>lastPlane) lastPlane = plane;
00051 }
00052
00053 planeMap[plane]++;
00054 }
00055
00056 // Second quick check: enough planes were hit in total.
00057 if(totplanes < fN) return false;
00058
00059 for(int i = firstPlane; i <= lastPlane; i++) {
00060 Int_t nPlane = 0;
00061
00062 for (Int_t j=0; (j<fM) && (i+j<=lastPlane); j++) {
00063 if ( planeMap[i+j]>0 ) nPlane++;
00064 }
00065 if (nPlane>=fN) {
00066 return true;
00067 }
00068 if (i+fM>lastPlane) break; // We're done... stop looking.
00069 }
00070
00071 return false;
00072 }
|
|
||||||||||||
|
|
1.3.9.1