/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
RecoLocalFastTime/FTLCommonAlgos/src/MTDTimeCalib.cc
56 строк
3 KB
Shahzad Malik Muzaffar
[RECONSTRUCTION] Drop Geometry/CommonDetUnit package
28 май 2026, 12:57
28 май 2026, 12:57
685f036
Код
Авторство
О чём код?
#include "RecoLocalFastTime/FTLCommonAlgos/interface/MTDTimeCalib.h" #include "DataFormats/ForwardDetId/interface/BTLDetId.h" #include "DataFormats/ForwardDetId/interface/ETLDetId.h" #include "Geometry/CommonTopologies/interface/GeomDetType.h" #include "Geometry/MTDGeometryBuilder/interface/ProxyMTDTopology.h" #include "Geometry/MTDGeometryBuilder/interface/RectangularMTDTopology.h" #include "Geometry/MTDCommonData/interface/MTDTopologyMode.h" MTDTimeCalib::MTDTimeCalib(edm::ParameterSet const& conf, const MTDGeometry* geom, const MTDTopology* topo) : geom_(geom), topo_(topo), btlLightCollSlope_(conf.getParameter<double>("BTLLightCollSlope")) {} float MTDTimeCalib::getTimeCalib(const MTDDetId& id) const { if (id.subDetector() != MTDDetId::FastTime) { throw cms::Exception("MTDTimeCalib") << "MTDDetId: " << std::hex << id.rawId() << " is invalid!" << std::dec << std::endl; } float time_calib = 0.; if (id.mtdSubDetector() == MTDDetId::BTL) { BTLDetId hitId(id); //for BTL topology gives different layout id DetId geoId = hitId.geographicalId(MTDTopologyMode::crysLayoutFromTopoMode(topo_->getMTDTopologyMode())); const MTDGeomDet* thedet = geom_->idToDet(geoId); if (thedet == nullptr) { throw cms::Exception("MTDTimeCalib") << "GeographicalID: " << std::hex << geoId.rawId() << " (" << id.rawId() << ") is invalid!" << std::dec << std::endl; } const ProxyMTDTopology& topoproxy = static_cast<const ProxyMTDTopology&>(thedet->topology()); const RectangularMTDTopology& topo = static_cast<const RectangularMTDTopology&>(topoproxy.specificTopology()); BTLDetId::CrysLayout btlL = MTDTopologyMode::crysLayoutFromTopoMode(topo_->getMTDTopologyMode()); if (static_cast<int>(btlL) >= static_cast<int>(BTLDetId::CrysLayout::barphiflat)) { //for bars in phi time_calib -= 0.5 * topo.pitch().first * btlLightCollSlope_; //time offset for bar time is L/2v } else { throw cms::Exception("MTDTimeCalib") << "BTL topology mode " << static_cast<int>(btlL) << " unsupported! Aborting"; } } else if (id.mtdSubDetector() == MTDDetId::ETL) { // no correction applied for ETL } else { throw cms::Exception("MTDTimeCalib") << "MTDDetId: " << std::hex << id.rawId() << " is invalid!" << std::dec << std::endl; } return time_calib; } #include "FWCore/Utilities/interface/typelookup.h" //--- Now use the Framework macros to set it all up: TYPELOOKUP_DATA_REG(MTDTimeCalib);