CMS 3D CMS Logo

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

#include <MTDTimeCalib.h>

Public Member Functions

float getTimeCalib (const MTDDetId &id) const
 
 MTDTimeCalib (edm::ParameterSet const &conf, const MTDGeometry *geom, const MTDTopology *topo)
 
 ~MTDTimeCalib ()
 

Private Attributes

float btlLightCollSlope_
 
float btlLightCollTime_
 
float btlTimeOffset_
 
float etlTimeOffset_
 
const MTDGeometrygeom_
 
const MTDTopologytopo_
 

Detailed Description

Definition at line 11 of file MTDTimeCalib.h.

Constructor & Destructor Documentation

MTDTimeCalib::MTDTimeCalib ( edm::ParameterSet const &  conf,
const MTDGeometry geom,
const MTDTopology topo 
)

Definition at line 11 of file MTDTimeCalib.cc.

12  :
13  geom_(geom),
14  topo_(topo),
15  btlTimeOffset_( conf.getParameter<double>("BTLTimeOffset") ),
16  etlTimeOffset_( conf.getParameter<double>("ETLTimeOffset") ),
17  btlLightCollTime_( conf.getParameter<double>("BTLLightCollTime") ),
18  btlLightCollSlope_( conf.getParameter<double>("BTLLightCollSlope") )
19 {
20 }
float etlTimeOffset_
Definition: MTDTimeCalib.h:25
float btlLightCollSlope_
Definition: MTDTimeCalib.h:29
float btlLightCollTime_
Definition: MTDTimeCalib.h:28
const MTDTopology * topo_
Definition: MTDTimeCalib.h:23
float btlTimeOffset_
Definition: MTDTimeCalib.h:24
const MTDGeometry * geom_
Definition: MTDTimeCalib.h:22
MTDTimeCalib::~MTDTimeCalib ( )
inline

Definition at line 16 of file MTDTimeCalib.h.

References getTimeCalib().

16 {};

Member Function Documentation

float MTDTimeCalib::getTimeCalib ( const MTDDetId id) const

Definition at line 23 of file MTDTimeCalib.cc.

References BTLDetId::bar, BTLDetId::barphiflat, BTLDetId::barzflat, MTDDetId::BTL, btlLightCollSlope_, btlLightCollTime_, btlTimeOffset_, TauDecayModes::dec, MTDDetId::ETL, etlTimeOffset_, Exception, MTDDetId::FastTime, BTLDetId::geographicalId(), geom_, MTDTopology::getMTDTopologyMode(), MTDGeometry::idToDet(), createfilelist::int, RectangularMTDTopology::pitch(), DetId::rawId(), ProxyMTDTopology::specificTopology(), BTLDetId::tile, topo_, and GeomDet::topology().

Referenced by MTDRecHitAlgo::makeRecHit(), and ~MTDTimeCalib().

24 {
25  if (id.subDetector() != MTDDetId::FastTime)
26  {
27  throw cms::Exception("MTDTimeCalib") << "MTDDetId: " << std::hex
28  << id.rawId()
29  << " is invalid!" << std::dec
30  << std::endl;
31  }
32 
33  float time_calib = 0.;
34 
35  if ( id.mtdSubDetector() == MTDDetId::BTL )
36  {
37  time_calib += btlTimeOffset_;
38  BTLDetId hitId(id);
39  DetId geoId = hitId.geographicalId( (BTLDetId::CrysLayout) topo_->getMTDTopologyMode() ); //for BTL topology gives different layout id
40  const MTDGeomDet* thedet = geom_->idToDet(geoId);
41 
42  if( thedet == nullptr ) {
43  throw cms::Exception("MTDTimeCalib") << "GeographicalID: " << std::hex
44  << geoId.rawId()
45  << " (" << id.rawId()<< ") is invalid!" << std::dec
46  << std::endl;
47  }
48  const ProxyMTDTopology& topoproxy = static_cast<const ProxyMTDTopology&>(thedet->topology());
49  const RectangularMTDTopology& topo = static_cast<const RectangularMTDTopology&>(topoproxy.specificTopology());
50 
52  {
53  time_calib -= btlLightCollTime_; //simply remove the offset introduced at sim level
54  }
57  )
58  {
59  //for bars in phi
60  time_calib -= 0.5*topo.pitch().first*btlLightCollSlope_; //time offset for bar time is L/2v
61  }
63  {
64  //for bars in z
65  time_calib -= 0.5*topo.pitch().second*btlLightCollSlope_; //time offset for bar time is L/2v
66  }
67  }
68  else if ( id.mtdSubDetector() == MTDDetId::ETL )
69  {
70  time_calib += etlTimeOffset_;
71  }
72  else
73  {
74  throw cms::Exception("MTDTimeCalib") << "MTDDetId: " << std::hex
75  << id.rawId()
76  << " is invalid!" << std::dec
77  << std::endl;
78  }
79 
80  return time_calib;
81 }
float etlTimeOffset_
Definition: MTDTimeCalib.h:25
CrysLayout
Definition: BTLDetId.h:66
virtual const Topology & topology() const
Definition: GeomDet.cc:81
float btlLightCollSlope_
Definition: MTDTimeCalib.h:29
int getMTDTopologyMode() const
Definition: MTDTopology.h:74
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:50
float btlLightCollTime_
Definition: MTDTimeCalib.h:28
const MTDGeomDet * idToDet(DetId) const override
Definition: MTDGeometry.cc:184
virtual const PixelTopology & specificTopology() const
const MTDTopology * topo_
Definition: MTDTimeCalib.h:23
float btlTimeOffset_
Definition: MTDTimeCalib.h:24
Definition: DetId.h:18
const MTDGeometry * geom_
Definition: MTDTimeCalib.h:22
Detector identifier class for the Barrel Timing Layer. The crystal count must start from 0...
Definition: BTLDetId.h:18
std::pair< float, float > pitch() const override

Member Data Documentation

float MTDTimeCalib::btlLightCollSlope_
private

Definition at line 29 of file MTDTimeCalib.h.

Referenced by getTimeCalib().

float MTDTimeCalib::btlLightCollTime_
private

Definition at line 28 of file MTDTimeCalib.h.

Referenced by getTimeCalib().

float MTDTimeCalib::btlTimeOffset_
private

Definition at line 24 of file MTDTimeCalib.h.

Referenced by getTimeCalib().

float MTDTimeCalib::etlTimeOffset_
private

Definition at line 25 of file MTDTimeCalib.h.

Referenced by getTimeCalib().

const MTDGeometry* MTDTimeCalib::geom_
private

Definition at line 22 of file MTDTimeCalib.h.

Referenced by getTimeCalib().

const MTDTopology* MTDTimeCalib::topo_
private

Definition at line 23 of file MTDTimeCalib.h.

Referenced by getTimeCalib().