CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
CTPPSDiamondRecHitProducerAlgorithm Class Reference

#include <CTPPSDiamondRecHitProducerAlgorithm.h>

Public Member Functions

void build (const TotemRPGeometry *, const edm::DetSetVector< CTPPSDiamondDigi > &, edm::DetSetVector< CTPPSDiamondRecHit > &)
 
 CTPPSDiamondRecHitProducerAlgorithm (const edm::ParameterSet &conf)
 

Private Attributes

int t_shift_
 
double ts_to_ns_
 Conversion constant between HPTDC time slice and absolute time (in ns) More...
 

Detailed Description

Definition at line 23 of file CTPPSDiamondRecHitProducerAlgorithm.h.

Constructor & Destructor Documentation

CTPPSDiamondRecHitProducerAlgorithm::CTPPSDiamondRecHitProducerAlgorithm ( const edm::ParameterSet conf)

Definition at line 13 of file CTPPSDiamondRecHitProducerAlgorithm.cc.

13  :
14  ts_to_ns_( iConfig.getParameter<double>( "timeSliceNs" ) ),
15  t_shift_( iConfig.getParameter<int>( "timeShift" ) )
16 {}
double ts_to_ns_
Conversion constant between HPTDC time slice and absolute time (in ns)

Member Function Documentation

void CTPPSDiamondRecHitProducerAlgorithm::build ( const TotemRPGeometry geom,
const edm::DetSetVector< CTPPSDiamondDigi > &  input,
edm::DetSetVector< CTPPSDiamondRecHit > &  output 
)

Definition at line 19 of file CTPPSDiamondRecHitProducerAlgorithm.cc.

References edm::DetSetVector< T >::begin(), edm::DetSetVector< T >::end(), edm::DetSetVector< T >::find_or_insert(), TotemRPGeometry::GetDetector(), edm::DetSet< T >::push_back(), lumiQTWidget::t, FrontierCondition_GT_autoExpress_cfi::t0, t_shift_, DetGeomDesc::translation(), and ts_to_ns_.

Referenced by CTPPSDiamondRecHitProducer::produce().

20 {
21  for ( edm::DetSetVector<CTPPSDiamondDigi>::const_iterator vec = input.begin(); vec != input.end(); ++vec )
22  {
23  const CTPPSDiamondDetId detid( vec->detId() );
24 
25  const DetGeomDesc* det = geom->GetDetector( detid );
26  const float x_pos = det->translation().x(),
27  x_width = 2.0 * det->params().at( 0 ), // parameters stand for half the size
28  y_pos = det->translation().y(),
29  y_width = 2.0 * det->params().at( 1 );
30 
31  edm::DetSet<CTPPSDiamondRecHit>& rec_hits = output.find_or_insert( detid );
32 
33  for ( edm::DetSet<CTPPSDiamondDigi>::const_iterator digi = vec->begin(); digi != vec->end(); ++digi )
34  {
35  const int t = digi->getLeadingEdge();
36  if ( t==0 ) { continue; }
37 
38  const int t0 = ( t-t_shift_ ) % 1024,
39  time_slice = ( t-t_shift_ ) / 1024;
40 
41  rec_hits.push_back( CTPPSDiamondRecHit( x_pos, x_width, y_pos, y_width, // spatial information
42  ( t0 * ts_to_ns_ ),
43  ( digi->getTrailingEdge()-t0 ) * ts_to_ns_,
44  time_slice,
45  digi->getHPTDCErrorFlags(),
46  digi->getMultipleHit() ) );
47  }
48  }
49 }
void push_back(const T &t)
Definition: DetSet.h:68
Reconstructed hit in diamond detectors.
DetGeomDesc * GetDetector(unsigned int) const
returns geometry of a detector performs necessary checks, returns NULL if fails input is raw ID ...
reference find_or_insert(det_id_type id)
Definition: DetSetVector.h:254
double ts_to_ns_
Conversion constant between HPTDC time slice and absolute time (in ns)
Geometrical description of a detector.
Definition: DetGeomDesc.h:40
DDTranslation translation() const
Definition: DetGeomDesc.h:87
iterator end()
Return the off-the-end iterator.
Definition: DetSetVector.h:361
Detector ID class for CTPPS Timing Diamond detectors. Bits [19:31] : Assigend in CTPPSDetId Calss Bit...
iterator begin()
Return an iterator to the first DetSet.
Definition: DetSetVector.h:346
collection_type::const_iterator const_iterator
Definition: DetSet.h:33
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:104

Member Data Documentation

int CTPPSDiamondRecHitProducerAlgorithm::t_shift_
private

Definition at line 33 of file CTPPSDiamondRecHitProducerAlgorithm.h.

Referenced by build().

double CTPPSDiamondRecHitProducerAlgorithm::ts_to_ns_
private

Conversion constant between HPTDC time slice and absolute time (in ns)

Definition at line 32 of file CTPPSDiamondRecHitProducerAlgorithm.h.

Referenced by build().