Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DTrigger_factory Class Reference

Implements a L1 trigger algorithm on simulated data in the form of a flag in the DTrigger object. The flag will indicate whether the level 1 trigger would have fired for the event based on the hit objects. This can be used by analysis programs to decide whether to process or ignore the event. More...

#include <DTrigger_factory.h>

+ Inheritance diagram for DTrigger_factory:

Public Member Functions

 DTrigger_factory ()
 
virtual ~DTrigger_factory ()
 
 DTrigger_factory ()
 
 ~DTrigger_factory ()
 

Private Member Functions

jerror_t init (void)
 Called once at program start. More...
 
jerror_t evnt (JEventLoop *locEventLoop, uint64_t locEventNumber)
 
jerror_t init (void)
 Called once at program start. More...
 
jerror_t brun (jana::JEventLoop *eventLoop, int32_t runnumber)
 Called everytime a new run number is detected. More...
 
jerror_t evnt (jana::JEventLoop *eventLoop, uint64_t eventnumber)
 Called every event. More...
 
jerror_t erun (void)
 Called everytime run number changes, provided brun has been called. More...
 
jerror_t fini (void)
 Called after last event of last event source has been processed. More...
 

Private Attributes

bool EMULATE_BCAL_LED_TRIGGER
 
bool EMULATE_FCAL_LED_TRIGGER
 
unsigned int BCAL_LED_NHITS_THRESHOLD
 
unsigned int FCAL_LED_NHITS_THRESHOLD
 
bool REQUIRE_START_COUNTER
 
double unattenuate_to_center
 

Detailed Description

Implements a L1 trigger algorithm on simulated data in the form of a flag in the DTrigger object. The flag will indicate whether the level 1 trigger would have fired for the event based on the hit objects. This can be used by analysis programs to decide whether to process or ignore the event.

Much of this is based on the information GlueX-doc-1043. What is currently implemented are two algorithms described on page 13. both require BCAL + 4*FCAL >= 2.0GeV. Additional requirements are:

L1afired: BCAL > 200 MeV && FCAL > 30 MeV

L1bfired: BCAL > 30 MeV && FCAL > 30 MeV && NSC > 0

The values of BCAL and FCAL and NSC used to make the decision are kept in the DTrigger object at Ebcal, Efcal, and Nschits respectively.

Definition at line 15 of file libraries/TRIGGER/DTrigger_factory.h.

Constructor & Destructor Documentation

DTrigger_factory::DTrigger_factory ( )
inline

Definition at line 18 of file libraries/TRIGGER/DTrigger_factory.h.

virtual DTrigger_factory::~DTrigger_factory ( )
inlinevirtual

Definition at line 19 of file libraries/TRIGGER/DTrigger_factory.h.

DTrigger_factory::DTrigger_factory ( )
inline
DTrigger_factory::~DTrigger_factory ( )
inline

Member Function Documentation

jerror_t DTrigger_factory::brun ( jana::JEventLoop *  eventLoop,
int32_t  runnumber 
)
private

Called everytime a new run number is detected.

Definition at line 64 of file plugins/Analysis/level1_trigger/DTrigger_factory.cc.

References DBCALGeometry::ATTEN_LENGTH, and DBCALGeometry::BCALFIBERLENGTH.

jerror_t DTrigger_factory::erun ( void  )
private

Called everytime run number changes, provided brun has been called.

Definition at line 161 of file plugins/Analysis/level1_trigger/DTrigger_factory.cc.

jerror_t DTrigger_factory::evnt ( JEventLoop *  locEventLoop,
uint64_t  locEventNumber 
)
private

In GlueX-doc-1043, it appaears the energy deposited in the BCAL is used. In reality, only the attenuated energy will be available to the L1 trigger electronics. If an average of the sum of both sides is used, it will be off by at most, 20% at the ends (excluding any dark pulsing effects). This conclusion comes from assuming we scale the values by e^(L/2/lambda) such that the value of the threshold is in GeV for energy deposited at the center of the module. The average of the two ends then is:

Eavg = (E*e^+x + E*e^-x)/2

or

Eavg = E * cosh(x)

where x = L/2/lambda L = 390 cm lambda = 300 cm

The dark pulses should contribute at most about 10 MeV.

For the BCAL "energy" we therefore take the average of the sums of the DBCALHits for each side knowing it is overestimated by as much as 20%.

The FCAL energy is just a straight sum of the FCAL hits

Definition at line 34 of file libraries/TRIGGER/DTrigger_factory.cc.

References BCAL_LED_NHITS_THRESHOLD, EMULATE_BCAL_LED_TRIGGER, EMULATE_FCAL_LED_TRIGGER, FCAL_LED_NHITS_THRESHOLD, DL1Trigger::fp_trig_mask, kSTATUS_EVIO, DTrigger::Set_L1FrontPanelTriggerBits(), DTrigger::Set_L1TriggerBits(), DL1MCTrigger::trig_mask, and DL1Trigger::trig_mask.

jerror_t DTrigger_factory::evnt ( jana::JEventLoop *  eventLoop,
uint64_t  eventnumber 
)
private

Called every event.

jerror_t DTrigger_factory::fini ( void  )
private

Called after last event of last event source has been processed.

Definition at line 169 of file plugins/Analysis/level1_trigger/DTrigger_factory.cc.

jerror_t DTrigger_factory::init ( void  )
private
jerror_t DTrigger_factory::init ( void  )
private

Called once at program start.

Member Data Documentation

unsigned int DTrigger_factory::BCAL_LED_NHITS_THRESHOLD
private

Definition at line 28 of file libraries/TRIGGER/DTrigger_factory.h.

Referenced by evnt(), and init().

bool DTrigger_factory::EMULATE_BCAL_LED_TRIGGER
private

Definition at line 25 of file libraries/TRIGGER/DTrigger_factory.h.

Referenced by evnt(), and init().

bool DTrigger_factory::EMULATE_FCAL_LED_TRIGGER
private

Definition at line 26 of file libraries/TRIGGER/DTrigger_factory.h.

Referenced by evnt(), and init().

unsigned int DTrigger_factory::FCAL_LED_NHITS_THRESHOLD
private

Definition at line 29 of file libraries/TRIGGER/DTrigger_factory.h.

Referenced by evnt(), and init().

bool DTrigger_factory::REQUIRE_START_COUNTER
private
double DTrigger_factory::unattenuate_to_center
private

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