/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Public Member Functions | Static Public Member Functions | Private Attributes
ROsFeeTdcTool Class Reference

#include <ROsFeeTdcTool.h>

Inheritance diagram for ROsFeeTdcTool:
Inheritance graph
[legend]
Collaboration diagram for ROsFeeTdcTool:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ROsFeeTdcTool (const std::string &type, const std::string &name, const IInterface *parent)
virtual ~ROsFeeTdcTool ()
virtual StatusCode readoutTdc (const std::vector< int > &tdc_in, unsigned int first_cycle, unsigned int last_cycle, std::vector< int > &tdc_out)
 Modify the event.
virtual StatusCode initialize ()
virtual StatusCode finalize ()

Static Public Member Functions

static const InterfaceID & interfaceID ()
 Retrieve interface ID.

Private Attributes

bool m_multiHitTdc
int m_multiLimit
int m_tdcResetCycles
TF1 * m_fun

Detailed Description

Definition at line 20 of file ROsFeeTdcTool.h.


Constructor & Destructor Documentation

ROsFeeTdcTool::ROsFeeTdcTool ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Definition at line 24 of file ROsFeeTdcTool.cc.

  : GaudiTool(type,name,parent)
{
  declareInterface< IROsFeeTdcTool >(this) ;

  declareProperty("UseMultiHitTdc",m_multiHitTdc=true,
                  "Allow multi-hit TDC functionality?");
  declareProperty("MultiLimit",m_multiLimit=5,
                  "Number of allowed TDC's in one readout");
  declareProperty("TdcResetCycles",m_tdcResetCycles=32,
                  "Reset Time on the TDC, in TDC counts (640 MHz)");
}
ROsFeeTdcTool::~ROsFeeTdcTool ( ) [virtual]

Definition at line 39 of file ROsFeeTdcTool.cc.

{}

Member Function Documentation

StatusCode ROsFeeTdcTool::readoutTdc ( const std::vector< int > &  tdc_in,
unsigned int  first_cycle,
unsigned int  last_last,
std::vector< int > &  tdc_out 
) [virtual]

Modify the event.

Implements IROsFeeTdcTool.

Definition at line 52 of file ROsFeeTdcTool.cc.

{
    verbose() << "reading out tdc window ["
              << first_cycle << "," << last_cycle << ")" << endreq;

    if(tdc_out.size()>0) tdc_out.clear();
    
    // Select TDC values for readout
    std::vector<int>::const_iterator tdcIt;
    int prevTdcCycle = -2;
    int prevReadoutTdcCycle = -1000;
    for(tdcIt = tdc_in.begin(); tdcIt != tdc_in.end(); ++tdcIt){
      int tdcCycle= *tdcIt;
      // Skip TDC value if the signal has not dropped below threshold since last crossing
      if(tdcIt != tdc_in.begin())
        if( tdcCycle-*(tdcIt-1) == 1 ) {prevTdcCycle = tdcCycle; continue;} 
      // Skip TDC value if it is too close to previous threshold crossing
      double tdcReset = m_fun->GetRandom()/1.5625;
      if( (tdcCycle-prevReadoutTdcCycle)< (int)tdcReset ) {prevTdcCycle = tdcCycle; continue;}
      //if( (tdcCycle-prevReadoutTdcCycle)<m_tdcResetCycles ) {prevTdcCycle = tdcCycle; continue;}
      prevReadoutTdcCycle = tdcCycle;
      // Check if current TDC is in the readout window
      if( tdcCycle >= (int)first_cycle && tdcCycle < (int)last_cycle ){ 
        tdc_out.push_back(tdcCycle);
        // If multi-hit TDC is disabled, don't consider any more tdc values
        if( !m_multiHitTdc ) break;
        // If it reaches the number of tdc's limit, leave this.
        if( tdc_out.size() >= m_multiLimit ) break;
      }
      prevTdcCycle = tdcCycle;
    }

    verbose() << "      NTDC = " << tdc_out.size() << endreq; 
    
    return StatusCode::SUCCESS;
}
StatusCode ROsFeeTdcTool::initialize ( ) [virtual]

Definition at line 41 of file ROsFeeTdcTool.cc.

{
  m_fun = new TF1("f","-4845.33-337.431*x+13.1919*x*x-0.0950649*x*x*x",52,78);
  return StatusCode::SUCCESS;
}
StatusCode ROsFeeTdcTool::finalize ( ) [virtual]

Definition at line 47 of file ROsFeeTdcTool.cc.

{
  return StatusCode::SUCCESS;
}
const InterfaceID & IROsFeeTdcTool::interfaceID ( ) [static, inherited]

Retrieve interface ID.

Definition at line 8 of file IROsFeeTdcTool.cc.

{ 
    return IID_IROsFeeTdcTool; 
}

Member Data Documentation

Definition at line 39 of file ROsFeeTdcTool.h.

Definition at line 40 of file ROsFeeTdcTool.h.

Definition at line 41 of file ROsFeeTdcTool.h.

TF1* ROsFeeTdcTool::m_fun [private]

Definition at line 43 of file ROsFeeTdcTool.h.


The documentation for this class was generated from the following files:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 10:17:06 for ReadoutSim by doxygen 1.7.4