CMS 3D CMS Logo

List of all members | Public Types | Static Public Member Functions
CSCRecHitTrait Struct Reference

Public Types

using GeometryType = CSCGeometry
 
using InputType = CSCRecHit2DCollection
 
using RecHitRef = edm::Ref< CSCRecHit2DCollection >
 
using RecHitRefVector = edm::RefVector< CSCRecHit2DCollection >
 

Static Public Member Functions

static CSCDetId detid (const CSCRecHit2D &cscRechit)
 
static void emplace_back (RecHitClusterCollection *clusters, math::RhoEtaPhiVectorF const &position, int nStation, float avgStation, RecHitRefVector const &rechits)
 
static std::string producerName ()
 
static std::string recHitLabel ()
 
static int station (const CSCRecHit2D &cscRechit)
 

Detailed Description

Definition at line 209 of file RechitClusterProducer.cc.

Member Typedef Documentation

◆ GeometryType

Definition at line 210 of file RechitClusterProducer.cc.

◆ InputType

Definition at line 211 of file RechitClusterProducer.cc.

◆ RecHitRef

Definition at line 212 of file RechitClusterProducer.cc.

◆ RecHitRefVector

Definition at line 213 of file RechitClusterProducer.cc.

Member Function Documentation

◆ detid()

static CSCDetId CSCRecHitTrait::detid ( const CSCRecHit2D cscRechit)
inlinestatic

Definition at line 218 of file RechitClusterProducer.cc.

References CSCRecHit2D::cscDetId().

Referenced by station().

218 { return cscRechit.cscDetId(); }
CSCDetId cscDetId() const
Definition: CSCRecHit2D.h:58

◆ emplace_back()

static void CSCRecHitTrait::emplace_back ( RecHitClusterCollection clusters,
math::RhoEtaPhiVectorF const &  position,
int  nStation,
float  avgStation,
RecHitRefVector const &  rechits 
)
inlinestatic

Definition at line 219 of file RechitClusterProducer.cc.

References bsc_activity_cfg::clusters, position, CSCDetId::ring(), mathSSE::sqrt(), CSCDetId::station(), and hcalRecHitTable_cff::time.

223  {
224  int nME11 = 0;
225  int nME12 = 0;
226  int nME41 = 0;
227  int nME42 = 0;
228  float timeSpread = 0.0;
229  float time = 0.0;
230  float time_strip = 0.0; // for timeSpread calculation
231  for (auto const& rechit : rechits) {
232  CSCDetId cscdetid = rechit->cscDetId();
233  int stationRing = (CSCDetId::station(cscdetid) * 10 + CSCDetId::ring(cscdetid));
234  if (CSCDetId::ring(cscdetid) == 4)
235  stationRing = (CSCDetId::station(cscdetid) * 10 + 1); // ME1/a has ring==4
236  if (stationRing == 11)
237  nME11++;
238  if (stationRing == 12)
239  nME12++;
240  if (stationRing == 41)
241  nME41++;
242  if (stationRing == 42)
243  nME42++;
244  time += (rechit->tpeak() + rechit->wireTime());
245  time_strip += rechit->tpeak();
246  }
247  float invN = 1.f / rechits.size();
248  time = (time / 2.f) * invN;
249  time_strip = time_strip * invN;
250 
251  //derive cluster statistics
252  for (auto& rechit : rechits) {
253  timeSpread += (rechit->tpeak() - time_strip) * (rechit->tpeak() - time_strip);
254  }
255  timeSpread = std::sqrt(timeSpread * invN);
256 
257  //set nMB1,nMB2 to 0
259  position, rechits.size(), nStation, avgStation, time, timeSpread, nME11, nME12, nME41, nME42, 0, 0);
260  clusters->emplace_back(cls);
261  }
T sqrt(T t)
Definition: SSEVec.h:23
int station() const
Definition: CSCDetId.h:79
static int position[264][3]
Definition: ReadPGInfo.cc:289
int ring() const
Definition: CSCDetId.h:68

◆ producerName()

static std::string CSCRecHitTrait::producerName ( )
inlinestatic

Definition at line 215 of file RechitClusterProducer.cc.

215 { return "cscRechitClusterProducer"; }

◆ recHitLabel()

static std::string CSCRecHitTrait::recHitLabel ( )
inlinestatic

Definition at line 214 of file RechitClusterProducer.cc.

214 { return "csc2DRecHits"; }

◆ station()

static int CSCRecHitTrait::station ( const CSCRecHit2D cscRechit)
inlinestatic

Definition at line 217 of file RechitClusterProducer.cc.

References detid(), and CSCDetId::station().

Referenced by geometryXMLparser.DTAlignable::index(), and geometryXMLparser.CSCAlignable::index().

217 { return CSCDetId::station(detid(cscRechit)); }
static CSCDetId detid(const CSCRecHit2D &cscRechit)
int station() const
Definition: CSCDetId.h:79