In trigger matching mode, you will also need to set a few additional parameters:
The remainder of this page assumes that you are setting up the TDC in trigger matching mode. In this mode, hits are reported if they occur within a programmable matching interval (window) of the trigger. To set up the TDC properly, it is important to understand the trigger matching window parameters. These are described in the TDC hardware manual on page 15. They are summarized as well in the figure below:
In our case, we will set up the TDC with a 2usec match window that ends exactly at the trigger time.
We will set the other module parameters as follows:
Setting up the TDC in this way will involve calling the following member functions on the TDC object:
See:
void initevt () { ... if(!pModule) { pModule= new CCAENV1x90(3, 0, 0xee000000); } // Initialization takes place every time initevt is called: // Set the trigger matching mode and associated parameters: pModule->TriggerMatchMode(); // (1) pModule->SetWindowWidth(2*40); // (2) pModule->SetWindowOffset(-2*40); // (3) pModule->SetExtraSearchMargin(1); // (4) pModule->SetRejectMargin(1); // (5) pModule->EnableTriggerTimeSubtraction(); // (6) // Set detection and resolution stuff: pModule->SetEdgeDetectMode(CCAENV1x90::EdgeMode_Leading); // (7) pModule->SetIndividualLSB(CCAENV1x90::Res_100ps); // (8) pModule->SetDoubleHitResolution(CCAENV1x90::DT_5ns); // (9) // Manage the event format: pModule->EnableTDCEncapsulation(); // (10) pModule->SetMaxHitsPerEvent(CCAENV1x90::HITS_UNLIMITED); // (11) pModule->EnableErrorMark(); // (12) pModule->SetErrorEnables(CCAENV1x90::ERR_VERNIER | CCAENV1x90::ERR_COARSE | CCAENV1x90::ERR_SELECT | CCAENV1x90::ERR_L1PARITY | CCAENV1x90::ERR_TFIFOPARITY | CCAENV1x90::ERR_MATCHERROR | CCAENV1x90::ERR_RFIFOPARITY | CCAENV1x90::ERR_RDOSTATE | CCAENV1x90::ERR_SUPPARITY | CCAENV1x90::ERR_CTLPARITY | CCAENV1x90::ERR_JTAGPARITY); // (13) pModule->EnableAllChannels(); // (14)
Back Constructing a module. Next Reading out events. Top Introduction
The production readout code to initialize the module will live in the EventSegment's Initialize member function:
void v1x90segment::Initialize() { // Set the trigger matching mode and associated parameters: m_TDC.TriggerMatchMode(); // (1) m_TDC.SetWindowWidth(2*40); // (2) m_TDC.SetWindowOffset(-2*40); // (3) m_TDC.SetExtraSearchMargin(1); // (4) m_TDC.SetRejectMargin(1); // (5) m_TDC.EnableTriggerTimeSubtraction(); // (6) // Set detection and resolution stuff: m_TDC.SetEdgeDetectMode(CCAENV1x90::EdgeMode_Leading); // (7) m_TDC.SetIndividualLSB(CCAENV1x90::Res_100ps); // (8) m_TDC.SetDoubleHitResolution(CCAENV1x90::DT_5ns); // (9) // Manage the event format: m_TDC.EnableTDCEncapsulation(); // (10) m_TDC.SetMaxHitsPerEvent(CCAENV1x90::HITS_UNLIMITED); // (11) m_TDC.EnableErrorMark(); // (12) m_TDC.SetErrorEnables(CCAENV1x90::ERR_VERNIER | CCAENV1x90::ERR_COARSE | CCAENV1x90::ERR_SELECT | CCAENV1x90::ERR_L1PARITY | CCAENV1x90::ERR_TFIFOPARITY | CCAENV1x90::ERR_MATCHERROR | CCAENV1x90::ERR_RFIFOPARITY | CCAENV1x90::ERR_RDOSTATE | CCAENV1x90::ERR_SUPPARITY | CCAENV1x90::ERR_CTLPARITY | CCAENV1x90::ERR_JTAGPARITY); // (13) m_TDC.EnableAllChannels(); // (14) }
Back Constructing a module. Next Reading out events. Top Introduction