SimDaqMultTrigger Class Reference

#include <SimDaqMultTrigger.h>

Inheritance diagram for SimDaqMultTrigger:
SimDaqTrigger

List of all members.

Public Member Functions

 SimDaqMultTrigger (void)
virtual Bool_t ApplyTriggerAt (PlexHandle plex, SimDigitList &sortedDigitList, UInt_t startAt, UInt_t stopAt)

Private Member Functions

 ClassDef (SimDaqMultTrigger, 1)

Private Attributes

Int_t fNhits

Detailed Description

Definition at line 3 of file SimDaqMultTrigger.h.


Constructor & Destructor Documentation

SimDaqMultTrigger::SimDaqMultTrigger ( void   ) 

Definition at line 13 of file SimDaqMultTrigger.cxx.

00013                                         :
00014   SimDaqTrigger()
00015 {
00016 }


Member Function Documentation

Bool_t SimDaqMultTrigger::ApplyTriggerAt ( PlexHandle  plex,
SimDigitList sortedDigitList,
UInt_t  startAt,
UInt_t  stopAt 
) [virtual]

Implements SimDaqTrigger.

Definition at line 19 of file SimDaqMultTrigger.cxx.

References SimDaqTrigger::fM, SimDaqTrigger::fN, fNhits, SimDaqTrigger::fThreshold, PlexPlaneId::GetPlane(), PlexHandle::GetStripEndId(), PlexStripEndId::IsValid(), Msg::kDebug, MSG, and PlexPixelSpotId::SetSpot().

00024 {
00025   //
00026   // this is the standard  PlaneTrigger just working on significant hits
00027   // which are above some ADC threshold. it furthermore requires
00028   // a total number of hits to be present in the M plane window
00029   //
00030   MSG("DetSim",Msg::kDebug) << "Multiplicity Trigger Running." 
00031                             << "    Calculating " << fNhits << " hits in " 
00032                             << fN << " out of "
00033                             << fM <<" planes.\n";
00034 
00035   // Quick check: do we have enough hits at all?
00036   if(Int_t(stopAt-startAt) < fN) return false; // Not enough digits total.
00037 
00038   // Add the hits to a plane map.
00039   std::vector<Int_t> planeMap(600);
00040   for(UInt_t i = 0;i<planeMap.size();i++) planeMap[i]=0;
00041 
00042 
00043   Int_t totplanes = 0;
00044   Int_t firstPlane = 9999;
00045   Int_t lastPlane = -9999;
00046 
00047   for(UInt_t idig = startAt; idig<stopAt; idig++) {
00048     // Find the plane.
00049     if(sortedDigitList[idig].GetErrors()) continue;
00050     PlexPixelSpotId psid = sortedDigitList[idig].GetPixelSpotId();
00051     PlexStripEndId  seid = plex.GetStripEndId(psid);
00052     if(!seid.IsValid()) {
00053       psid.SetSpot(1);
00054       seid = plex.GetStripEndId(psid);
00055     }
00056     Int_t plane = seid.GetPlane();
00057     Int_t adc = sortedDigitList[idig].GetADC();
00058 
00059     if(plane > (Int_t)planeMap.size()) continue;
00060 
00061     if(adc>=fThreshold) {
00062       // Add plane to map.
00063       if(planeMap[plane] ==0){
00064         totplanes++;
00065       if(plane<firstPlane) firstPlane = plane;
00066       if(plane>lastPlane) lastPlane = plane;
00067       }
00068       
00069       planeMap[plane]++;
00070     }
00071   }
00072   
00073   // Second quick check: enough planes were hit in total.
00074   if(totplanes < fN) return false;
00075 
00076   for(int i = firstPlane; i <= lastPlane; i++) {
00077     Int_t nPlane = 0;
00078     Int_t nDigit = 0;
00079 
00080     for (Int_t j=0; (j<fM) && (i+j<=lastPlane); j++) {
00081       if ( planeMap[i+j]>0 ) {
00082         nPlane++;
00083         nDigit += planeMap[i+j];
00084       }
00085     }
00086     if ((nPlane>=fN)&&(nDigit>=fNhits)) {
00087       return true;
00088     }
00089     if (i+fM>lastPlane) break; // We're done... stop looking.
00090   }
00091   
00092   return false;
00093 }

SimDaqMultTrigger::ClassDef ( SimDaqMultTrigger  ,
 
) [private]

Reimplemented from SimDaqTrigger.


Member Data Documentation

Int_t SimDaqMultTrigger::fNhits [private]

Reimplemented from SimDaqTrigger.

Definition at line 17 of file SimDaqMultTrigger.h.

Referenced by ApplyTriggerAt().


The documentation for this class was generated from the following files:

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1