Skip to content

Commit

Permalink
Merge pull request #29270 from fabiocos/fc-mtd-topomode
Browse files Browse the repository at this point in the history
MTD geometry: add new topology mode, adapt code to it
  • Loading branch information
cmsbuild authored Mar 27, 2020
2 parents ab18e8d + 289ec0b commit 507fd6c
Show file tree
Hide file tree
Showing 23 changed files with 101 additions and 46 deletions.
6 changes: 3 additions & 3 deletions Configuration/Geometry/python/dict2026Geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -1083,8 +1083,8 @@
1 : [
'Geometry/MTDCommonData/data/mtdMaterial/v1/mtdMaterial.xml',
'Geometry/MTDCommonData/data/btl/v1/btl.xml',
'Geometry/MTDCommonData/data/btl/v1/btlStructureTopology.xml',
'Geometry/MTDCommonData/data/etl/v3/etl.xml',
'Geometry/MTDCommonData/data/mtdParameters/v1/mtdStructureTopology.xml',
'Geometry/MTDCommonData/data/mtdParameters/v1/mtdParameters.xml',
],
3 : [
Expand All @@ -1111,9 +1111,9 @@
1 : [
'Geometry/MTDCommonData/data/mtdMaterial/v2/mtdMaterial.xml',
'Geometry/MTDCommonData/data/btl/v1/btl.xml',
'Geometry/MTDCommonData/data/btl/v1/btlStructureTopology.xml',
'Geometry/MTDCommonData/data/etl/v4/etl.xml',
'Geometry/MTDCommonData/data/mtdParameters/v1/mtdParameters.xml',
'Geometry/MTDCommonData/data/mtdParameters/v2/mtdStructureTopology.xml',
'Geometry/MTDCommonData/data/mtdParameters/v2/mtdParameters.xml',
],
3 : [
'Geometry/MTDSimData/data/v2/mtdsens.xml'
Expand Down
2 changes: 1 addition & 1 deletion DataFormats/ForwardDetId/interface/ETLDetId.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class ETLDetId : public MTDDetId {
/** Returns ETL module type number. */
inline int modType() const { return (id_ >> kETLmodTypeOffset) & kETLmodTypeMask; }

ETLDetId geographicalId() const;
ETLDetId geographicalId() const { return id_; }

// --------- Methods for the TDR ETL model only -----------
// meaningless for TP model
Expand Down
5 changes: 0 additions & 5 deletions DataFormats/ForwardDetId/src/ETLDetId.cc
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
#include "DataFormats/ForwardDetId/interface/ETLDetId.h"
#include <iomanip>

ETLDetId ETLDetId::geographicalId() const {
// strip off module type info
return ETLDetId(mtdSide(), mtdRR(), module(), 0);
}

std::ostream& operator<<(std::ostream& os, const ETLDetId& id) {
os << (MTDDetId&)id;
os << " ETL " << std::endl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@
'Geometry/ForwardCommonData/data/cmszdc.xml',
'Geometry/MTDCommonData/data/mtdMaterial/v1/mtdMaterial.xml',
'Geometry/MTDCommonData/data/btl/v1/btl.xml',
'Geometry/MTDCommonData/data/btl/v1/btlStructureTopology.xml',
'Geometry/MTDCommonData/data/etl/v3/etl.xml',
'Geometry/MTDCommonData/data/mtdParameters/v1/mtdStructureTopology.xml',
'Geometry/MTDCommonData/data/mtdParameters/v1/mtdParameters.xml',
)+
cms.vstring(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@
'Geometry/ForwardCommonData/data/cmszdc.xml',
'Geometry/MTDCommonData/data/mtdMaterial/v2/mtdMaterial.xml',
'Geometry/MTDCommonData/data/btl/v1/btl.xml',
'Geometry/MTDCommonData/data/btl/v1/btlStructureTopology.xml',
'Geometry/MTDCommonData/data/etl/v4/etl.xml',
'Geometry/MTDCommonData/data/mtdParameters/v1/mtdParameters.xml',
'Geometry/MTDCommonData/data/mtdParameters/v2/mtdStructureTopology.xml',
'Geometry/MTDCommonData/data/mtdParameters/v2/mtdParameters.xml',
)+
cms.vstring(
'Geometry/MuonCommonData/data/muonNumbering/TDR_DeV/muonNumbering.xml',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0"?>
<DDDefinition xmlns="http://www.cern.ch/cms/DDL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.cern.ch/cms/DDL ../../../DetectorDescription/Schema/DDLSchema.xsd">
<SpecParSection label="spec-pars2.xml">
<SpecParSection label="mtdStructureTopology.xml">

<SpecPar name="btlNumbering">
<SpecPar name="mtdNumbering">
<PartSelector path="//btl:BarrelTimingLayer"/>
<Parameter name="OnlyForMTDRecNumbering" value="MTD" eval="false"/>
<Parameter name="TopologyMode" value="MTDTopologyMode::barphiflat" eval="false"/>
Expand Down
16 changes: 16 additions & 0 deletions Geometry/MTDCommonData/data/mtdParameters/v2/mtdParameters.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0"?>
<DDDefinition xmlns="http://www.cern.ch/cms/DDL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.cern.ch/cms/DDL ../../../DetectorDescription/Schema/DDLSchema.xsd">
<ConstantsSection label="mtdParameters.xml" eval="true">

<Vector name="vPars" type="numeric" nEntries="4">
4, 4, 4, 24
</Vector>
<Vector name="BTL" type="numeric" nEntries="12">
22, 24, 16, 10, 0x1, 0x3, 0x3F, 0x3F, 1, 16, 3, 1
</Vector>
<Vector name="ETL" type="numeric" nEntries="12">
22, 24, 16, 7, 0x1, 0x3, 0x3F, 0xFF, 24, 4, 2, 8
</Vector>

</ConstantsSection>
</DDDefinition>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0"?>
<DDDefinition xmlns="http://www.cern.ch/cms/DDL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.cern.ch/cms/DDL ../../../DetectorDescription/Schema/DDLSchema.xsd">
<SpecParSection label="mtdStructureTopology.xml">

<SpecPar name="mtdNumbering">
<PartSelector path="//etl:EndcapTimingLayer"/>
<PartSelector path="//btl:BarrelTimingLayer"/>
<Parameter name="OnlyForMTDRecNumbering" value="MTD" eval="false"/>
<Parameter name="TopologyMode" value="MTDTopologyMode::btlv1etlv4" eval="false"/>
</SpecPar>


</SpecParSection>
</DDDefinition>

11 changes: 10 additions & 1 deletion Geometry/MTDCommonData/interface/MTDTopologyMode.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,21 @@
#include <string>
#include <algorithm>

#include "DataFormats/ForwardDetId/interface/BTLDetId.h"

namespace MTDTopologyMode {

enum class Mode { undefined = 0, tile = 1, bar = 2, barzflat = 3, barphiflat = 4 };
enum class Mode { undefined = 0, tile = 1, bar = 2, barzflat = 3, barphiflat = 4, btlv1etlv4 = 5 };

Mode MTDStringToEnumParser(const std::string&);

/** Returns BTLDetId::CrysLayout as a function of topology mode (to accomodate TDR/post TDR ETL scenarios). **/

inline BTLDetId::CrysLayout crysLayoutFromTopoMode(const int& topoMode) {
return (topoMode <= static_cast<int>(BTLDetId::CrysLayout::barphiflat) ? static_cast<BTLDetId::CrysLayout>(topoMode)
: BTLDetId::CrysLayout::barphiflat);
}

} // namespace MTDTopologyMode

#endif // Geometry_MTDCommonData_MTDTopologyMode_H
2 changes: 2 additions & 0 deletions Geometry/MTDCommonData/src/MTDTopologyMode.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ namespace MTDTopologyMode {
output = Mode::barzflat;
} else if (value == prefix + "barphiflat") {
output = Mode::barphiflat;
} else if (value == prefix + "btlv1etlv4") {
output = Mode::btlv1etlv4;
} else {
throw cms::Exception("MTDTopologyModeError") << "the value " << value << " is not defined.";
}
Expand Down
4 changes: 4 additions & 0 deletions Geometry/MTDCommonData/test/DD4hep_TestMTDNumbering.cc
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,10 @@ void DD4hep_TestMTDNumbering::analyze(const edm::Event& iEvent, const edm::Event
} else {
ETLDetId theId(etlNS_.getUnitID(thisN_));
dump << theId;
#ifdef EDM_ML_DEBUG
edm::LogInfo("DD4hep_TestMTDNumbering")
<< " ETLDetId = " << theId << "\n geographicalId = " << theId.geographicalId();
#endif
}
dump << "\n";
}
Expand Down
4 changes: 4 additions & 0 deletions Geometry/MTDCommonData/test/TestMTDNumbering.cc
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,10 @@ void TestMTDNumbering::analyze(const edm::Event& iEvent, const edm::EventSetup&
} else {
ETLDetId theId(etlNS_.getUnitID(thisN_));
dump << theId;
#ifdef EDM_ML_DEBUG
edm::LogInfo("TestMTDNumbering")
<< " ETLDetId = " << theId << "\n geographicalId = " << theId.geographicalId();
#endif
}
dump << "\n";
}
Expand Down
26 changes: 13 additions & 13 deletions Geometry/MTDSimData/data/v1/mtdProdCuts.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

<DDDefinition xmlns="http://www.cern.ch/cms/DDL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.cern.ch/cms/DDL ../../../DetectorDescription/Schema/DDLSchema.xsd">

<SpecParSection label="regions.xml" eval="true">
<SpecPar name="fasttime">
<PartSelector path="//BarrelTimingLayer"/>
<PartSelector path="//EndcapTimingLayer"/>
<Parameter name="CMSCutsRegion" value="FastTimerRegion" eval="false"/>
<Parameter name="ProdCutsForElectrons" value="0.1*mm"/>
<Parameter name="ProdCutsForPositrons" value="0.1*mm"/>
<Parameter name="ProdCutsForGamma" value="0.1*mm"/>
</SpecPar>
<SpecParSection label="mtdProdCuts.xml" eval="true">
<SpecPar name="fasttime">
<PartSelector path="//BarrelTimingLayer"/>
<PartSelector path="//EndcapTimingLayer"/>
<Parameter name="CMSCutsRegion" value="FastTimerRegion" eval="false"/>
<Parameter name="ProdCutsForElectrons" value="0.1*mm"/>
<Parameter name="ProdCutsForPositrons" value="0.1*mm"/>
<Parameter name="ProdCutsForGamma" value="0.1*mm"/>
</SpecPar>
<SpecPar name="fasttime-sens">
<PartSelector path="//BModule1Layer1Timingactive"/>
<PartSelector path="//BModule17Layer1Timingactive"/>
Expand All @@ -26,10 +26,10 @@
<PartSelector path="//EModule9Disc1Timingactive"/>
<PartSelector path="//EModule10Disc1Timingactive"/>
<PartSelector path="//EModule11Disc1Timingactive"/>
<Parameter name="CMSCutsRegion" value="FastTimerRegion" eval="false"/>
<Parameter name="ProdCutsForElectrons" value="0.1*mm"/>
<Parameter name="ProdCutsForPositrons" value="0.1*mm"/>
<Parameter name="ProdCutsForGamma" value="0.1*mm"/>
<Parameter name="CMSCutsRegion" value="FastTimerRegion" eval="false"/>
<Parameter name="ProdCutsForElectrons" value="0.1*mm"/>
<Parameter name="ProdCutsForPositrons" value="0.1*mm"/>
<Parameter name="ProdCutsForGamma" value="0.1*mm"/>
</SpecPar>

</SpecParSection>
Expand Down
2 changes: 1 addition & 1 deletion Geometry/MTDSimData/data/v1/mtdsens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<DDDefinition xmlns="http://www.cern.ch/cms/DDL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.cern.ch/cms/DDL ../../../DetectorDescription/Schema/DDLSchema.xsd">

<SpecParSection label="fasttimesens.xml" eval="true">
<SpecParSection label="mtdsens.xml" eval="true">
<SpecPar name="fasttimesenseBarrel">
<PartSelector path="//BModule1Layer1Timingactive"/>
<PartSelector path="//BModule17Layer1Timingactive"/>
Expand Down
2 changes: 1 addition & 1 deletion Geometry/MTDSimData/data/v2/mtdProdCuts.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<DDDefinition xmlns="http://www.cern.ch/cms/DDL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.cern.ch/cms/DDL ../../../DetectorDescription/Schema/DDLSchema.xsd">

<SpecParSection label="regions.xml" eval="true">
<SpecParSection label="mtdProdCuts.xml" eval="true">
<SpecPar name="fasttime">
<PartSelector path="//BarrelTimingLayer"/>
<PartSelector path="//EndcapTimingLayer"/>
Expand Down
2 changes: 1 addition & 1 deletion Geometry/MTDSimData/data/v2/mtdsens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<DDDefinition xmlns="http://www.cern.ch/cms/DDL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.cern.ch/cms/DDL ../../../DetectorDescription/Schema/DDLSchema.xsd">

<SpecParSection label="fasttimesens.xml" eval="true">
<SpecParSection label="mtdsens.xml" eval="true">
<SpecPar name="fasttimesenseBarrel">
<PartSelector path="//BModule1Layer1Timingactive"/>
<PartSelector path="//BModule17Layer1Timingactive"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#include "Geometry/MTDGeometryBuilder/interface/ProxyMTDTopology.h"
#include "Geometry/MTDGeometryBuilder/interface/RectangularMTDTopology.h"
#include "Geometry/MTDCommonData/interface/MTDTopologyMode.h"

// STL
#include <stack>
Expand Down Expand Up @@ -119,8 +120,8 @@ void MTDThresholdClusterizer::clusterize(const FTLRecHitCollection& input,

if (mtdId.mtdSubDetector() == MTDDetId::BTL) {
BTLDetId hitId(hit.detid());
DetId geoId = hitId.geographicalId(
(BTLDetId::CrysLayout)topo->getMTDTopologyMode()); //for BTL topology gives different layout id
//for BTL topology gives different layout id
DetId geoId = hitId.geographicalId(MTDTopologyMode::crysLayoutFromTopoMode(topo->getMTDTopologyMode()));
geoIdToIdx.emplace(geoId, index);
geoIds.emplace(geoId);
++index;
Expand Down
14 changes: 8 additions & 6 deletions RecoLocalFastTime/FTLCommonAlgos/src/MTDTimeCalib.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "Geometry/CommonDetUnit/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),
Expand All @@ -26,8 +27,8 @@ float MTDTimeCalib::getTimeCalib(const MTDDetId& id) const {
if (id.mtdSubDetector() == MTDDetId::BTL) {
time_calib += btlTimeOffset_;
BTLDetId hitId(id);
DetId geoId = hitId.geographicalId(
(BTLDetId::CrysLayout)topo_->getMTDTopologyMode()); //for BTL topology gives different layout 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) {
Expand All @@ -37,13 +38,14 @@ float MTDTimeCalib::getTimeCalib(const MTDDetId& id) const {
const ProxyMTDTopology& topoproxy = static_cast<const ProxyMTDTopology&>(thedet->topology());
const RectangularMTDTopology& topo = static_cast<const RectangularMTDTopology&>(topoproxy.specificTopology());

if (topo_->getMTDTopologyMode() == (int)BTLDetId::CrysLayout::tile) {
if (MTDTopologyMode::crysLayoutFromTopoMode(topo_->getMTDTopologyMode()) == BTLDetId::CrysLayout::tile) {
time_calib -= btlLightCollTime_; //simply remove the offset introduced at sim level
} else if (topo_->getMTDTopologyMode() == (int)BTLDetId::CrysLayout::bar ||
topo_->getMTDTopologyMode() == (int)BTLDetId::CrysLayout::barphiflat) {
} else if (MTDTopologyMode::crysLayoutFromTopoMode(topo_->getMTDTopologyMode()) == BTLDetId::CrysLayout::bar ||
MTDTopologyMode::crysLayoutFromTopoMode(topo_->getMTDTopologyMode()) ==
BTLDetId::CrysLayout::barphiflat) {
//for bars in phi
time_calib -= 0.5 * topo.pitch().first * btlLightCollSlope_; //time offset for bar time is L/2v
} else if (topo_->getMTDTopologyMode() == (int)BTLDetId::CrysLayout::barzflat) {
} else if (MTDTopologyMode::crysLayoutFromTopoMode(topo_->getMTDTopologyMode()) == BTLDetId::CrysLayout::barzflat) {
//for bars in z
time_calib -= 0.5 * topo.pitch().second * btlLightCollSlope_; //time offset for bar time is L/2v
}
Expand Down
7 changes: 4 additions & 3 deletions SimFastTiming/FastTimingCommon/src/BTLDeviceSim.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "Geometry/CommonDetUnit/interface/GeomDetType.h"
#include "Geometry/MTDGeometryBuilder/interface/ProxyMTDTopology.h"
#include "Geometry/MTDGeometryBuilder/interface/RectangularMTDTopology.h"
#include "Geometry/MTDCommonData/interface/MTDTopologyMode.h"

#include "CLHEP/Random/RandGaussQ.h"

Expand Down Expand Up @@ -49,7 +50,7 @@ void BTLDeviceSim::getHitsResponse(const std::vector<std::tuple<int, uint32_t, f
continue; // to be ignored at RECO level

BTLDetId btlid(detId);
const int boundRef = btlid.modulesPerType(static_cast<BTLDetId::CrysLayout>(topo_->getMTDTopologyMode()));
const int boundRef = btlid.modulesPerType(MTDTopologyMode::crysLayoutFromTopoMode(topo_->getMTDTopologyMode()));
DetId geoId = BTLDetId(btlid.mtdSide(), btlid.mtdRR(), btlid.module() + boundRef * (btlid.modType() - 1), 0, 1);
const MTDGeomDet* thedet = geom_->idToDet(geoId);

Expand Down Expand Up @@ -88,8 +89,8 @@ void BTLDeviceSim::getHitsResponse(const std::vector<std::tuple<int, uint32_t, f
double distL = 0.5 * topo.pitch().second + 0.1 * hit.localPosition().y();

// This is for the layouts with bars along phi
if (topo_->getMTDTopologyMode() == (int)BTLDetId::CrysLayout::bar ||
topo_->getMTDTopologyMode() == (int)BTLDetId::CrysLayout::barphiflat) {
if (MTDTopologyMode::crysLayoutFromTopoMode(topo_->getMTDTopologyMode()) == BTLDetId::CrysLayout::bar ||
MTDTopologyMode::crysLayoutFromTopoMode(topo_->getMTDTopologyMode()) == BTLDetId::CrysLayout::barphiflat) {
distR = 0.5 * topo.pitch().first - 0.1 * hit.localPosition().x();
distL = 0.5 * topo.pitch().first + 0.1 * hit.localPosition().x();
}
Expand Down
2 changes: 1 addition & 1 deletion SimFastTiming/FastTimingCommon/src/ETLDeviceSim.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ void ETLDeviceSim::getHitsResponse(const std::vector<std::tuple<int, uint32_t, f
continue; // to be ignored at RECO level

ETLDetId etlid(detId);
DetId geoId = ETLDetId(etlid.mtdSide(), etlid.mtdRR(), etlid.module(), 0);
DetId geoId = ETLDetId(etlid.mtdSide(), etlid.mtdRR(), etlid.module(), etlid.modType());
const MTDGeomDet* thedet = geom_->idToDet(geoId);
if (thedet == nullptr) {
throw cms::Exception("ETLDeviceSim") << "GeographicalID: " << std::hex << geoId.rawId() << " (" << detId.rawId()
Expand Down
4 changes: 3 additions & 1 deletion Validation/MtdValidation/plugins/BtlDigiHitsValidation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
#include "Geometry/MTDGeometryBuilder/interface/ProxyMTDTopology.h"
#include "Geometry/MTDGeometryBuilder/interface/RectangularMTDTopology.h"

#include "Geometry/MTDCommonData/interface/MTDTopologyMode.h"

class BtlDigiHitsValidation : public DQMEDAnalyzer {
public:
explicit BtlDigiHitsValidation(const edm::ParameterSet&);
Expand Down Expand Up @@ -103,7 +105,7 @@ void BtlDigiHitsValidation::analyze(const edm::Event& iEvent, const edm::EventSe

for (const auto& dataFrame : *btlDigiHitsHandle) {
BTLDetId detId = dataFrame.id();
DetId geoId = detId.geographicalId(static_cast<BTLDetId::CrysLayout>(topology->getMTDTopologyMode()));
DetId geoId = detId.geographicalId(MTDTopologyMode::crysLayoutFromTopoMode(topology->getMTDTopologyMode()));
const MTDGeomDet* thedet = geom->idToDet(geoId);
if (thedet == nullptr)
throw cms::Exception("BtlDigiHitsValidation") << "GeographicalID: " << std::hex << geoId.rawId() << " ("
Expand Down
4 changes: 3 additions & 1 deletion Validation/MtdValidation/plugins/BtlLocalRecoValidation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
#include "Geometry/MTDGeometryBuilder/interface/ProxyMTDTopology.h"
#include "Geometry/MTDGeometryBuilder/interface/RectangularMTDTopology.h"

#include "Geometry/MTDCommonData/interface/MTDTopologyMode.h"

struct MTDHit {
float energy;
float time;
Expand Down Expand Up @@ -164,7 +166,7 @@ void BtlLocalRecoValidation::analyze(const edm::Event& iEvent, const edm::EventS

for (const auto& recHit : *btlRecHitsHandle) {
BTLDetId detId = recHit.id();
DetId geoId = detId.geographicalId(static_cast<BTLDetId::CrysLayout>(topology->getMTDTopologyMode()));
DetId geoId = detId.geographicalId(MTDTopologyMode::crysLayoutFromTopoMode(topology->getMTDTopologyMode()));
const MTDGeomDet* thedet = geom->idToDet(geoId);
if (thedet == nullptr)
throw cms::Exception("BtlLocalRecoValidation") << "GeographicalID: " << std::hex << geoId.rawId() << " ("
Expand Down
4 changes: 3 additions & 1 deletion Validation/MtdValidation/plugins/BtlSimHitsValidation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
#include "Geometry/MTDGeometryBuilder/interface/ProxyMTDTopology.h"
#include "Geometry/MTDGeometryBuilder/interface/RectangularMTDTopology.h"

#include "Geometry/MTDCommonData/interface/MTDTopologyMode.h"

struct MTDHit {
float energy;
float time;
Expand Down Expand Up @@ -169,7 +171,7 @@ void BtlSimHitsValidation::analyze(const edm::Event& iEvent, const edm::EventSet

// --- Get the SIM hit global position
BTLDetId detId(hit.first);
DetId geoId = detId.geographicalId(static_cast<BTLDetId::CrysLayout>(topology->getMTDTopologyMode()));
DetId geoId = detId.geographicalId(MTDTopologyMode::crysLayoutFromTopoMode(topology->getMTDTopologyMode()));
const MTDGeomDet* thedet = geom->idToDet(geoId);
if (thedet == nullptr)
throw cms::Exception("BtlSimHitsValidation") << "GeographicalID: " << std::hex << geoId.rawId() << " ("
Expand Down

0 comments on commit 507fd6c

Please sign in to comment.