CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
CTPPSDiamondRecHitProducerAlgorithm Class Reference

#include <CTPPSDiamondRecHitProducerAlgorithm.h>

Public Member Functions

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

Private Attributes

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 {}
double ts_to_ns_
Conversion constant between HPTDC time slice and absolute time (in ns)

Member Function Documentation

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

Definition at line 18 of file CTPPSDiamondRecHitProducerAlgorithm.cc.

References edm::DetSetVector< T >::find_or_insert(), CTPPSGeometry::getSensor(), DetGeomDesc::params(), DetGeomDesc::parentZPosition(), edm::DetSet< T >::push_back(), lumiQTWidget::t, cscNeutronWriter_cfi::t0, CTPPSDiamondRecHit::TIMESLICE_WITHOUT_LEADING, DetGeomDesc::translation(), and ts_to_ns_.

Referenced by CTPPSDiamondRecHitProducer::produce().

19 {
20  for ( const auto& vec : input ) {
21  const CTPPSDiamondDetId detid( vec.detId() );
22 
23  if ( detid.channel() > 20 ) continue; // VFAT-like information, to be ignored
24 
25  // retrieve the geometry element associated to this DetID
26  const DetGeomDesc* det = geom->getSensor( detid );
27 
28  const float x_pos = det->translation().x(),
29  y_pos = det->translation().y();
30  float z_pos = 0.;
31  z_pos = det->parentZPosition(); // retrieve the plane position;
32 
33  const float x_width = 2.0 * det->params().at( 0 ), // parameters stand for half the size
34  y_width = 2.0 * det->params().at( 1 ),
35  z_width = 2.0 * det->params().at( 2 );
36 
37  edm::DetSet<CTPPSDiamondRecHit>& rec_hits = output.find_or_insert( detid );
38 
39  for ( const auto& digi : vec ) {
40  if ( digi.getLeadingEdge() == 0 && digi.getTrailingEdge() == 0 ) continue;
41 
42  const int t = digi.getLeadingEdge();
43  const int t0 = t % 1024;
44  const int time_slice = ( t != 0 ) ? t / 1024 : CTPPSDiamondRecHit::TIMESLICE_WITHOUT_LEADING;
45 
46  int tot = 0;
47  if ( t != 0 && digi.getTrailingEdge() != 0 ) tot = ( (int)digi.getTrailingEdge() ) - t;
48 
49  rec_hits.push_back( CTPPSDiamondRecHit( x_pos, x_width, y_pos, y_width, z_pos, z_width, // spatial information
50  ( t0 * ts_to_ns_ ),
51  ( tot * ts_to_ns_),
52  0., // time precision
53  time_slice,
54  digi.getHPTDCErrorFlags(),
55  digi.getMultipleHit() ) );
56  }
57  }
58 }
Translation translation() const
Definition: DetGeomDesc.h:66
void push_back(const T &t)
Definition: DetSet.h:68
Reconstructed hit in diamond detectors.
reference find_or_insert(det_id_type id)
Definition: DetSetVector.h:254
const DetGeomDesc * getSensor(unsigned int id) const
returns geometry of a detector performs necessary checks, returns NULL if fails
double ts_to_ns_
Conversion constant between HPTDC time slice and absolute time (in ns)
Geometrical description of a sensor.
Definition: DetGeomDesc.h:35
float parentZPosition() const
Definition: DetGeomDesc.h:58
static constexpr int TIMESLICE_WITHOUT_LEADING
std::vector< double > params() const
Definition: DetGeomDesc.h:68
Detector ID class for CTPPS Timing Diamond detectors. Bits [19:31] : Assigend in CTPPSDetId Calss Bit...

Member Data Documentation

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().