CMS 3D CMS Logo

MTDTimeCalib.cc
Go to the documentation of this file.
2 
5 
10 
12  : geom_(geom),
13  topo_(topo),
14  btlTimeOffset_(conf.getParameter<double>("BTLTimeOffset")),
15  etlTimeOffset_(conf.getParameter<double>("ETLTimeOffset")),
16  btlLightCollTime_(conf.getParameter<double>("BTLLightCollTime")),
17  btlLightCollSlope_(conf.getParameter<double>("BTLLightCollSlope")) {}
18 
19 float MTDTimeCalib::getTimeCalib(const MTDDetId& id) const {
20  if (id.subDetector() != MTDDetId::FastTime) {
21  throw cms::Exception("MTDTimeCalib") << "MTDDetId: " << std::hex << id.rawId() << " is invalid!" << std::dec
22  << std::endl;
23  }
24 
25  float time_calib = 0.;
26 
27  if (id.mtdSubDetector() == MTDDetId::BTL) {
28  time_calib += btlTimeOffset_;
29  BTLDetId hitId(id);
30  //for BTL topology gives different layout id
32  const MTDGeomDet* thedet = geom_->idToDet(geoId);
33 
34  if (thedet == nullptr) {
35  throw cms::Exception("MTDTimeCalib") << "GeographicalID: " << std::hex << geoId.rawId() << " (" << id.rawId()
36  << ") is invalid!" << std::dec << std::endl;
37  }
38  const ProxyMTDTopology& topoproxy = static_cast<const ProxyMTDTopology&>(thedet->topology());
39  const RectangularMTDTopology& topo = static_cast<const RectangularMTDTopology&>(topoproxy.specificTopology());
40 
42  time_calib -= btlLightCollTime_; //simply remove the offset introduced at sim level
46  //for bars in phi
47  time_calib -= 0.5 * topo.pitch().first * btlLightCollSlope_; //time offset for bar time is L/2v
49  //for bars in z
50  time_calib -= 0.5 * topo.pitch().second * btlLightCollSlope_; //time offset for bar time is L/2v
51  }
52  } else if (id.mtdSubDetector() == MTDDetId::ETL) {
53  time_calib += etlTimeOffset_;
54  } else {
55  throw cms::Exception("MTDTimeCalib") << "MTDDetId: " << std::hex << id.rawId() << " is invalid!" << std::dec
56  << std::endl;
57  }
58 
59  return time_calib;
60 }
61 
63 
64 //--- Now use the Framework macros to set it all up:
BTLDetId.h
BTLDetId::CrysLayout::barzflat
MTDTimeCalib.h
TrackerGeomDet
Definition: TrackerGeomDet.h:6
GeomDetType.h
typelookup.h
ProxyMTDTopology::specificTopology
virtual const PixelTopology & specificTopology() const
Definition: ProxyMTDTopology.h:90
MTDTimeCalib
Definition: MTDTimeCalib.h:11
GeomDet::topology
virtual const Topology & topology() const
Definition: GeomDet.cc:67
MTDTimeCalib::btlLightCollSlope_
float btlLightCollSlope_
Definition: MTDTimeCalib.h:28
MTDTopologyMode.h
ETLDetId.h
MTDTopology::getMTDTopologyMode
int getMTDTopologyMode() const
Definition: MTDTopology.h:27
MTDTimeCalib::MTDTimeCalib
MTDTimeCalib(edm::ParameterSet const &conf, const MTDGeometry *geom, const MTDTopology *topo)
Definition: MTDTimeCalib.cc:11
DetId
Definition: DetId.h:17
MTDGeometry::idToDet
const MTDGeomDet * idToDet(DetId) const override
Definition: MTDGeometry.cc:171
BTLDetId
Detector identifier class for the Barrel Timing Layer. The crystal count must start from 0,...
Definition: BTLDetId.h:18
RectangularMTDTopology.h
relativeConstraints.geom
geom
Definition: relativeConstraints.py:72
BTLDetId::CrysLayout::barphiflat
MTDTimeCalib::btlTimeOffset_
float btlTimeOffset_
Definition: MTDTimeCalib.h:23
MTDTimeCalib::etlTimeOffset_
float etlTimeOffset_
Definition: MTDTimeCalib.h:24
MTDTimeCalib::getTimeCalib
float getTimeCalib(const MTDDetId &id) const
Definition: MTDTimeCalib.cc:19
MTDTopology
Definition: MTDTopology.h:13
edm::ParameterSet
Definition: ParameterSet.h:47
MTDTopologyMode::crysLayoutFromTopoMode
BTLDetId::CrysLayout crysLayoutFromTopoMode(const int &topoMode)
Definition: MTDTopologyMode.h:19
BTLDetId::CrysLayout::tile
BTLDetId::CrysLayout::bar
MTDTimeCalib::topo_
const MTDTopology * topo_
Definition: MTDTimeCalib.h:22
MTDDetId::FastTime
Definition: MTDDetId.h:24
TYPELOOKUP_DATA_REG
#define TYPELOOKUP_DATA_REG(_dataclass_)
Definition: typelookup.h:102
MTDTimeCalib::geom_
const MTDGeometry * geom_
Definition: MTDTimeCalib.h:21
RectangularMTDTopology
Definition: RectangularMTDTopology.h:39
ProxyMTDTopology
Definition: ProxyMTDTopology.h:28
ProxyMTDTopology.h
MTDGeometry
Definition: MTDGeometry.h:14
MTDDetId::BTL
Definition: MTDDetId.h:27
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
MTDTimeCalib::btlLightCollTime_
float btlLightCollTime_
Definition: MTDTimeCalib.h:27
MTDDetId::ETL
Definition: MTDDetId.h:27
MTDDetId
Detector identifier base class for the MIP Timing Layer.
Definition: MTDDetId.h:21
Exception
Definition: hltDiff.cc:245
BTLDetId::geographicalId
BTLDetId geographicalId(CrysLayout lay) const
Definition: BTLDetId.cc:171
TauDecayModes.dec
dec
Definition: TauDecayModes.py:142